Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LinkNode-Test by
DiscoveredCharacteristic Class Reference
Structure for holding information about the service and the characteristics found during the discovery process. More...
#include <DiscoveredCharacteristic.h>
Inherited by nRF5xDiscoveredCharacteristic.
Data Structures | |
struct | DiscoveredDescriptor |
Structure for holding information about the service and the characteristics found during the discovery process. More... | |
Public Types | |
typedef void(* | DescriptorCallback_t )(const DiscoveredDescriptor *) |
Callback type for when a characteristic descriptor is found during descriptor- discovery. | |
Public Member Functions | |
ble_error_t | read (uint16_t offset=0) const |
Initiate (or continue) a read for the value attribute, optionally at a given offset. | |
ble_error_t | writeWoResponse (uint16_t length, const uint8_t *value) const |
Perform a write without response procedure. | |
ble_error_t | discoverDescriptors (DescriptorCallback_t callback, const UUID &matchingUUID=UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN)) const |
Initiate a GATT Characteristic Descriptor Discovery procedure for descriptors within this characteristic. | |
ble_error_t | write (uint16_t length, const uint8_t *value) const |
Perform a write procedure. | |
ble_error_t | write (uint16_t length, const uint8_t *value, const GattClient::WriteCallback_t &onRead) const |
Same as above but register the callback wich will be called once the data has been written. |
Detailed Description
Structure for holding information about the service and the characteristics found during the discovery process.
Definition at line 29 of file DiscoveredCharacteristic.h.
Member Typedef Documentation
typedef void(* DescriptorCallback_t)(const DiscoveredDescriptor *) |
Callback type for when a characteristic descriptor is found during descriptor- discovery.
The receiving function is passed in a pointer to a DiscoveredDescriptor object which will remain valid for the lifetime of the callback. Memory for this object is owned by the BLE_API eventing framework. The application can safely make a persistent shallow-copy of this object in order to work with the characteristic beyond the callback.
Definition at line 71 of file DiscoveredCharacteristic.h.
Member Function Documentation
ble_error_t discoverDescriptors | ( | DescriptorCallback_t | callback, |
const UUID & | matchingUUID = UUID::ShortUUIDBytes_t(BLE_UUID_UNKNOWN) |
||
) | const |
Initiate a GATT Characteristic Descriptor Discovery procedure for descriptors within this characteristic.
- Parameters:
-
callback matchingUUID Filter for descriptors. Defaults to wildcard which will discover all descriptors.
- Returns:
- BLE_ERROR_NONE if descriptor discovery is launched successfully; else an appropriate error.
Definition at line 155 of file DiscoveredCharacteristic.cpp.
ble_error_t read | ( | uint16_t | offset = 0 ) |
const |
Initiate (or continue) a read for the value attribute, optionally at a given offset.
If the characteristic or descriptor to be read is longer than ATT_MTU - 1, this function must be called multiple times with appropriate offset to read the complete value.
- Returns:
- BLE_ERROR_NONE if a read has been initiated, or BLE_ERROR_INVALID_STATE if some internal state about the connection is invalid, or BLE_STACK_BUSY if some client procedure is already in progress, or BLE_ERROR_OPERATION_NOT_PERMITTED due to the characteristic's properties.
Definition at line 21 of file DiscoveredCharacteristic.cpp.
ble_error_t write | ( | uint16_t | length, |
const uint8_t * | value | ||
) | const |
Perform a write procedure.
- Parameters:
-
length The amount of data being written. value The bytes being written.
- Note:
- It is important to note that a write will generate an onDataWritten() callback when the peer acknowledges the request.
- Return values:
-
BLE_ERROR_NONE Successfully started the Write procedure, or BLE_ERROR_INVALID_STATE if some internal state about the connection is invalid, or BLE_STACK_BUSY if some client procedure is already in progress, or BLE_ERROR_NO_MEM if there are no available buffers left to process the request, or BLE_ERROR_OPERATION_NOT_PERMITTED due to the characteristic's properties.
Definition at line 81 of file DiscoveredCharacteristic.cpp.
ble_error_t write | ( | uint16_t | length, |
const uint8_t * | value, | ||
const GattClient::WriteCallback_t & | onRead | ||
) | const |
Same as above but register the callback wich will be called once the data has been written.
Definition at line 143 of file DiscoveredCharacteristic.cpp.
ble_error_t writeWoResponse | ( | uint16_t | length, |
const uint8_t * | value | ||
) | const |
Perform a write without response procedure.
- Parameters:
-
length The amount of data being written. value The bytes being written.
- Note:
- It is important to note that a write without response will generate an onDataSent() callback when the packet has been transmitted. There will be a BLE-stack specific limit to the number of pending writeWoResponse operations; the user may want to use the onDataSent() callback for flow-control.
- Return values:
-
BLE_ERROR_NONE Successfully started the Write procedure, or BLE_ERROR_INVALID_STATE if some internal state about the connection is invalid, or BLE_STACK_BUSY if some client procedure is already in progress, or BLE_ERROR_NO_MEM if there are no available buffers left to process the request, or BLE_ERROR_OPERATION_NOT_PERMITTED due to the characteristic's properties.
Definition at line 95 of file DiscoveredCharacteristic.cpp.
Generated on Tue Jul 12 2022 16:00:25 by
