Xiaomi: add potential service and characteristic UUIDs

This commit is contained in:
MrYoranimo 2024-01-05 17:42:54 +01:00 committed by José Rebelo
parent 339859c829
commit ae97e961b9
3 changed files with 43 additions and 11 deletions

View File

@ -99,10 +99,15 @@ public class BleNamesResolver {
mServices.put("00001814-0000-1000-8000-00805f9b34fb", "Running Speed and Cadence");
mServices.put("00001813-0000-1000-8000-00805f9b34fb", "Scan Parameters");
mServices.put("00001804-0000-1000-8000-00805f9b34fb", "Tx Power");
mServices.put("0000fdab-0000-1000-8000-00805f9b34fb", "(Propr: Xiaomi Proximity Unlock Service)");
mServices.put("0000fe95-0000-1000-8000-00805f9b34fb", "(Propr: Xiaomi Wear Service)");
mServices.put("0000fee0-0000-3512-2118-0009af100700", "(Propr: Xiaomi MiLi Service)");
mServices.put("00001530-0000-3512-2118-0009af100700", "(Propr: Xiaomi Weight Service)");
mServices.put("14701820-620a-3973-7c78-9cfff0876abd", "(Propr: HPLUS Service)");
mServices.put("16186f00-0000-1000-8000-00807f9b34fb", "(Propr: Xiaomi Wear Service - Mi Watch Lite/Redmi Watch)");
mServices.put("16187f00-0000-1000-8000-00807f9b34fb", "(Propr: Xiaomi Wear Service - Mi Smart Watch 4C/Redmi Band)");
mServices.put("1314f000-1000-9000-7000-301291e21220", "(Propr: Xiaomi Wear Service - Mi Watch/Mi Watch Color/Mi Watch Color Sport)");
mServices.put("7495fe00-a7f3-424b-92dd-4a006a3aef56", "(Propr: Xiaomi Wear Service - Mi Watch CN)");
mCharacteristics.put("00002a43-0000-1000-8000-00805f9b34fb", "Alert AlertCategory ID");
mCharacteristics.put("00002a42-0000-1000-8000-00805f9b34fb", "Alert AlertCategory ID Bit Mask");

View File

@ -75,23 +75,30 @@ public class XiaomiBleSupport extends XiaomiConnectionSupport {
if (getSupportedServices().contains(xiaomiUuid.getKey())) {
LOG.debug("Found Xiaomi service: {}", xiaomiUuid.getKey());
uuidSet = xiaomiUuid.getValue();
UUID currentChar;
btCharacteristicCommandRead = getCharacteristic(uuidSet.getCharacteristicCommandRead());
btCharacteristicCommandWrite = getCharacteristic(uuidSet.getCharacteristicCommandWrite());
btCharacteristicActivityData = getCharacteristic(uuidSet.getCharacteristicActivityData());
btCharacteristicDataUpload = getCharacteristic(uuidSet.getCharacteristicDataUpload());
if (btCharacteristicCommandRead == null) {
if ((currentChar = uuidSet.getCharacteristicCommandRead()) == null ||
(btCharacteristicCommandRead = getCharacteristic(currentChar)) == null) {
LOG.warn("btCharacteristicCommandRead characteristicc is null");
continue;
} else if (btCharacteristicCommandWrite == null) {
}
if ((currentChar = uuidSet.getCharacteristicCommandWrite()) == null ||
(btCharacteristicCommandWrite = getCharacteristic(currentChar)) == null) {
LOG.warn("btCharacteristicCommandWrite characteristicc is null");
continue;
} else if (btCharacteristicActivityData == null) {
}
if ((currentChar = uuidSet.getCharacteristicActivityData()) == null ||
(btCharacteristicActivityData= getCharacteristic(currentChar)) == null) {
LOG.warn("btCharacteristicActivityData characteristicc is null");
continue;
} else if (btCharacteristicDataUpload == null) {
}
if ((currentChar = uuidSet.getCharacteristicDataUpload()) == null ||
(btCharacteristicDataUpload= getCharacteristic(currentChar)) == null) {
LOG.warn("btCharacteristicDataUpload characteristicc is null");
continue;
// this characteristic may not be supported by all models
}
break;

View File

@ -40,6 +40,7 @@ public class XiaomiUuids {
));
// Mi Watch Lite
// Redmi Watch
put(UUID.fromString("16186f00-0000-1000-8000-00807f9b34fb"), new XiaomiBleUuidSet(
false,
UUID.fromString("16186f01-0000-1000-8000-00807f9b34fb"),
@ -48,7 +49,17 @@ public class XiaomiUuids {
UUID.fromString("16186f04-0000-1000-8000-00807f9b34fb")
));
// Mi Watch Color Sport
// Mi Smart Watch 4C
// Redmi Band
put(UUID.fromString("16187f00-0000-1000-8000-00807f9b34fb"), new XiaomiBleUuidSet(
false, // FIXME check
UUID.fromString("16187f02-0000-1000-8000-00807f9b34fb"),
UUID.fromString("16187f01-0000-1000-8000-00807f9b34fb"),
UUID.fromString("16187f03-0000-1000-8000-00807f9b34fb"),
UUID.fromString("16187f04-0000-1000-8000-00807f9b34fb")
));
// Mi Watch (Color (Sport))
put(UUID.fromString("1314f000-1000-9000-7000-301291e21220"), new XiaomiBleUuidSet(
false,
UUID.fromString("1314f005-1000-9000-7000-301291e21220"),
@ -56,6 +67,15 @@ public class XiaomiUuids {
UUID.fromString("1314f002-1000-9000-7000-301291e21220"),
UUID.fromString("1314f007-1000-9000-7000-301291e21220")
));
// Mi Watch CN
put(UUID.fromString("7495fe00-a7f3-424b-92dd-4a006a3aef56"), new XiaomiBleUuidSet(
false, // FIXME check
UUID.fromString("74950002-a7f3-424b-92dd-4a006a3aef56"),
UUID.fromString("74950001-a7f3-424b-92dd-4a006a3aef56"),
UUID.fromString("74950003-a7f3-424b-92dd-4a006a3aef56"),
null
));
}};
public static class XiaomiBleUuidSet {