ϪfddZddlmZmZmZddlmZmZddlm Z Gdde ejZ y)z Serial Port Protocol ) EIGHTBITS PARITY_NONE STOPBITS_ONE)abstractfdesc)BaseSerialPortcBeZdZdZdZdeeedddfdZdZ dZ dZ d Z y ) SerialPortz> A select()able serial device, acting as a transport. i%rc 2tjj|||j||||||| | |_||_|j |j||_|jj||jy)N)baudratebytesizeparitystopbitstimeoutxonxoffrtscts) rFileDescriptor__init___serialFactory_serialreactor flushInput flushOutputprotocolmakeConnection startReading) selfrdeviceNameOrPortNumberrr rrrrrrs C/usr/lib/python3/dist-packages/twisted/internet/_posixserialport.pyrzSerialPort.__init__s ((w7** "+         $$T* c.|jjS)N)rfdrs r filenozSerialPort.fileno8s||r!cJtj|j|S)z7 Write some data to the serial device. )r writeToFDr%)rdatas r writeSomeDatazSerialPort.writeSomeData;st{{}d33r!crtj|j|jjS)z: Some data's readable from serial device. )r readFromFDr%r dataReceivedr$s r doReadzSerialPort.doReadAs' t}}/I/IJJr!ctjj|||jj |j j|y)z Called when the serial port disconnects. Will call C{connectionLost} on the protocol that is handling the serial data. N)rrconnectionLostrcloser)rreasons r r/zSerialPort.connectionLostGs< ..tV<  $$V,r!N) __name__ __module__ __qualname____doc__ connectedrrrrr%r)r-r/r!r r r s?I>4 K -r!r N) r5serialrrrtwisted.internetrrtwisted.internet.serialportrrr r7r!r r;s, 87,6>-!8!8>-r!