mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge
synced 2024-12-25 18:15:49 +01:00
some more service discovery logging
This commit is contained in:
parent
c3d7b4a7cf
commit
1997a9b7fa
@ -148,12 +148,14 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
|
|||||||
|
|
||||||
private void gattServicesDiscovered(List<BluetoothGattService> discoveredGattServices) {
|
private void gattServicesDiscovered(List<BluetoothGattService> discoveredGattServices) {
|
||||||
if (discoveredGattServices == null) {
|
if (discoveredGattServices == null) {
|
||||||
|
LOG.warn("No gatt services discovered: null!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Set<UUID> supportedServices = getSupportedServices();
|
Set<UUID> supportedServices = getSupportedServices();
|
||||||
mAvailableCharacteristics = new HashMap<>();
|
mAvailableCharacteristics = new HashMap<>();
|
||||||
for (BluetoothGattService service : discoveredGattServices) {
|
for (BluetoothGattService service : discoveredGattServices) {
|
||||||
if (supportedServices.contains(service.getUuid())) {
|
if (supportedServices.contains(service.getUuid())) {
|
||||||
|
LOG.debug("discovered supported service: " + service.getUuid());
|
||||||
List<BluetoothGattCharacteristic> characteristics = service.getCharacteristics();
|
List<BluetoothGattCharacteristic> characteristics = service.getCharacteristics();
|
||||||
if (characteristics == null || characteristics.isEmpty()) {
|
if (characteristics == null || characteristics.isEmpty()) {
|
||||||
LOG.warn("Supported LE service " + service.getUuid() + "did not return any characteristics");
|
LOG.warn("Supported LE service " + service.getUuid() + "did not return any characteristics");
|
||||||
@ -164,6 +166,8 @@ public abstract class AbstractBTLEDeviceSupport extends AbstractDeviceSupport im
|
|||||||
intmAvailableCharacteristics.put(characteristic.getUuid(), characteristic);
|
intmAvailableCharacteristics.put(characteristic.getUuid(), characteristic);
|
||||||
}
|
}
|
||||||
mAvailableCharacteristics.putAll(intmAvailableCharacteristics);
|
mAvailableCharacteristics.putAll(intmAvailableCharacteristics);
|
||||||
|
} else {
|
||||||
|
LOG.debug("discovered unsupported service: " + service.getUuid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user