From 4999731fd9b70b2a595d7cd800658f65fb16378c Mon Sep 17 00:00:00 2001 From: shi ce Date: Wed, 2 Jun 2021 11:36:31 +0800 Subject: add functionality to can service Bug-AGL: SPEC-3946 Signed-off-by: shi ce Change-Id: I8a10a53ea826973a982f35443134d623af92643a --- pyagl/services/can.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyagl/services/can.py b/pyagl/services/can.py index 91bd01d..a63bbb7 100644 --- a/pyagl/services/can.py +++ b/pyagl/services/can.py @@ -27,6 +27,7 @@ class CANService(AGLBaseService): parser.add_argument('--auth', help='Send an authentication request', action='store_true') parser.add_argument('--write', metavar='JSON', help='Write values to CAN') parser.add_argument('--list', help='List CAN signals', action='store_true') + parser.add_argument('--get',type=str, help='get event from CAN') def __init__(self, ip, port=None, service='service-can-low-level'): super().__init__(api='low-can', ip=ip, port=port, service=service) @@ -66,6 +67,11 @@ async def main(loop): data = await svc.afbresponse() print(data) + if args.get: + sessionid = await svc.get(args.get) + data = await svc.afbresponse() + print(data) + if args.list: msgid = await svc.list() data = await svc.afbresponse() -- cgit 1.2.3-korg