On Tue, 10 Sep 2002, cana rich wrote:

> 
>  To ansmer yours questions, i would like to make a C or C++ program
> which communicate via the serial port COM1 to a device. The device is a
> screen plasma. I would like the program to remote the sreen : switch on,
> switch off, change channel ...

> The serial communication setting is : 
> Baud : 4800 BPS 
> Data length : 8 bits 
> Parity : none 
> Stop bit : 1 bit 
> Flow control RTS/CTS 
> Communication code : ASCII code 
> Reception time out : 4 seconds 
> To do it, I need to send ASCII code. For exemple, to switch off the screen i must 
>send the "%A0001" code. 
> I need to receive the acknoledgment to know if it has been well done. (code for good 
>receive : "@S") 
> Thanks for your help. 
> Canarich 
>  

Since this is the second time you posted this question, I will try to help 
with my somewhat-relevant experience.

UNIX liked files.  It likes to make everything look like a file, or a 
stream writing to a file.  COM ports are no exception.  So you open 
/dev/ttyS0 just like a file and write or read it.

I say somewhat relevant because I have a Perl program that I GPL'ed a 
while ago that talks to an infrared tranceiver connected to a serial port.  
Even though you want to write yours in C/C++ the logic would be the same.  
Even if you don't know Perl, it should be informative to look at, since my 
program also captures result codes after sending out the command.

I'm currently moving to a new server so I don't have all the 
documentation back up on my server yet, but you can download the program 
itself at
http://thekramers.net/ir-1.0.tar

BTW, if anyone is actually interested in the program itelf, I should have 
a new version out in a few weeks.  That is, if I don't find a job by then 
;(

If you have more specific questions after looking at this and trying some 
things out, let me know. 

----------------------------------------------------------------------------
DDDD   David Kramer         [EMAIL PROTECTED]       http://thekramers.net
DK KD  
DKK D            There are 10 types of people in the world:
DK KD            those that understand binary, and those that don't. 
DDDD   



-- 
redhat-list mailing list
unsubscribe mailto:[EMAIL PROTECTED]?subject=unsubscribe
https://listman.redhat.com/mailman/listinfo/redhat-list

Reply via email to