mirror of
https://codeberg.org/Freeyourgadget/Gadgetbridge.git
synced 2025-01-26 16:41:43 +01:00
Xiaomi Protobuf: Fix logging of found service
getSupportedServices is actually set by us, so it will include all known services, not the ones that the device supports.
This commit is contained in:
parent
16b293fdb1
commit
9d3632d505
@ -77,37 +77,34 @@ public class XiaomiBleSupport extends XiaomiConnectionSupport {
|
|||||||
|
|
||||||
// Attempt to find a known xiaomi service
|
// Attempt to find a known xiaomi service
|
||||||
for (Map.Entry<UUID, XiaomiUuids.XiaomiBleUuidSet> xiaomiUuid : XiaomiUuids.BLE_UUIDS.entrySet()) {
|
for (Map.Entry<UUID, XiaomiUuids.XiaomiBleUuidSet> xiaomiUuid : XiaomiUuids.BLE_UUIDS.entrySet()) {
|
||||||
if (getSupportedServices().contains(xiaomiUuid.getKey())) {
|
final XiaomiUuids.XiaomiBleUuidSet currentUuidSet = xiaomiUuid.getValue();
|
||||||
LOG.debug("Found Xiaomi service: {}", xiaomiUuid.getKey());
|
UUID currentChar;
|
||||||
uuidSet = xiaomiUuid.getValue();
|
|
||||||
UUID currentChar;
|
|
||||||
|
|
||||||
if ((currentChar = uuidSet.getCharacteristicCommandRead()) == null ||
|
if ((currentChar = currentUuidSet.getCharacteristicCommandRead()) == null ||
|
||||||
(btCharacteristicCommandRead = getCharacteristic(currentChar)) == null) {
|
(btCharacteristicCommandRead = getCharacteristic(currentChar)) == null) {
|
||||||
LOG.warn("btCharacteristicCommandRead characteristicc is null");
|
continue;
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((currentChar = uuidSet.getCharacteristicCommandWrite()) == null ||
|
|
||||||
(btCharacteristicCommandWrite = getCharacteristic(currentChar)) == null) {
|
|
||||||
LOG.warn("btCharacteristicCommandWrite characteristicc is null");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((currentChar = uuidSet.getCharacteristicActivityData()) == null ||
|
|
||||||
(btCharacteristicActivityData= getCharacteristic(currentChar)) == null) {
|
|
||||||
LOG.warn("btCharacteristicActivityData characteristicc is null");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((currentChar = uuidSet.getCharacteristicDataUpload()) == null ||
|
|
||||||
(btCharacteristicDataUpload= getCharacteristic(currentChar)) == null) {
|
|
||||||
LOG.warn("btCharacteristicDataUpload characteristicc is null");
|
|
||||||
// this characteristic may not be supported by all models
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((currentChar = currentUuidSet.getCharacteristicCommandWrite()) == null ||
|
||||||
|
(btCharacteristicCommandWrite = getCharacteristic(currentChar)) == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((currentChar = currentUuidSet.getCharacteristicActivityData()) == null ||
|
||||||
|
(btCharacteristicActivityData = getCharacteristic(currentChar)) == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((currentChar = currentUuidSet.getCharacteristicDataUpload()) == null ||
|
||||||
|
(btCharacteristicDataUpload= getCharacteristic(currentChar)) == null) {
|
||||||
|
LOG.warn("btCharacteristicDataUpload characteristic is null");
|
||||||
|
// this characteristic may not be supported by all models
|
||||||
|
}
|
||||||
|
|
||||||
|
LOG.debug("Found Xiaomi service: {}", xiaomiUuid.getKey());
|
||||||
|
uuidSet = xiaomiUuid.getValue();
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (uuidSet == null) {
|
if (uuidSet == null) {
|
||||||
|
Loading…
Reference in New Issue
Block a user