Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- BluetoothGattCharacteristic charGM =
- mConnGatt.getService(UUID.fromString(BleUuid.SERVICE_GLUCOSE))
- .getCharacteristic(UUID.fromString(BleUuid.CHAR_GLUCOSE_MEASUREMENT_STRING));
- mConnGatt.setCharacteristicNotification(charGM, enabled);
- BluetoothGattDescriptor descGM = charGM.getDescriptor(UUID.fromString(BleUuid.CHAR_CLIENT_CHARACTERISTIC_CONFIG_STRING));
- descGM.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
- mConnGatt.writeDescriptor(descGM);
- BluetoothGattCharacteristic charGMC =
- mConnGatt.getService(UUID.fromString(BleUuid.SERVICE_GLUCOSE))
- .getCharacteristic(UUID.fromString(BleUuid.CHAR_GLUCOSE_MEASUREMENT_CONTEXT_STRING));
- mConnGatt.setCharacteristicNotification(charGMC, enabled);
- BluetoothGattDescriptor descGMC = charGMC.getDescriptor(UUID.fromString(BleUuid.CHAR_CLIENT_CHARACTERISTIC_CONFIG_STRING));
- descGMC.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
- mConnGatt.writeDescriptor(descGMC);
- BluetoothGattCharacteristic charRACP =
- mConnGatt.getService(UUID.fromString(BleUuid.SERVICE_GLUCOSE))
- .getCharacteristic(UUID.fromString(BleUuid.CHAR_RECORD_ACCESS_CONTROL_POINT_STRING));
- mConnGatt.setCharacteristicNotification(charRACP, enabled);
- BluetoothGattDescriptor descRACP = charRACP.getDescriptor(UUID.fromString(BleUuid.CHAR_CLIENT_CHARACTERISTIC_CONFIG_STRING));
- descRACP.setValue(BluetoothGattDescriptor.ENABLE_INDICATION_VALUE);
- mConnGatt.writeDescriptor(descRACP);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement