initial support for telemetry to see if things come in

This commit is contained in:
Florent 2025-05-03 17:52:16 +02:00
parent 6a3da79af2
commit aef1801446
5 changed files with 25 additions and 2 deletions

View file

@ -306,6 +306,13 @@ class CommandHandler:
data = b"\x03\x00" + chan.to_bytes(1, 'little') + timestamp + msg.encode("utf-8")
return await self.send(data, [EventType.OK, EventType.ERROR])
async def send_telemetry_req(self, dst: DestinationType) -> Event :
dst_bytes = _validate_destination(dst, prefix_length=32)
logger.debug(f"Asking telemetry to {dst_bytes.hex()}")
data = b"\x27\x00\x00\x00" + dst_bytes
return await self.send(data, [EventType.MSG_SENT, EventType.ERROR])
async def send_cli(self, cmd) -> Event:
logger.debug(f"Sending CLI command: {cmd}")
data = b"\x32" + cmd.encode('utf-8')