A model of remote BLE descriptor.
More...
#include <NimBLERemoteDescriptor.h>
|
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.
◆ getHandle()
uint16_t NimBLERemoteDescriptor::getHandle |
( |
| ) |
|
Retrieve the handle associated with this remote descriptor.
- Returns
- The handle associated with this remote descriptor.
◆ getRemoteCharacteristic()
Get the characteristic that owns this descriptor.
- Returns
- The characteristic that owns this descriptor.
◆ getUUID()
Retrieve the UUID associated this remote descriptor.
- Returns
- The UUID associated this remote descriptor.
◆ readUInt16()
uint16_t NimBLERemoteDescriptor::readUInt16 |
( |
| ) |
|
◆ readUInt32()
uint32_t NimBLERemoteDescriptor::readUInt32 |
( |
| ) |
|
◆ readUInt8()
uint8_t NimBLERemoteDescriptor::readUInt8 |
( |
| ) |
|
◆ readValue() [1/2]
Read the value of the remote descriptor.
- Returns
- The value of the remote descriptor.
◆ readValue() [2/2]
template<typename T >
T NimBLERemoteDescriptor::readValue |
( |
bool |
skipSizeCheck = false | ) |
|
|
inline |
Template to convert the remote descriptor data to <type>.
- Template Parameters
-
T | The type to convert the data to. |
- Parameters
-
[in] | skipSizeCheck | If true it will skip checking if the data size is less than sizeof(<type>) . |
- Returns
- The data converted to <type> or NULL if skipSizeCheck is false and the data is less than
sizeof(<type>)
.
Use: readValue<type>(skipSizeCheck);
◆ toString()
std::string NimBLERemoteDescriptor::toString |
( |
void |
| ) |
|
Return a string representation of this Remote Descriptor.
- Returns
- A string representation of this Remote Descriptor.
◆ writeValue() [1/5]
bool NimBLERemoteDescriptor::writeValue |
( |
const char * |
char_s, |
|
|
bool |
response = false |
|
) |
| |
Write a new value to the remote descriptor from a const char*.
- Parameters
-
[in] | char_s | A character string to write to the remote descriptor. |
[in] | response | Whether we require a response from the write. |
- Returns
- false if not connected or otherwise cannot perform write.
◆ writeValue() [2/5]
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>.
- Parameters
-
[in] | vec | A std::vector<uint8_t> value to write to the remote descriptor. |
[in] | response | Whether we require a response from the write. |
- Returns
- false if not connected or otherwise cannot perform write.
◆ writeValue() [3/5]
template<typename T >
bool NimBLERemoteDescriptor::writeValue |
( |
const T & |
s, |
|
|
bool |
response = false |
|
) |
| |
|
inline |
Template to set the remote descriptor value to <type>val.
- Parameters
-
[in] | s | The value to write. |
[in] | response | True == request write response. |
Only used for non-arrays and types without a c_str()
method.
◆ writeValue() [4/5]
template<typename T >
bool NimBLERemoteDescriptor::writeValue |
( |
const T & |
s, |
|
|
bool |
response = false |
|
) |
| |
|
inline |
Template to set the remote descriptor value to <type>val.
- Parameters
-
[in] | s | The value to write. |
[in] | response | True == request write response. |
Only used if the <type> has a c_str()
method.
◆ writeValue() [5/5]
bool NimBLERemoteDescriptor::writeValue |
( |
const uint8_t * |
data, |
|
|
size_t |
length, |
|
|
bool |
response = false |
|
) |
| |
Write a new value to a remote descriptor.
- Parameters
-
[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. |
- Returns
- false if not connected or otherwise cannot perform write.