aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshi ce <shic.fnst@fujitsu.com>2021-06-02 11:36:31 +0800
committerShi Ce <shic.fnst@fujitsu.com>2021-06-02 10:04:52 +0000
commit4999731fd9b70b2a595d7cd800658f65fb16378c (patch)
tree04af4f64c5a9b7934089d59b8fadcda24a43a03a
parent1eecf421a71d9cb6a264860d38c4e6a5b4131a78 (diff)
add functionality to can service
Bug-AGL: SPEC-3946 Signed-off-by: shi ce <shic.fnst@fujitsu.com> Change-Id: I8a10a53ea826973a982f35443134d623af92643a
-rw-r--r--pyagl/services/can.py6
1 files changed, 6 insertions, 0 deletions
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()