[Twisted-Python] Selectable SerialPort Windows/Linux

exarkun at twistedmatrix.com exarkun at twistedmatrix.com
Tue Sep 14 10:28:17 EDT 2010

On 02:00 pm, mhubig at imko.de wrote:
>On Tue, Sep 14, 2010 at 3:46 PM, <exarkun at twistedmatrix.com> wrote:
>>I'm not sure I understand this.  What is a "Master-Slave" protocol? 
>>would someone not benefit from a Twisted-based implementation of such 
>OK I'm not sure either ;-) this is why I ask. But in my case I have the
>situation: behind my serial port I have a bus system made of me (the 
>and some slaves. The slaves are absolute passive until I send them a
>After I've send a command to one of my slaves the salve ALWAY reply by
>a packet.
>So what's the benefit if I have a "deamon thread" waiting the hole time 
>something from the serial line if the only time it can get something is
>after the master has send a packet? The communication
>is totally synchronous.

Do you ever want to interact with more than one slave?  Do your slaves 
ever have any bugs that prevent them from responding?  Do you want to be 
able to unit test your protocol code easily?  If  you want any of this, 
you might want to use Twisted.

Also, there generally aren't any threads involved when you're using 
Twisted's serial port support.


More information about the Twisted-Python mailing list