Skip to content

Commit 0aafa05

Browse files
authored
Added function to retrieve the amount of data received from an BLECharacteristic (#5339)
1 parent 16f4b0f commit 0aafa05

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

libraries/BLE/src/BLECharacteristic.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,13 @@ uint8_t* BLECharacteristic::getData() {
187187
return m_value.getData();
188188
} // getData
189189

190+
/**
191+
* @brief Retrieve the current length of the data of the characteristic.
192+
* @return Amount of databytes of the characteristic.
193+
*/
194+
uint8_t BLECharacteristic::getLength() {
195+
return m_value.getLength();
196+
} // getLength
190197

191198
/**
192199
* Handle a GATT server event.

libraries/BLE/src/BLECharacteristic.h

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ class BLECharacteristic {
6262
BLEUUID getUUID();
6363
std::string getValue();
6464
uint8_t* getData();
65+
uint8_t getLength();
6566

6667
void indicate();
6768
void notify(bool is_notification = true);

0 commit comments

Comments
 (0)