From owner-freebsd-questions@FreeBSD.ORG Sat Dec 15 11:38:26 2012 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id EA0A4F70 for ; Sat, 15 Dec 2012 11:38:26 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx02.qsc.de (mx02.qsc.de [213.148.130.14]) by mx1.freebsd.org (Postfix) with ESMTP id A2C4C8FC0C for ; Sat, 15 Dec 2012 11:38:26 +0000 (UTC) Received: from r56.edvax.de (port-92-195-51-39.dynamic.qsc.de [92.195.51.39]) by mx02.qsc.de (Postfix) with ESMTP id CCD7924A40; Sat, 15 Dec 2012 12:38:18 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id qBFBcKhK001937; Sat, 15 Dec 2012 12:38:20 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Sat, 15 Dec 2012 12:38:20 +0100 From: Polytropon To: Robert Bonomi Subject: Re: modem communication Message-Id: <20121215123820.4c7943d8.freebsd@edvax.de> In-Reply-To: <201212151006.qBFA6sob067474@mail.r-bonomi.com> References: <201212151006.qBFA6sob067474@mail.r-bonomi.com> Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: sam.gh1986@gmail.com, freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: Polytropon List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Dec 2012 11:38:27 -0000 On Sat, 15 Dec 2012 04:06:54 -0600 (CST), Robert Bonomi wrote: > > From owner-freebsd-questions@freebsd.org Sat Dec 15 03:27:08 2012 > > Date: Sat, 15 Dec 2012 12:54:44 +0330 > > Subject: modem communication > > From: s m > > To: freebsd-questions@freebsd.org > > > > my program should work with all modems not a specific one. > > > > any hints or comments are really appreciated. > > Open the serial port at the beginning of the 'session', keep it open while > you do everything needed, then (and only then!) close the serial port. In addition, depending on how you access the modem, e. g. via open() or fopen(), you could use the corresponding flush operation - fsync() - to make sure the commands are written to the modem port _right now_. There should be no need to re-open the modem for every AT command you send. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...