Code: Select all
# Serially wait for connections. Don't advertise while a central is connected.
async def _pListen(self):
while True:
print("\nBLE advertising")
async with await aioble.advertise(
BLE_ADV_INTERVAL_MS,
name=self.name,
services=[s.uuid for s in self.service],
appearance=self.appearance,
) as self.connection:
print("\n", self.connection.device, "connected")
await self.connection.disconnected(timeout_ms=None)
print("\n", self.connection.device, "disconnected")
Code: Select all
lld_pdu_get_tx_flush_nb HCI packet count mismatch (0, 1)
I would like to leave the default 60 seconds there, but being able to reset the timeout on each rx/tx (keep-alive). Does it make sense or I got it completely wrong?
More in general, what's the reccomended behaviour for BLE? Do I need to connect before every data transmission (and disconnect right after) or I can have a single long lasting session transmitting data from time to time, or ... ?