msgproto: Support sending empty strings from create_message()
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
9c52ad4310
commit
838da992e8
|
@ -251,13 +251,15 @@ class MessageParser:
|
|||
out.append(MESSAGE_SYNC)
|
||||
return ''.join(out)
|
||||
def _parse_buffer(self, value):
|
||||
if not value:
|
||||
return []
|
||||
tval = int(value, 16)
|
||||
out = []
|
||||
for i in range(len(value) // 2):
|
||||
out.append(tval & 0xff)
|
||||
tval >>= 8
|
||||
out.reverse()
|
||||
return ''.join([chr(i) for i in out])
|
||||
return out
|
||||
def lookup_command(self, msgformat):
|
||||
parts = msgformat.strip().split()
|
||||
msgname = parts[0]
|
||||
|
|
Loading…
Reference in New Issue