From 775f844135df2b64dffc24a9a78517cffa34ec06 Mon Sep 17 00:00:00 2001 From: Anton Schieber Date: Fri, 5 Dec 2025 15:39:11 +1000 Subject: [PATCH] tools: bt_log: inform when connection established Add logging for when a connection is successfully established, since log messages may arrive intermittently and it can otherwise be unclear whether the connection was actually made. --- src/infuse_iot/tools/bt_log.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/infuse_iot/tools/bt_log.py b/src/infuse_iot/tools/bt_log.py index 7e63b47..ace88cc 100644 --- a/src/infuse_iot/tools/bt_log.py +++ b/src/infuse_iot/tools/bt_log.py @@ -17,6 +17,7 @@ default_multicast_address, ) from infuse_iot.tdf import TDF +from infuse_iot.util.console import Console class SubCommand(InfuseCommand): @@ -45,12 +46,13 @@ def run(self): if self._data: types |= GatewayRequestConnectionRequest.DataType.DATA with self._client.connection(self._id, types, self._conn_timeout) as _: + Console.log_info(f"Connected to {self._id:016x} ({types.name})") while True: evt = self._client.receive() if evt is None: continue if isinstance(evt, ClientNotificationConnectionDropped): - print(f"Connection to {self._id:016x} lost") + Console.log_error(f"Connection to {self._id:016x} lost") break if not isinstance(evt, ClientNotificationEpacketReceived): continue