device.py: Add discover_all() api

This commit is contained in:
Alan Rosenthal
2024-07-10 13:24:08 -04:00
parent 0f19dd5263
commit df206667b6
3 changed files with 63 additions and 15 deletions

View File

@@ -1133,6 +1133,15 @@ class Peer:
async def discover_attributes(self) -> List[gatt_client.AttributeProxy]:
return await self.gatt_client.discover_attributes()
async def discover_all(self):
await self.discover_services()
for service in self.services:
await self.discover_characteristics(service=service)
for service in self.services:
for characteristic in service.characteristics:
await self.discover_descriptors(characteristic=characteristic)
async def subscribe(
self,
characteristic: gatt_client.CharacteristicProxy,