Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose length of data buffer #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/BLECharacteristic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,14 @@ uint8_t* BLECharacteristic::getData() {
return m_value.getData();
} // getData

/**
* @brief Retrieve the current length of the raw data of the characteristic.
* @return The length of the current characteristic data in bytes.
*/
uint8_t* BLECharacteristic::getLength() {
return m_value.getLength();
} // getLength


/**
* Handle a GATT server event.
Expand Down
1 change: 1 addition & 0 deletions src/BLECharacteristic.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class BLECharacteristic {
BLEUUID getUUID();
std::string getValue();
uint8_t* getData();
size_t getLength();

void indicate();
void notify(bool is_notification = true);
Expand Down