Я пытаюсь подключиться к педальному велосипеду Echelon в среде Android Java.
Я успешно выполнил реверс-инжиниринг сервисов и пакетов, но у меня возникли проблемы с развертыванием в приложении.
Нужно включить уведомления для 1 сервиса и написать на велосипед команду "начать тренировку". С чего мне начать поиск, чтобы отладить это?
//Start Workout
//Success if done first, but not notifications
BluetoothGattCharacteristic writeCharacteristic = service.getCharacteristic(writeUUID);
byte[] message = {(byte) 0xF0, (byte) 0xB0, (byte) 0x01, (byte) 0x01, (byte) 0xA2};
writeCharacteristic.setValue(message);
boolean success = gatt.writeCharacteristic(writeCharacteristic);
if (success) {
Log.i(TAG, "Message written successfully to characteristic with UUID: " + writeUUID.toString());
} else {
Log.e(TAG, "Failed to write message to characteristic with UUID: " + writeUUID.toString());
}
//Enable Sensor Notifications
//Success if done first, but workout not started
BluetoothGattCharacteristic notifyCharacteristic = service.getCharacteristic(sensorUUID);
gatt.setCharacteristicNotification(notifyCharacteristic, true);
BluetoothGattDescriptor desc = notifyCharacteristic.getDescriptor(CONFIG_DESCRIPTOR);
desc.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE);
success = gatt.writeDescriptor(desc);
if (success) {
Log.i(TAG, "writeDescriptor written");
} else {
Log.e(TAG, "writeDescriptor Failed");
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... enable-not