Reference   Language | Libraries | Comparison | Changes

ArduinoBLE : BLECharacteristic class

addDescriptor()

Description

Add a BLEDescriptor to the characteristic.

Syntax

bleCharacteristic.addDescriptor(bleDescriptor)

Parameters

bleDescriptor: descriptor to add to the characteristic

Returns

Nothing

Example


// BLE Battery Level Characteristic
BLEUnsignedCharCharacteristic batteryLevelChar("2A19",  // standard 16-bit characteristic UUID
    BLERead | BLENotify); // remote clients will be able to get notifications if this characteristic changes

BLEDescriptor batteryLevelDescriptor("2901", "millis");



// …

  batteryLevelChar.addDescriptor(batteryLevelDescriptor);

See Also




Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.