I am developing an app that should listen to different button-events. For example: When I press the button shortly, I want to send a SMS - but when I press the button 2-10 seconds, I want to make a call.
For that case, I want to write two different values to the characteristic Detection Configuration (UUID: 0xFFFFFFF2-00F7-4000-B000- 000000000000) (values: 0x01 and 0x02).
So I tried to call this method
BluetoothService.this.enableForDetect(gatt, service.getCharacteristic(Constants.CHAR_DETECTION_CONFIG), Constants.ENABLE_KEY_SHORT_PRESS);
with the two values, but it doesn't work. It seems like the second value overwrites the first (so the App only reacts to the long press).
Do I have to create one characteristic with two value or do I have to create two similar characteristics with two different values in the same service. And how do I do it?
It would be great to get some help.
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.