Loading examples/serialclient.py +5 −2 Original line number Diff line number Diff line from pyrsvp.rsvpclient import RsvpClientSerial from pyrsvp.rsvptypes import * # To emulate serial ports run the following command: # socat -d -d pty,raw,echo=0 pty,raw,echo=0 def test_cb(args : dict): print(args) if __name__ == "__main__": client = RsvpClientSerial("/dev/pts/6", baud=9600) client = RsvpClientSerial("/dev/pts/9", baud=9600) args = [ RsvpInteger("ARG1", 1), Loading @@ -18,6 +21,6 @@ if __name__ == "__main__": ] try: client.send_command("TEST", args, callback=test_cb) print(client.send_command("TEST", args)) except Exception as ex: print(f"[{type(ex).__name__}] Error: {ex}") No newline at end of file examples/serialserver.py +5 −2 Original line number Diff line number Diff line from pyrsvp.rsvpserver import RsvpServer, RsvpServerSerial from pyrsvp.rsvptypes import * # To emulate serial ports run the following command: # socat -d -d pty,raw,echo=0 pty,raw,echo=0 @RsvpServer.Command("TEST") def test(args : dict): print(args) Loading @@ -9,5 +12,5 @@ def test(args : dict): if __name__ == "__main__": srv = RsvpServerSerial("/dev/pts/5", baud=9600) srv.run() No newline at end of file srv = RsvpServerSerial("/dev/pts/8", baud=9600) srv.run(True) No newline at end of file examples/tcpclient.py +2 −2 Original line number Diff line number Diff line from pyrsvp.rsvpclient import RsvpClientTcp, RsvpClientNotAck from pyrsvp.rsvpclient import RsvpClientTcp from pyrsvp.rsvptypes import * Loading @@ -20,7 +20,7 @@ if __name__ == "__main__": ] try: print(client.send_command("START", args)) print(client.send_command("")) except Exception as ex: print(f"[{type(ex).__name__}] Error: {ex}") No newline at end of file examples/tcpserver.py +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ def start(values : dict) -> str: print(values) return RsvpServer.reply(True, [RsvpInteger("CODE", 1)]) return RsvpServer.reply(True) if __name__ == "__main__": Loading pyproject.toml +1 −1 Original line number Diff line number Diff line [tool.poetry] name = "pyrsvp" version = "0.2.3" version = "0.2.4" description = "Implements RSVP communication protocol in Python" authors = ["Mattia Gallacchi <mattia.gallacchi@he-arc.ch>"] readme = "README.md" Loading Loading
examples/serialclient.py +5 −2 Original line number Diff line number Diff line from pyrsvp.rsvpclient import RsvpClientSerial from pyrsvp.rsvptypes import * # To emulate serial ports run the following command: # socat -d -d pty,raw,echo=0 pty,raw,echo=0 def test_cb(args : dict): print(args) if __name__ == "__main__": client = RsvpClientSerial("/dev/pts/6", baud=9600) client = RsvpClientSerial("/dev/pts/9", baud=9600) args = [ RsvpInteger("ARG1", 1), Loading @@ -18,6 +21,6 @@ if __name__ == "__main__": ] try: client.send_command("TEST", args, callback=test_cb) print(client.send_command("TEST", args)) except Exception as ex: print(f"[{type(ex).__name__}] Error: {ex}") No newline at end of file
examples/serialserver.py +5 −2 Original line number Diff line number Diff line from pyrsvp.rsvpserver import RsvpServer, RsvpServerSerial from pyrsvp.rsvptypes import * # To emulate serial ports run the following command: # socat -d -d pty,raw,echo=0 pty,raw,echo=0 @RsvpServer.Command("TEST") def test(args : dict): print(args) Loading @@ -9,5 +12,5 @@ def test(args : dict): if __name__ == "__main__": srv = RsvpServerSerial("/dev/pts/5", baud=9600) srv.run() No newline at end of file srv = RsvpServerSerial("/dev/pts/8", baud=9600) srv.run(True) No newline at end of file
examples/tcpclient.py +2 −2 Original line number Diff line number Diff line from pyrsvp.rsvpclient import RsvpClientTcp, RsvpClientNotAck from pyrsvp.rsvpclient import RsvpClientTcp from pyrsvp.rsvptypes import * Loading @@ -20,7 +20,7 @@ if __name__ == "__main__": ] try: print(client.send_command("START", args)) print(client.send_command("")) except Exception as ex: print(f"[{type(ex).__name__}] Error: {ex}") No newline at end of file
examples/tcpserver.py +1 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ def start(values : dict) -> str: print(values) return RsvpServer.reply(True, [RsvpInteger("CODE", 1)]) return RsvpServer.reply(True) if __name__ == "__main__": Loading
pyproject.toml +1 −1 Original line number Diff line number Diff line [tool.poetry] name = "pyrsvp" version = "0.2.3" version = "0.2.4" description = "Implements RSVP communication protocol in Python" authors = ["Mattia Gallacchi <mattia.gallacchi@he-arc.ch>"] readme = "README.md" Loading