>I am trying to establish a connection b/w port1 and port2 ( com ports
>/dev/sttyS0 and dev/sttyS1
Generally, data sent via a serial port on one computer is not
synchronized to the cpu of receiving computer, but when you send
and receive with ports on the same computer, the cpu necessarily
services each in a sequential order and can never do both at the
same time. The two ports are timed in lock step...
For that reason it is never a good idea to develop serial port
code using a connection between two ports on the same computer.
As soon as you move the code to two distinct computers,
everything relating to timing changes...
>I am able to do initial configuration as opening port communications
>properly for both the ports
>I have two different programs
>for writing and reading simultaneously from port1 to port2 or vice
>but I am unable to see the data coming from port 1 to port 2 when the
>lenght of string wrriten oat one end exceeds 16 characters.
Very likely your code would appear to "work" as you expect if it
ran on two distinct computers, though perhaps not. It's more
difficult to read "x or more" data bytes from a serial port than
it is to read "x or fewer".
For example, if the send port is being given 16 bytes max per
interrupt, between interrupts the receive side will see 16 bytes
max per call to read. At that point the CPU goes through the
cycle again. Hence you get data in 16 byte chunks. On a pair
of computers... you might see 16 on one read, and 64 on the
next! If the sending system is servicing the serial port more
frequently than the receiving system is, most reads will produce
larger numbers of bytes, though obviously it could also be
exactly the other way around too!
Quote:>sometimes the configuration with baud rates as 19200 and 9600 does not
>work at all.
>I am very much Puzzeled..
>want HELP !!!!!!!!!!!!ASAP
The only way anyone can help debug your code is if you make the
code available. If you can make it small enough, post the
pertinent parts. If not, put it on a web page, and post a URL.
(Is this code for HPUX, or for Linux? You've posted to an odd
set of newsgroups...)
Floyd L. Davidson <http://web.newsguy.com/floyd_davidson>