1

Is it possible to get an 'event' callback within Twisted when DCD or CTS lines change state?

Currently my app uses twisted.internet.serialport.SerialPort and a LoopingCall() to check for changes in these lines once a second. This works, but isn't very "Twisted"

Thanks,

Dave Lawrence
  • 1,281
  • 12
  • 17
  • I don't have personal experience with serial stuff but you should be able to overload the `connectionMade`, `dataReceived`, `connectionLost` methods to hook into events. [Take a look at the interface for protocols](https://twistedmatrix.com/documents/current/api/twisted.internet.interfaces.IProtocol.html). Can you share a small example that demonstrates the basics of what your app currently does? – notorious.no Jun 08 '20 at 16:22
  • Hi, the standard methods (which you mention) only give methods for connecting and data reception. the control lines DCD, CTS, DSR and RI are not covered. I am currently just reading these with e.g. `getDCD()` by polling them. – Dave Lawrence Jun 08 '20 at 21:29

0 Answers0