The model of a BLE value.
More...
#include <BLEValue.hpp>
|
void | addPart (std::string part) |
| Add a message part to the accumulation. The accumulation is a growing set of data that is added to until a commit or cancel. More...
|
|
void | addPart (uint8_t *pData, size_t length) |
| Add a message part to the accumulation. The accumulation is a growing set of data that is added to until a commit or cancel. More...
|
|
void | cancel () |
| Cancel the current accumulation.
|
|
void | commit () |
| Commit the current accumulation. When writing a value, we may find that we write it in "parts" meaning that the writes come in in pieces of the overall message. After the last part has been received, we may perform a commit which means that we now have the complete message and commit the change as a unit.
|
|
uint8_t * | getData () |
| Get a pointer to the data. More...
|
|
size_t | getLength () |
| Get the length of the data in bytes. More...
|
|
uint16_t | getReadOffset () |
| Get the read offset. More...
|
|
std::string | getValue () |
| Get the current value.
|
|
void | setReadOffset (uint16_t readOffset) |
| Set the read offset. More...
|
|
void | setValue (std::string value) |
| Set the current value.
|
|
void | setValue (uint8_t *pData, size_t length) |
| Set the current value. More...
|
|
The model of a BLE value.
◆ addPart() [1/2]
void BLEValue::addPart |
( |
std::string |
part | ) |
|
Add a message part to the accumulation. The accumulation is a growing set of data that is added to until a commit or cancel.
- Parameters
-
[in] | part | A message part being added. |
45 _debug_print_d(TAG,
">> addPart: length", part.length());
46 m_accumulation += part;
◆ addPart() [2/2]
void BLEValue::addPart |
( |
uint8_t * |
pData, |
|
|
size_t |
length |
|
) |
| |
Add a message part to the accumulation. The accumulation is a growing set of data that is added to until a commit or cancel.
- Parameters
-
[in] | pData | A message part being added. |
[in] | length | The number of bytes being added. |
57 _debug_print_u(TAG,
">> addPart: length", length);
58 m_accumulation += std::string((
char*) pData, length);
◆ getData()
uint8_t * BLEValue::getData |
( |
| ) |
|
Get a pointer to the data.
- Returns
- A pointer to the data.
93 return (uint8_t*) m_value.data();
◆ getLength()
size_t BLEValue::getLength |
( |
| ) |
|
Get the length of the data in bytes.
- Returns
- The length of the data in bytes.
102 return m_value.length();
◆ getReadOffset()
uint16_t BLEValue::getReadOffset |
( |
| ) |
|
Get the read offset.
- Returns
- The read offset into the read.
◆ setReadOffset()
void BLEValue::setReadOffset |
( |
uint16_t |
readOffset | ) |
|
Set the read offset.
- Parameters
-
[in] | readOffset | The offset into the read. |
128 m_readOffset = readOffset;
◆ setValue()
void BLEValue::setValue |
( |
uint8_t * |
pData, |
|
|
size_t |
length |
|
) |
| |
Set the current value.
- Parameters
-
[in] | pData | The data for the current value. |
[in] | The | length of the new current value. |
146 m_value = std::string((
char*) pData, length);
The documentation for this class was generated from the following files:
- nola-sdk/include/BLEValue.hpp
- src/net/BluetoothLE/BLEValue.cpp