Skip to content

Commit 742c498

Browse files
committed
change override_timeout to timeout
1 parent 837ff3a commit 742c498

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/meshcore/binary_commands.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -69,47 +69,47 @@ def __init__ (self, c):
6969
def dispatcher(self):
7070
return self.commands.dispatcher
7171

72-
async def req_binary (self, contact, request, timeout_override=0) :
72+
async def req_binary (self, contact, request, timeout=0) :
7373
res = await self.commands.send_binary_req(contact, request)
7474
logger.debug(res)
7575
if res.type == EventType.ERROR:
7676
logger.error(f"Error while requesting binary data")
7777
return None
7878
else:
7979
exp_tag = res.payload["expected_ack"].hex()
80-
timeout = res.payload["suggested_timeout"]/800 if timeout_override == 0 else timeout_override
80+
timeout = res.payload["suggested_timeout"]/800 if timeout == 0 else timeout
8181
res2 = await self.dispatcher.wait_for_event(EventType.BINARY_RESPONSE, attribute_filters={"tag": exp_tag}, timeout=timeout)
8282
logger.debug(res2)
8383
if res2 is None :
8484
return None
8585
else:
8686
return res2.payload
8787

88-
async def req_telemetry (self, contact, timeout_override=0) :
88+
async def req_telemetry (self, contact, timeout=0) :
8989
code = BinaryReqType.TELEMETRY.value
9090
req = code.to_bytes(1, 'little', signed=False)
91-
res = await self.req_binary(contact, req, timeout_override)
91+
res = await self.req_binary(contact, req, timeout)
9292
if (res is None) :
9393
return None
9494
else:
9595
return lpp_parse(bytes.fromhex(res["data"]))
9696

97-
async def req_mma (self, contact, start, end, timeout_override=0) :
97+
async def req_mma (self, contact, start, end, timeout=0) :
9898
code = BinaryReqType.MMA.value
9999
req = code.to_bytes(1, 'little', signed=False)\
100100
+ start.to_bytes(4, 'little', signed = False)\
101101
+ end.to_bytes(4, 'little', signed=False)\
102102
+ b"\0\0"
103-
res = await self.req_binary(contact, req, timeout_override)
103+
res = await self.req_binary(contact, req, timeout)
104104
if (res is None) :
105105
return None
106106
else:
107107
return lpp_parse_mma(bytes.fromhex(res["data"])[4:])
108108

109-
async def req_acl (self, contact, timeout_override=0) :
109+
async def req_acl (self, contact, timeout=0) :
110110
code = BinaryReqType.ACL.value
111111
req = code.to_bytes(1, 'little', signed=False) + b"\0\0"
112-
res = await self.req_binary(contact, req, timeout_override)
112+
res = await self.req_binary(contact, req, timeout)
113113
if (res is None) :
114114
return None
115115
else:

0 commit comments

Comments
 (0)