|
| NimBLEAttValue (uint16_t init_len=CONFIG_NIMBLE_CPP_ATT_VALUE_INIT_LENGTH, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Default constructor.
|
|
| 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.
|
|
| NimBLEAttValue (const char *value, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Construct with an initial value from a const char string.
|
|
| NimBLEAttValue (std::initializer_list< uint8_t > list, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Construct with an initializer list.
|
|
| NimBLEAttValue (const std::string str, uint16_t max_len=BLE_ATT_ATTR_MAX_LEN) |
| Construct with an initial value from a std::string.
|
|
| 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>.
|
|
| 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.
|
|
bool | setValue (const char *s, uint16_t len=0) |
| Set value to the value of const char*.
|
|
NimBLEAttValue & | append (const uint8_t *value, uint16_t len) |
| Append data to the value.
|
|
template<typename T > |
bool | setValue (const T &v) |
| Template to set value to the value of <type>val.
|
|
template<typename T > |
bool | setValue (const T &s) |
| Template to set value to the value of <type>val.
|
|
template<typename T > |
bool | setValue (const T &v) |
| Template to set value to the value of <type>val.
|
|
template<typename T > |
T | getValue (time_t *timestamp=nullptr, bool skipSizeCheck=false) const |
| Template to return the value as a <type>.
|
|
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) const |
| Equality operator.
|
|
bool | operator!= (const NimBLEAttValue &source) const |
| 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.