Dave Thomas wrote:

> Wai-Sun Chia <waisun.chia / msa.dec.com> writes:
> 
> 
>>1. How do I set up the serial port to communicate with another serial 
>>devices? i.e. baudrate, parity, etc.
>>
> 
> What operating system are you using?
> 


Redhat.

> 
> 
>>2. I noticed that the IO class can only do canonical processing (i.e. by 
>>line). How about non-canonical (raw-mode)?
>>
> 
> You can also do raw reads (IO#read, IO#getc etc)
> 


I'll try that..

> 
>>I'd really hate to go back to 'C' after discovering the joys of 
>>Ruby..ugh. :-/
>>
> 
> Even if you had to (and I don't think you do in this case), you could
> simply write the low level interface in C and the rest in
> Ruby. Interfacing C to Ruby is very simple.
> 


I was thinking of a Termios class subclass of IO, that will have methods 
like Termios#baudrate, Termios#parity, etc.. With this class you can 
open a device, set all the serial parameters, and off you go.

What do you think?



-- 
Wai-Sun "Squidster" Chia
Unix/Web Developer/RHCE
Professional Services