Added function to retrieve the amount of data received from an BLECharacteristic (#5339)

This commit is contained in:
xBiohazardx 2021-07-17 01:03:44 +02:00 committed by GitHub
parent 16f4b0f5ba
commit 0aafa05e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -187,6 +187,13 @@ uint8_t* BLECharacteristic::getData() {
return m_value.getData(); return m_value.getData();
} // getData } // getData
/**
* @brief Retrieve the current length of the data of the characteristic.
* @return Amount of databytes of the characteristic.
*/
uint8_t BLECharacteristic::getLength() {
return m_value.getLength();
} // getLength
/** /**
* Handle a GATT server event. * Handle a GATT server event.

View File

@ -62,6 +62,7 @@ public:
BLEUUID getUUID(); BLEUUID getUUID();
std::string getValue(); std::string getValue();
uint8_t* getData(); uint8_t* getData();
uint8_t getLength();
void indicate(); void indicate();
void notify(bool is_notification = true); void notify(bool is_notification = true);