This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android BLE write to a characteristic

Hi,

I am new to ble stuff. I want to write a hex value (0403FEA27469) to a characteristic on the heartrate device. Following is what I have done so far.

Can anyone explain me how to do this?

// This is specific to Heart Rate Measurement. if (UUID_HEART_RATE_MEASUREMENT.equals(characteristic.getUuid())) { BluetoothGattDescriptor descriptor = characteristic.getDescriptor( UUID.fromString(SampleGattAttributes.CLIENT_CHARACTERISTIC_CONFIG)); descriptor.setValue(BluetoothGattDescriptor.ENABLE_NOTIFICATION_VALUE); mBluetoothGatt.writeDescriptor(descriptor);

    } else if (UUID_E001.equals(characteristic.getUuid())) {
        // *** THIS IS WHERE I WANT TO WRITE THE HEX VALUE
    }
Related