On Mon, Dec 07, 2009 at 12:59:02PM +0100, Hendrik Sattler wrote:
> Zitat von Robert Millan <[email protected]>:
>> Package: wnpp
>> Severity: wishlist
>> Owner: Robert Millan <[email protected]>
>>
>> * Package name    : modem-cmd
>>   Version         : 0.0.1
>>   Upstream Author : me
>> * URL             : none yet, debian-native
>> * License         : GPL
>>   Programming Lang: C
>>   Description     : send arbitrary AT commands to your modem
>>
>>  modem-cmd can be used to send arbitrary AT commands to a modem device
>>  over a serial line.
>>  .
>>  For example:
>>  .
>>  $ modem-cmd /dev/ttyUSB0 ATDT123456
>
> What's the practical difference to
>   echo "ATDT123456\r" > /dev/ttyUSB0
> ?

This doesn't work.  The modem expects you to flush its output buffer
before it will accept new commands.

Since there might be some junk in it already (e.g. if you interrupted
an ATDT command), it needs to be flushed at startup too.  This requires
non-blocking I/O.

That aside, terminal capabilities need to be set via termios.

And it's not obvious that you want '\r' instead of '\n'.  In fact, I figured
that out by stracing "cu".

-- 
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to