[Twisted-Python] Twisted serialport dataReceived() provides fragmented data

Phil Mayers p.mayers at imperial.ac.uk
Thu Aug 29 09:46:06 MDT 2013


On 29/08/13 16:38, Sivakumar Balasubramanian wrote:

> Is there something that I doing wrong in my code?

Yes. You are sub-classing Int16StringReceiver, but then breaking things 
by overriding dataReceived. You should be implementing stringReceived, 
and you'll get complete strings.

dataReceived does not get "messages" - a higher layer needs to buffer 
and reassemble them, which Int16StringReceiver does, and passes the 
messages to stringReceived.



More information about the Twisted-Python mailing list