ArduinoBLE - bleCharacteristic.valueLength()

Query the current value size of the specified BLECharacteristic.

Syntax

bleCharacteristic.valueLength()

Parameters

None

Returns

  • The current value size of the characteristic (in bytes)

Example


// Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central
BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite);



Serial.print(value length = );
Serial.println(switchCharacteristic.valueLength());