PATCH] microcom enhancements and fixes

Steve Bradshaw shbradshaw at gmail.com
Thu Jan 17 06:02:10 UTC 2008


Hello,

I have made some modifications to microcom to make it
more useful to me.  In particular, I needed to send
a ^C and a Break to the remote device (Cisco router).

Here are the more detailed changes:
     . Catch common signals to clean up the lock file
       and TTY modes.
     . Allow stdin to not be a TTY so pipes can be used.
     . Save both TTY settings before changing them to
       make cleanup easier.
     . Clear ISIG so that control characters (e.g., ^C,
       ^Z, ^U, etc) are passed through to the device.
       Turn off IEXTEN and BRKINT.  Enable HUPCL and
       CREAD.
     . Set the device communications mode to 8-1-N.
     . Removed the stdin flush calls at the start and end.
       I don't think that they are needed.
     . Removed ignore of SIGINT.  If user is a TTY,
       there won't be a SIGINT because ISIG is now
       cleared.  If user is not a TTY (e.g., a pipe),
       then SIGINT should stop the program (now that
       SIGINT is caught).
     . Send data from the device to the user's stdout
       rather than the stdin so that the program output
       can be redirected.
     . Translate ^@ into a line break.

Here's the patch:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: microcom.patch
Type: text/x-patch
Size: 5432 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20080116/1bc953f4/attachment-0002.bin 


More information about the busybox mailing list