Я разрабатываю приложение для Android, которое должно подписываться на несколько характеристик BLE.
Но что бы я ни делал, я получаю только обновленные значения одной характеристики.
Вот код:
BluetoothGattCharacteristic characteristicVel = gatt.getService(BleDefinedUUIDs.Service.KOMMMODUL_SERVICE).getCharacteristic(BleDefinedUUIDs.Characteristic.VELOCITY);
gatt.setCharacteristicNotification(characteristicVel, true);
BluetoothGattDescriptor descriptorVel = characteristicVel.getDescriptor(
BleDefinedUUIDs.Descriptor.CHAR_CLIENT_CONFIG);
descriptorVel.setValue(BleDefinedUUIDs.Descriptor.ENABLE_NOTIFICATION_VALUE);
gatt.writeDescriptor(descriptorVel);
BluetoothGattCharacteristic characteristicAcc = gatt.getService(BleDefinedUUIDs.Service.KOMMMODUL_SERVICE).getCharacteristic(BleDefinedUUIDs.Characteristic.ACCELERATION);
gatt.setCharacteristicNotification(characteristicAcc, true);
BluetoothGattDescriptor descriptorAcc = characteristicAcc.getDescriptor(
BleDefinedUUIDs.Descriptor.CHAR_CLIENT_CONFIG);
descriptorAcc.setValue(BleDefinedUUIDs.Descriptor.ENABLE_NOTIFICATION_VALUE);
gatt.writeDescriptor(descriptorAcc);
Что бы я ни делал, я получаю только данные о скорости. Если я изменю порядок двух блоков, я получаю только ускорение, но не больше данных о скорости.
Что мне нужно сделать, чтобы подписаться сразу на множество характеристик?
заранее спасибо
Reto