Re-sorted service list to ensure correct processing order

This commit is contained in:
Tempest 2025-08-04 17:48:14 +07:00
parent 54a02ad149
commit 2aaffd8ba1

View File

@ -75,7 +75,7 @@ async def connect_to_ble_device(device_name):
else: else:
print(f"Failed to connect to {target_device.name}") print(f"Failed to connect to {target_device.name}")
exit(1) exit(1)
services = client.services services = sorted(client.services, key=lambda serv: serv.handle)
print("\n--- Services and Characteristics ---") print("\n--- Services and Characteristics ---")
for service in services: for service in services:
print(f"\nService: {service.uuid} (Handle: {service.handle}) - {service.description}") print(f"\nService: {service.uuid} (Handle: {service.handle}) - {service.description}")