[Tinyos-help] SerialForwarder Problem and Question

Terence Joseph tjormor at hotmail.com
Thu Sep 15 05:18:21 PDT 2005


I was wondering if someone could explain the SerialForwarder application to 
me in a bit more detail as I seem to be having a problem connecting a client 
application to read the data it is sending to the TCP port. The following is 
my understanding of what goes on.  Please correct me if I'm wrong:

SerialForwarder takes data from the com port specified in the command line 
and passes it to a TCP port so client applications can connect and receive 
the data.  In my case SerialForwarder defaults to TCP port 9001 which means 
the client application would have to try to connect to port 9001 in order to 
establish a valid connection.  As SerialForwarder is using the TCP protocol 
it must therefore make a connection with the client application.  Therefore 
it "listens" for a client trying to connect (I assume no data gets sent to 
the port while it is listening).  After the client is detected the TCP 
"three-way handshake" takes place (again I am assuming that this is what 
happens as it is the TCP protocol).  Once the three-way handshake has taken 
place a reference number for this particular connection now exists and data 
can get sent to the port.  The client can then use this reference number to 
read the data being sent to the port by SerialForwarder.

Is there any specific information the client application needs to know in 
order to read this data correctly?  How does it know how many bytes are 
being sent? Does it need to know the packet structure - If so what is it? I 
assume TCP takes care of the packet structure and that this information is 
not needed (I am not talking about trying to make sense of the data just 
actually getting it to display on the screen as the program "Listener" does 

So far I can get a valid connection with my client application.  I can then 
read from the TCP port once only for each connection.  The value that comes 
out on the first read of each connection is 5421 Hex (21,537 Dec).  Does 
this number mean anything or is it just gibberish?  The problem occurs when 
I try to read from the port again on the same connection it seems to just 
hang and no data comes out.  I can't understand what the problem is.

Can anyone clarify the above and maybe offer some advice as to what the 
problem might be? Thanks for your time.

Best Regards,

Dating has never been easier - get FREE Match.com membership! 

More information about the Tinyos-help mailing list