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

Lines changed: 7 additions & 0 deletions
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

Lines changed: 1 addition & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy