Commit b507eb8d authored by Gallacchi Mattia's avatar Gallacchi Mattia
Browse files

Merge branch '6-fix-trailing-semicolon-error' into 'main'

Fix trailing semicolon exception

Closes #6

See merge request igib/public/rsvp/rsvp-python!6
parents 4a2589f2 83214fea
Loading
Loading
Loading
Loading
+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),
@@ -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
+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)
@@ -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
+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 *


@@ -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
+1 −1
Original line number Diff line number Diff line
@@ -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__":
+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