mirror of
https://github.com/oliexdev/openScale.git
synced 2025-08-22 00:06:48 +02:00
BluetoothSwpSBF77: Implement request to perform measurement (Beurer BF950 and SBF77);
This commit is contained in:
@@ -36,6 +36,7 @@ class BluetoothGattUuidSBF77 extends BluetoothGattUuid {
|
|||||||
public static final UUID CHARACTERISTIC_SBF77_USER_LIST = fromShortCode(0x0001);
|
public static final UUID CHARACTERISTIC_SBF77_USER_LIST = fromShortCode(0x0001);
|
||||||
public static final UUID CHARACTERISTIC_SBF77_INITIALS = fromShortCode(0x0002);
|
public static final UUID CHARACTERISTIC_SBF77_INITIALS = fromShortCode(0x0002);
|
||||||
public static final UUID CHARACTERISTIC_SBF77_ACTIVITY_LEVEL = fromShortCode(0x0004);
|
public static final UUID CHARACTERISTIC_SBF77_ACTIVITY_LEVEL = fromShortCode(0x0004);
|
||||||
|
public static final UUID CHARACTERISTIC_SBF77_TAKE_MEASUREMENT = fromShortCode(0x0006);
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BluetoothSwpSBF77 extends BluetoothStandardWeightProfile {
|
public class BluetoothSwpSBF77 extends BluetoothStandardWeightProfile {
|
||||||
@@ -70,6 +71,15 @@ public class BluetoothSwpSBF77 extends BluetoothStandardWeightProfile {
|
|||||||
BluetoothGattUuidSBF77.CHARACTERISTIC_SBF77_ACTIVITY_LEVEL, parser.getValue());
|
BluetoothGattUuidSBF77.CHARACTERISTIC_SBF77_ACTIVITY_LEVEL, parser.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void requestMeasurement() {
|
||||||
|
BluetoothBytesParser parser = new BluetoothBytesParser(new byte[]{0});
|
||||||
|
parser.setIntValue(0x00, FORMAT_UINT8, 0);
|
||||||
|
Timber.d(String.format("requestMeasurement 0x0006 magic: 0x00"));
|
||||||
|
writeBytes(BluetoothGattUuidSBF77.SERVICE_CUSTOM_SBF77,
|
||||||
|
BluetoothGattUuidSBF77.CHARACTERISTIC_SBF77_TAKE_MEASUREMENT, parser.getValue());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void setNotifyVendorSpecificUserList() {
|
protected void setNotifyVendorSpecificUserList() {
|
||||||
if (setNotificationOn(BluetoothGattUuidSBF77.SERVICE_CUSTOM_SBF77,
|
if (setNotificationOn(BluetoothGattUuidSBF77.SERVICE_CUSTOM_SBF77,
|
||||||
|
Reference in New Issue
Block a user