esp-nimble-cpp
1.4.0
|
A model of remote BLE descriptor. More...
Public Member Functions | |
uint16_t | getHandle () |
Retrieve the handle associated with this remote descriptor. More... | |
NimBLERemoteCharacteristic * | getRemoteCharacteristic () |
Get the characteristic that owns this descriptor. More... | |
NimBLEUUID | getUUID () |
Retrieve the UUID associated this remote descriptor. More... | |
NimBLEAttValue | readValue () |
Read the value of the remote descriptor. More... | |
uint8_t | readUInt8 () __attribute__((deprecated("Use template readValue<uint8_t>()"))) |
Read a byte value. More... | |
uint16_t | readUInt16 () __attribute__((deprecated("Use template readValue<uint16_t>()"))) |
Read an unsigned 16 bit value. More... | |
uint32_t | readUInt32 () __attribute__((deprecated("Use template readValue<uint32_t>()"))) |
Read an unsigned 32 bit value. More... | |
std::string | toString (void) |
Return a string representation of this Remote Descriptor. More... | |
bool | writeValue (const uint8_t *data, size_t length, bool response=false) |
Write a new value to a remote descriptor. More... | |
bool | writeValue (const std::vector< uint8_t > &v, bool response=false) |
Write a new value to a remote descriptor from a std::vector<uint8_t>. More... | |
bool | writeValue (const char *s, bool response=false) |
Write a new value to the remote descriptor from a const char*. More... | |
template<typename T > | |
bool | writeValue (const T &s, bool response=false) |
Template to set the remote descriptor value to <type>val. More... | |
template<typename T > | |
bool | writeValue (const T &s, bool response=false) |
Template to set the remote descriptor value to <type>val. More... | |
template<typename T > | |
T | readValue (bool skipSizeCheck=false) |
Template to convert the remote descriptor data to <type>. More... | |
A model of remote BLE descriptor.
uint16_t NimBLERemoteDescriptor::getHandle | ( | ) |
Retrieve the handle associated with this remote descriptor.
NimBLERemoteCharacteristic * NimBLERemoteDescriptor::getRemoteCharacteristic | ( | ) |
Get the characteristic that owns this descriptor.
NimBLEUUID NimBLERemoteDescriptor::getUUID | ( | ) |
Retrieve the UUID associated this remote descriptor.
uint16_t NimBLERemoteDescriptor::readUInt16 | ( | ) |
Read an unsigned 16 bit value.
uint32_t NimBLERemoteDescriptor::readUInt32 | ( | ) |
Read an unsigned 32 bit value.
uint8_t NimBLERemoteDescriptor::readUInt8 | ( | ) |
NimBLEAttValue NimBLERemoteDescriptor::readValue | ( | ) |
Read the value of the remote descriptor.
|
inline |
Template to convert the remote descriptor data to <type>.
T | The type to convert the data to. |
[in] | skipSizeCheck | If true it will skip checking if the data size is less than sizeof(<type>) . |
sizeof(<type>)
.Use: readValue<type>(skipSizeCheck);
std::string NimBLERemoteDescriptor::toString | ( | void | ) |
Return a string representation of this Remote Descriptor.
bool NimBLERemoteDescriptor::writeValue | ( | const char * | char_s, |
bool | response = false |
||
) |
Write a new value to the remote descriptor from a const char*.
[in] | char_s | A character string to write to the remote descriptor. |
[in] | response | Whether we require a response from the write. |
bool NimBLERemoteDescriptor::writeValue | ( | const std::vector< uint8_t > & | vec, |
bool | response = false |
||
) |
Write a new value to a remote descriptor from a std::vector<uint8_t>.
[in] | vec | A std::vector<uint8_t> value to write to the remote descriptor. |
[in] | response | Whether we require a response from the write. |
|
inline |
Template to set the remote descriptor value to <type>val.
[in] | s | The value to write. |
[in] | response | True == request write response. |
Only used for non-arrays and types without a c_str()
method.
|
inline |
Template to set the remote descriptor value to <type>val.
[in] | s | The value to write. |
[in] | response | True == request write response. |
Only used if the <type> has a c_str()
method.
bool NimBLERemoteDescriptor::writeValue | ( | const uint8_t * | data, |
size_t | length, | ||
bool | response = false |
||
) |
Write a new value to a remote descriptor.
[in] | data | The data to send to the remote descriptor. |
[in] | length | The length of the data to send. |
[in] | response | True if we expect a write response. |