Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
シリアルポート (gpsfix とマウス) を使用するための python ツイストの例と、stackoveflow で提供されているその他のソリューションを見てきました。ただし、一般的なシリアル ポート プロトコルを記述する方法はまだ明確ではありません。PythonツイストSerialPortプログラムの簡単な(しかし完全な)例を誰でも提供できますか?
/dev/ttySx をシリアル ポートとして使用する必要があり、書き込みを読み書きする必要があります。
SerialPort対話するシリアルポートを指定する引数を受け入れます。これは 2 番目の引数で、プロトコル引数の直後に続きます。
SerialPort
例えば、
from twisted.internet.serialport import SerialPort port = SerialPort(yourProtocol, "/dev/tty2") # ...