cli: fix open by serial bug

parent fbccef41
......@@ -33,11 +33,11 @@ class OauTest(cmd.Cmd):
def do_open(self, arg):
"""open device by serial number"""
try:
serial = arg if arg else c_void_p(0)
serial = arg if arg else 0
except ValueError as e:
print('usage: open [serial]')
return
fd = self.api.oau_att_open(serial)
fd = self.api.oau_att_open(bytes(serial, 'utf8'))
if fd < 0:
print('cannot open device {}'.format(serial))
return
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment