Your Universal Remote Control Center
RemoteCentral.com
Philips Pronto Professional Forum - View Post
Up level
Up level
The following page was printed from RemoteCentral.com:

Login:
Pass:
 
 

Original thread:
Post 2 made on Monday October 19, 2009 at 15:24
Barry Gordon
Founding Member
Joined:
Posts:
August 2001
2,157
Use asynchronous communications, not synchronous. Read the developers guide.

Perform the read in the ondata event which fires with async communications when there is input data. Accumulate the data read on successive invocations data+=socket.read(). While the data buffer contains a CR Char 13), remove all the chars in the data buffer up to and including the CR as that is what you want and process them as the message. Leave what was in the buffer after the CR (if there was anything) as the start of the next message. When the data buffer contains no CR, exit the ondata function

Last edited by Barry Gordon on October 26, 2009 14:36.


Hosting Services by ipHouse