|
| NimBLEAttValue (uint16_t init_len=CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Default constructor. More...
|
|
| NimBLEAttValue (const uint8_t *value, uint16_t len, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Construct with an initial value from a buffer. More...
|
|
| NimBLEAttValue (std::initializer_list< uint8_t > list, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Construct with an initializer list. More...
|
|
| NimBLEAttValue (const char *value, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Construct with an initial value from a const char string. More...
|
|
| NimBLEAttValue (const std::string str, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Construct with an initial value from a std::string. More...
|
|
| NimBLEAttValue (const std::vector< uint8_t > vec, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Construct with an initial value from a std::vector<uint8_t>. More...
|
|
| NimBLEAttValue (const NimBLEAttValue &source) |
| Copy constructor.
|
|
| NimBLEAttValue (NimBLEAttValue &&source) |
| Move constructor.
|
|
| ~NimBLEAttValue () |
| Destructor.
|
|
uint16_t | max_size () const |
| Returns the max size in bytes.
|
|
uint16_t | capacity () const |
| Returns the currently allocated capacity in bytes.
|
|
uint16_t | length () const |
| Returns the current length of the value in bytes.
|
|
uint16_t | size () const |
| Returns the current size of the value in bytes.
|
|
const uint8_t * | data () const |
| Returns a pointer to the internal buffer of the value.
|
|
const char * | c_str () const |
| Returns a pointer to the internal buffer of the value as a const char*.
|
|
const uint8_t * | begin () const |
| Iterator begin.
|
|
const uint8_t * | end () const |
| Iterator end.
|
|
bool | setValue (const uint8_t *value, uint16_t len) |
| Set the value from a buffer. More...
|
|
bool | setValue (const char *s) |
| Set value to the value of const char*. More...
|
|
const uint8_t * | getValue (time_t *timestamp) |
| Get a pointer to the value buffer with timestamp. More...
|
|
NimBLEAttValue & | append (const uint8_t *value, uint16_t len) |
| Append data to the value. More...
|
|
template<typename T > |
bool | setValue (const T &s) |
| Template to set value to the value of <type>val. More...
|
|
template<typename T > |
bool | setValue (const T &s) |
| Template to set value to the value of <type>val. More...
|
|
template<typename T > |
T | getValue (time_t *timestamp=nullptr, bool skipSizeCheck=false) |
| Template to return the value as a <type>. More...
|
|
uint8_t | operator[] (int pos) const |
| Subscript operator.
|
|
| operator std::vector< uint8_t > () const |
| Operator; Get the value as a std::vector<uint8_t>.
|
|
| operator std::string () const |
| Operator; Get the value as a std::string.
|
|
| operator const uint8_t * () const |
| Operator; Get the value as a const uint8_t*.
|
|
NimBLEAttValue & | operator+= (const NimBLEAttValue &source) |
| Operator; Append another NimBLEAttValue.
|
|
NimBLEAttValue & | operator= (const std::string &source) |
| Operator; Set the value from a std::string source.
|
|
NimBLEAttValue & | operator= (NimBLEAttValue &&source) |
| Move assignment operator.
|
|
NimBLEAttValue & | operator= (const NimBLEAttValue &source) |
| Copy assignment operator.
|
|
bool | operator== (const NimBLEAttValue &source) |
| Equality operator.
|
|
bool | operator!= (const NimBLEAttValue &source) |
| Inequality operator.
|
|
A specialized container class to hold BLE attribute values.
This class is designed to be more memory efficient than using
standard container types for value storage, while being convertible to
many different container classes.