Button event triggers and timing

Kommentare

3 Kommentare

  • Offizieller Kommentar
    Avatar
    VSN Mobil Support

    You have to write one value to the characteristic.  The value/field is a bit mask field.  Thus you have to enable the bit for the setting that you want.  In your case, since you want short (0x01) and long (0x02) press detection, you should write 0x03 to characteristic 0xFFFFFFF2-00F7-4000-B000- 000000000000

    Aktionen für Kommentare Permalink
  • Avatar
    John Developer

    I want to differentiate the button events in the onCharacteristicChanged-method. But this part

    while(var6.hasNext()) { 
    BluetoothGattService service = (BluetoothGattService)var6.next(); 
    if(service != null && service.getUuid() != null && Constants.SERVICE_VSN_SIMPLE_SERVICE.equals(service.getUuid())) { 
    BluetoothService.this.mCharVerification = service.getCharacteristic(Constants.CHAR_APP_VERIFICATION); 
    BluetoothService.this.enableForDetect(gatt, service.getCharacteristic(Constants.CHAR_DETECTION_CONFIG), Constants.ENABLE_KEY_DETECTION); 
    BluetoothService.this.setCharacteristicNotification(gatt, service.getCharacteristic(Constants.CHAR_DETECTION_NOTIFY), true); 
    }

    seems to call the method as well and with the same value (3) as the long press. 
    Can you tell me why the onCharacteristicChanged method is called with the value 3 in the part above and how I can differentiate this one from the long-press-characteristic changed (which has the value 3, too).

    Thanks for your help. 

    0
    Aktionen für Kommentare Permalink
  • Avatar
    VSN Mobil Support

    Is the constant  Constants.ENABLE_KEY_DETECTION  set to byte array with value 0x03?

    For the onCharacteristicChanged callback, how did you verify that the value is always 3?  Did you check to see which characteristic caused the function to be called?

    0
    Aktionen für Kommentare Permalink

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.

Powered by Zendesk