•   almost 6 years ago

Android - Unable to Pass Verification

I am able to send the verification key provided in the Quick Start guide to the device via writing to the verification characteristic. However, the device rejects the key. The error message is "Invalid Value". The key I am trying to send is BCF5AC4840.

Thanks in advance!


  • Manager   •   almost 6 years ago

    Could you please posta 'snippet" of your code so we can help you out?

  •   •   almost 6 years ago

    Sure! Thanks for helping me out!

    Finding Characteristic Snippet:
    // Loops through available GATT Services.
    for (BluetoothGattService gattService : gattServices) {
    uuid = gattService.getUuid().toString();

    //VSN_SERVICE = "fffffff0-00f7-4000-b000-000000000000"
    if (uuid.equalsIgnoreCase(SampleGattAttributes.VSN_SERVICE))
    vbttnServiceFound = true;

    List gattCharacteristics =

    // Loops through available Characteristics.
    for (BluetoothGattCharacteristic gattCharacteristic : gattCharacteristics) {
    uuid = gattCharacteristic.getUuid().toString();

    if (vbttnServiceFound)
    Log.i(TAG, "VSN Service found!");
    if (uuid.equalsIgnoreCase(SampleGattAttributes.VSN_CHARACTERISTIC_VERIFICATION))
    Log.i(TAG, "VSN Verification Characteristic found!");

    //VSN Key = "BCF5AC4840"


    Writing Characteristic Snippet:

    public void writeCharacteristic(BluetoothGattCharacteristic characteristic) {
    if (mBluetoothAdapter == null || mBluetoothGatt == null) {
    Log.w(TAG, "BluetoothAdapter not initialized");

    //This is an object of the android.bluetooth.BluetoothGatt Java class

  • Manager   •   almost 6 years ago

    Hi shaq1nj,
    I believe the issue is the way your verification string is defined.
    Try defining the string as a byte array. The snippet below works.

    byte[] value={ (byte)0xBC, (byte)0xF5, (byte)0xAC, (byte)0x48, (byte)0x40};

  •   •   almost 6 years ago

    That worked! Thanks for your help!

  • Manager   •   almost 6 years ago

    Glad to help!

Comments are closed.