my version with changed conversion between duration units

Fork of BLE_API by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

DiscoveredCharacteristic Class Reference

DiscoveredCharacteristic Class Reference

Structure for holding information about the service and the characteristics found during the discovery process. More...

#include <DiscoveredCharacteristic.h>

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.

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
matchingUUIDfilter 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 63 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, else BLE_ERROR_INVALID_STATE if some internal state about the connection is invalid, or BLE_STACK_BUSY if some client procedure 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:
lengthThe amount of data being written.
valueThe 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_NONESuccessfully started the Write procedure, else BLE_ERROR_INVALID_STATE if some internal state about the connection is invalid, or BLE_STACK_BUSY if some client procedure 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 35 of file DiscoveredCharacteristic.cpp.

ble_error_t writeWoResponse ( uint16_t  length,
const uint8_t *  value 
) const

Perform a write without response procedure.

Parameters:
lengthThe amount of data being written.
valueThe 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_NONESuccessfully started the Write procedure, else BLE_ERROR_INVALID_STATE if some internal state about the connection is invalid, or BLE_STACK_BUSY if some client procedure 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 49 of file DiscoveredCharacteristic.cpp.