ArduinoBLE - bleCharacteristic.canRead()

Query if a Bluetooth® Low Energy characteristic is readable.

Syntax

bleCharacteristic.canRead()

Parameters

None

Returns

  • true, if characteristic is readable,
  • false otherwise

Example


  if (characteristic.canRead("2901")) {
    Serial.println("characteristic is readable");
  }


read

Perform a read request for the characteristic.

Syntax

bleCharacteristic.read()

Parameters

None

Returns

  • true, if successful,
  • false on failure

Example


  if (characteristic.read()) {
    Serial.println("characteristic value read");

    // ...
  } else {
    Serial.println("error reading characteristic value");
  }