RS232 read/write demo

RS232 read/write demo

Post by Albert Goodwil » Fri, 02 Feb 2001 09:05:22



Where can I find source code demonstrating RS232 serial port access?
(Reading and writing from/to COM ports)
 
 
 

RS232 read/write demo

Post by Juergen Saue » Fri, 02 Feb 2001 00:49:59



am Thu, 1 Feb 2001 11:05:22 +1100 in comp.os.linux.development.apps:

Quote:> Where can I find source code demonstrating RS232 serial port access?
> (Reading and writing from/to COM ports)

SERIAL-PROGRAMMING-howto on your Linux Box.
mfG
        Jojo

--

http://www.automatix.de to Mail me: remove: -not-for-spawm-

 
 
 

1. Sockets: write() writes OK, yet read() reads garbage...?

Strange thing happens. There is a TCP socket established between A and B. Some
information flows OK between the two. However, one particular sequence of
communication does not. A writes a command to B, and immediately goes into
read() for a responce. B does something with the message and writes back to A a
struct, with some fields set to important values. When A reads it (as the same
struct - both use the same header file), however, it contains garbage. All the
fiels are set to 0 (zero). And it reads the correct size of the struct:

  n = read( sock, &preamble, sizeof(preamble) );
  if( n < 0 || n > sizeof(preamble) )
   error...

What/where can the problem be? Does A (or maybe B) have to flush the socket
after it wrote a command, to make sure it does not read its own packet back?

Thanks.
--
Simon   B-)>

2. Strange System Hang when using swap?

3. Help: ./demo/demo: error in loading shared libraries: liballeg-3.9.36.so

4. Kernel 2.0.36 bug: initrd incompatible with UMSDOS root file system

5. Question on writing c program implement cp function using UNIX system calls - read, write, etc.

6. Help please...NT4.0 and Linux dual boot

7. read from RS232?

8. Problems installing RedHat to use the Paritition Magic boot manager.

9. Need help writing C program using UNIX system calls (read, write, etc) that copies files

10. reading from rs232 tty in ULTRIX

11. Serial I/O RS232 programming problem (wait for 10ms and read string)

12. Read & Read/Write Groups

13. How to share read-only to one client and read-write to all others?