Reference   Language | Libraries | Comparison | Changes

ArduinoBLE : BLEDescriptor class

valueLength

Description

Query the length, in bytes, of the descriptor current value.

Syntax

bleDescriptor.valueLength()

Parameters

None

Returns

Length of descriptor value in bytes.

Example


  // read the descriptor value
  descriptor.read();

  // print out the value of the descriptor
  Serial.print(", value 0x");
  printData(descriptor.value(), descriptor.valueLength());

  // ...

  void printData(const unsigned char data[], int length) {
    for (int i = 0; i < length; i++) {
      unsigned char b = data[i];

      if (b < 16) {
        Serial.print("0");
      }

      Serial.print(b, HEX);
    }
  }

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.