dotstack API Reference
1.10.37
|
This module describes functions and data structures used to implement a GATT client (central). More...
Modules | |
Configuration | |
This module describes parameters used to configure GATT client. | |
Data Structures | |
struct | bt_att_client_uuid_t |
UUID. More... | |
struct | bt_gatt_client_service_definition_t |
Service Definition. More... | |
struct | bt_gatt_client_inc_service_declaration_t |
Included Service Declaration. More... | |
struct | bt_gatt_client_char_declaration_t |
Characteristic Declaration. More... | |
struct | bt_gatt_client_char_value_t |
Characteristic Value. More... | |
struct | bt_gatt_client_char_descriptor_t |
Characteristic Descriptor Declaration. More... | |
struct | bt_gatt_client_evt_exchange_mtu_completed_t |
Parameter to GATT_CLIENT_EVT_EXCHANGE_MTU_COMPLETED event. More... | |
struct | bt_gatt_client_evt_discover_all_services_completed_t |
Parameter to GATT_CLIENT_EVT_DISCOVER_ALL_SERVICES_COMPLETED event. More... | |
struct | bt_gatt_client_evt_discover_service_by_uuid_completed_t |
Parameter to GATT_CLIENT_EVT_DISCOVER_SERVICE_BY_UUID_COMPLETED event. More... | |
struct | bt_gatt_client_evt_find_included_completed_t |
Parameter to GATT_CLIENT_EVT_FIND_INCLUDED_SERVICES_COMPLETED event. More... | |
struct | bt_gatt_client_evt_discover_all_chars_completed_t |
Parameter to GATT_CLIENT_EVT_DISCOVER_ALL_CHARS_COMPLETED event. More... | |
struct | bt_gatt_client_evt_discover_char_by_uuid_completed_t |
Parameter to GATT_CLIENT_EVT_DISCOVER_CHAR_BY_UUID_COMPLETED event. More... | |
struct | bt_gatt_client_evt_read_char_value_completed_t |
Parameter to GATT_CLIENT_EVT_READ_CHAR_VALUE_COMPLETED event. More... | |
struct | bt_gatt_client_evt_read_by_char_uuid_completed_t |
Parameter to GATT_CLIENT_EVT_READ_USING_CHAR_UUID_COMPLETED event. More... | |
struct | bt_gatt_client_evt_read_multiple_char_values_completed_t |
Parameter to GATT_CLIENT_EVT_READ_MULTIPLE_CHAR_VALUES_COMPLETED event. More... | |
struct | bt_gatt_client_evt_read_char_long_value_completed_t |
Parameter to GATT_CLIENT_EVT_READ_CHAR_LONG_VALUE_COMPLETED event. More... | |
struct | bt_gatt_client_evt_write_char_value_completed_t |
Parameter to GATT_CLIENT_EVT_WRITE_CHAR_VALUE_COMPLETED event. More... | |
struct | bt_gatt_client_evt_write_char_long_value_completed_t |
Parameter to GATT_CLIENT_EVT_WRITE_CHAR_LONG_VALUE_COMPLETED event. More... | |
struct | bt_gatt_client_evt_prepare_write_char_long_value_completed_t |
Parameter to GATT_CLIENT_EVT_PREPARE_WRITE_CHAR_LONG_VALUE_COMPLETED event. More... | |
struct | bt_gatt_client_evt_value_notification_t |
Parameter to GATT_CLIENT_EVT_VALUE_NOTIFICATION event. More... | |
struct | bt_gatt_client_evt_discover_descriptors_completed_t |
Parameter to GATT_CLIENT_EVT_DISCOVER_CHAR_DESCRIPTORS_COMPLETED event. More... | |
struct | bt_gatt_client_evt_read_char_descriptor_completed_t |
Parameter to GATT_CLIENT_EVT_READ_CHAR_DESCRIPTOR_COMPLETED event. More... | |
struct | bt_gatt_client_evt_read_char_long_descriptor_completed_t |
Parameter to GATT_CLIENT_EVT_READ_CHAR_LONG_DESCRIPTOR_COMPLETED event. More... | |
struct | bt_gatt_client_evt_write_char_descriptor_completed_t |
Parameter to GATT_CLIENT_EVT_WRITE_CHAR_DESCRIPTOR_COMPLETED event. More... | |
struct | bt_gatt_client_evt_write_char_long_descriptor_completed_t |
Parameter to GATT_CLIENT_EVT_WRITE_CHAR_LONG_DESCRIPTOR_COMPLETED event. More... | |
struct | bt_gatt_client_evt_conn_param_update_t |
Parameter to GATT_CLIENT_EVT_CONN_PARAM_UPDATE_REQUEST event. More... | |
struct | bt_gatt_client_evt_conn_param_update_completed_t |
Parameter to GATT_CLIENT_EVT_CONN_PARAM_UPDATE_COMPLETED event. More... | |
struct | bt_gatt_client_evt_tran_timeout_t |
Parameter to GATT_CLIENT_EVT_TRAN_TIMEOUT event. More... | |
struct | bt_gatt_client_evt_write_char_value_wo_resp_completed_t |
Parameter to GATT_CLIENT_EVT_WRITE_CHAR_VAL_WO_RESP_COMPLETED event. More... | |
struct | bt_gatt_client_evt_signed_write_char_value_wo_resp_completed_t |
Parameter to GATT_CLIENT_EVT_SIGNED_WRITE_CHAR_VAL_WO_RESP_COMPLETED event. More... | |
union | bt_gatt_client_evt_t |
Parameter to GATT client application callback. More... | |
Macros | |
#define | bt_gatt_client_accept_conn_param_update(session, min_interval, max_interval, slave_latency, supervision_timeout, min_ce_length, max_ce_length) bt_att_client_accept_conn_param_update(session->att_session, min_interval, max_interval, slave_latency, supervision_timeout, min_ce_length, max_ce_length) |
Accept connection parameters update. More... | |
#define | bt_gatt_client_reject_conn_param_update(session) bt_att_client_reject_conn_param_update(session->att_session) |
Reject connection parameters update. More... | |
Functions | |
bt_bool | bt_gatt_client_init (void) |
Initialize the GATT client. More... | |
bt_gatt_client_mgr_t * | bt_gatt_get_client_mgr (void) |
Return a pointer to an instance of the GATT client manager. More... | |
bt_gatt_client_session_t * | bt_gatt_client_allocate_session (bt_gatt_client_session_callback_fp callback, void *callback_param) |
Allocate GATT client session. More... | |
void | bt_gatt_client_free_sessions (bt_gatt_client_session_t *session) |
Destroy GATT client session. More... | |
bt_bool | bt_gatt_client_connect (bt_gatt_client_session_t *session, bt_bdaddr_t *addr) |
Connect to a remote device (peripheral). More... | |
bt_bool | bt_gatt_client_disconnect (bt_gatt_client_session_t *session) |
Disconnect from a remote device. More... | |
bt_bool | bt_gatt_exchange_mtu (bt_gatt_client_session_t *session, bt_uint mtu) |
Exchange MTU. More... | |
bt_bool | bt_gatt_client_discover_all_services_ex (bt_gatt_client_session_t *session, bt_uint service_type, bt_uint start_handle, bt_gatt_client_service_definition_t *result, bt_uint max_results) |
Discover All Services. More... | |
bt_bool | bt_gatt_client_discover_by_service_uuid (bt_gatt_client_session_t *session, bt_uint service_uuid, bt_gatt_client_service_definition_t *result, bt_uint max_results) |
Discover Services by UUID (16-bit). More... | |
bt_bool | bt_gatt_client_find_included_services_ex (bt_gatt_client_session_t *session, const bt_gatt_client_service_definition_t *service, bt_uint start_handle, bt_gatt_client_inc_service_declaration_t *result, bt_uint max_results) |
Find Included Services. More... | |
bt_bool | bt_gatt_client_discover_by_service_uuid_80 (bt_gatt_client_session_t *session, bt_uuid_t *service_uuid, bt_gatt_client_service_definition_t *result, bt_uint max_results) |
Discover Services by UUID (128-bit). More... | |
bt_bool | bt_gatt_client_discover_all_chars_ex (bt_gatt_client_session_t *session, const bt_gatt_client_service_definition_t *service, bt_uint start_handle, bt_gatt_client_char_declaration_t *result, bt_uint max_results) |
Discover All Characteristics of a Service. More... | |
bt_bool | bt_gatt_client_discover_char_by_uuid (bt_gatt_client_session_t *session, const bt_gatt_client_service_definition_t *service, bt_uint char_uuid, bt_gatt_client_char_declaration_t *result, bt_uint max_results) |
Discover Characteristics by UUID (16-bit). More... | |
bt_bool | bt_gatt_client_discover_char_by_uuid_80 (bt_gatt_client_session_t *session, const bt_gatt_client_service_definition_t *service, bt_uuid_t *char_uuid, bt_gatt_client_char_declaration_t *result, bt_uint max_results) |
Discover Characteristics by UUID (128-bit). More... | |
bt_bool | bt_gatt_client_read_char_value (bt_gatt_client_session_t *session, const bt_gatt_client_char_declaration_t *characteristic, bt_byte *buffer, bt_uint len) |
Read Characteristic Value. More... | |
bt_bool | bt_gatt_client_read_by_char_uuid (bt_gatt_client_session_t *session, const bt_gatt_client_service_definition_t *service, bt_uint char_uuid, bt_gatt_client_char_value_t *result, bt_uint max_results) |
Read Using Characteristic UUID (16-bit). More... | |
bt_bool | bt_gatt_client_read_by_char_uuid_80 (bt_gatt_client_session_t *session, const bt_gatt_client_service_definition_t *service, bt_uuid_t *char_uuid, bt_gatt_client_char_value_t *result, bt_uint max_results) |
Read Using Characteristic UUID (128-bit). More... | |
bt_bool | bt_gatt_client_read_char_long_value (bt_gatt_client_session_t *session, const bt_gatt_client_char_declaration_t *characteristic, bt_uint offset, bt_byte *buffer, bt_uint len) |
Read Long Characteristic Value. More... | |
bt_bool | bt_gatt_client_read_multiple_char_values (bt_gatt_client_session_t *session, const bt_uint *handles, bt_uint count, bt_byte *buffer, bt_uint len) |
Read Multiple Characteristic Values. More... | |
bt_bool | bt_gatt_client_write_char_value (bt_gatt_client_session_t *session, const bt_gatt_client_char_declaration_t *characteristic, const bt_byte *value, bt_uint len) |
Write Characteristic Value. More... | |
bt_bool | bt_gatt_client_set_char_value (bt_gatt_client_session_t *session, const bt_gatt_client_char_declaration_t *characteristic, const bt_byte *value, bt_uint len) |
Write Without Response. More... | |
bt_bool | bt_gatt_client_write_char_long_value (bt_gatt_client_session_t *session, const bt_gatt_client_char_declaration_t *characteristic, bt_uint value_offset, const bt_byte *value, bt_uint len) |
Write Long Characteristic Value. More... | |
bt_bool | bt_gatt_client_discover_char_descriptors (bt_gatt_client_session_t *session, const bt_gatt_client_char_declaration_t *characteristic, bt_gatt_client_char_descriptor_t *result, bt_uint max_results) |
Discover All Characteristic Descriptors. More... | |
bt_bool | bt_gatt_client_read_char_descriptor (bt_gatt_client_session_t *session, const bt_gatt_client_char_descriptor_t *descriptor, bt_byte *buffer, bt_uint len) |
Read Characteristic Descriptor. More... | |
bt_bool | bt_gatt_client_read_char_long_descriptor (bt_gatt_client_session_t *session, const bt_gatt_client_char_descriptor_t *descriptor, bt_uint offset, bt_byte *buffer, bt_uint len) |
Read Long Characteristic Descriptor. More... | |
bt_bool | bt_gatt_client_write_char_descriptor (bt_gatt_client_session_t *session, const bt_gatt_client_char_descriptor_t *descriptor, const bt_byte *value, bt_uint len) |
Write Characteristic Descriptor. More... | |
bt_bool | bt_gatt_client_write_char_long_descriptor (bt_gatt_client_session_t *session, const bt_gatt_client_char_descriptor_t *descriptor, bt_uint value_offset, const bt_byte *value, bt_uint len) |
Write Long Characteristic Descriptor. More... | |
bt_hci_conn_state_t * | bt_gatt_client_get_hci_connection (const bt_gatt_client_session_t *session) |
Get HCI connection for a session. More... | |
Events | |
#define | GATT_CLIENT_EVT_SESSION_CONNECTED 1 |
This event is generated when the client connected to the server. | |
#define | GATT_CLIENT_EVT_SESSION_DISCONNECTED 2 |
This event is generated when the client disconnected from the server. | |
#define | GATT_CLIENT_EVT_CONNECTION_FAILED 3 |
This event is generated when the client failed to connect to the server. | |
#define | GATT_CLIENT_EVT_TRAN_TIMEOUT 7 |
This event is generated if operation (discover, read, write) timed out. | |
#define | GATT_CLIENT_EVT_DISCOVER_ALL_SERVICES_COMPLETED 10 |
This event is generated when the "discover all services" operation has completed. | |
#define | GATT_CLIENT_EVT_DISCOVER_SERVICE_BY_UUID_COMPLETED 11 |
This event is generated when the "discover service by UUID" operation has completed. | |
#define | GATT_CLIENT_EVT_DISCOVER_ALL_CHARS_COMPLETED 12 |
This event is generated when the "discover all characteristics" operation has completed. | |
#define | GATT_CLIENT_EVT_READ_CHAR_VALUE_COMPLETED 13 |
This event is generated when the "read characteristic value" operation has completed. | |
#define | GATT_CLIENT_EVT_READ_CHAR_LONG_VALUE_COMPLETED 14 |
This event is generated when the "read long characteristic value" operation has completed. | |
#define | GATT_CLIENT_EVT_WRITE_CHAR_VALUE_COMPLETED 15 |
This event is generated when the "write characteristic value" operation has completed. | |
#define | GATT_CLIENT_EVT_WRITE_CHAR_LONG_VALUE_COMPLETED 16 |
This event is generated when the "write long characteristic value" operation has completed. | |
#define | GATT_CLIENT_EVT_VALUE_NOTIFICATION 17 |
This event is generated when the client received value notification or indication. | |
#define | GATT_CLIENT_EVT_DISCOVER_CHAR_DESCRIPTORS_COMPLETED 18 |
This event is generated when the "discover characteristic descriptors" operation has completed. | |
#define | GATT_CLIENT_EVT_WRITE_CHAR_DESCRIPTOR_COMPLETED 19 |
This event is generated when the "write characteristic descriptor" operation has completed. | |
#define | GATT_CLIENT_EVT_WRITE_CHAR_LONG_DESCRIPTOR_COMPLETED 20 |
This event is generated when the "write characteristic long descriptor" operation has completed. | |
#define | GATT_CLIENT_EVT_READ_CHAR_DESCRIPTOR_COMPLETED 21 |
This event is generated when the "read characteristic descriptor" operation has completed. | |
#define | GATT_CLIENT_EVT_READ_CHAR_LONG_DESCRIPTOR_COMPLETED 22 |
This event is generated when the "read characteristic long descriptor" operation has completed. | |
#define | GATT_CLIENT_EVT_EXCHANGE_MTU_COMPLETED 23 |
This event is generated when the "exchange MTU" operation has completed. | |
#define | GATT_CLIENT_EVT_FIND_INCLUDED_SERVICES_COMPLETED 24 |
This event is generated when the "find included services" operation has completed. | |
#define | GATT_CLIENT_EVT_DISCOVER_CHAR_BY_UUID_COMPLETED 25 |
This event is generated when the "discover characteristic by UUID" operation has completed. | |
#define | GATT_CLIENT_EVT_READ_USING_CHAR_UUID_COMPLETED 26 |
This event is generated when the "read characteristic value using characteristic UUID" operation has completed. | |
#define | GATT_CLIENT_EVT_READ_MULTIPLE_CHAR_VALUES_COMPLETED 27 |
This event is generated when the "read multiple characteristic values" operation has completed. | |
#define | GATT_CLIENT_EVT_CONN_PARAM_UPDATE_REQUEST 28 |
This event is generated when the client received "connection parameter update" request. | |
#define | GATT_CLIENT_EVT_CONN_PARAM_UPDATE_COMPLETED 29 |
This event is generated after the new connection parameters have been set. | |
#define | GATT_CLIENT_EVT_WRITE_CHAR_VAL_WO_RESP_COMPLETED 30 |
This event is generated when a write command has been sent. | |
#define | GATT_CLIENT_EVT_SIGNED_WRITE_CHAR_VAL_WO_RESP_COMPLETED 31 |
This event is generated when a signed write command has been sent. | |
#define | GATT_CLIENT_EVT_PREPARE_WRITE_CHAR_LONG_VALUE_COMPLETED 32 |
This event is generated when the "prepare write long characteristic value" operation has completed. | |
#define | GATT_CLIENT_EVT_PROFILE_FINDER_STARTED 100 |
#define | GATT_CLIENT_EVT_PROFILE_FINDER_COMPLETED 101 |
#define | GATT_CLIENT_EVT_PROFILE_FOUND 102 |
This module describes functions and data structures used to implement a GATT client (central).
#define bt_gatt_client_accept_conn_param_update | ( | session, | |
min_interval, | |||
max_interval, | |||
slave_latency, | |||
supervision_timeout, | |||
min_ce_length, | |||
max_ce_length | |||
) | bt_att_client_accept_conn_param_update(session->att_session, min_interval, max_interval, slave_latency, supervision_timeout, min_ce_length, max_ce_length) |
Accept connection parameters update.
When a server sends "connection parameters update" request a GATT_CLIENT_EVT_CONN_PARAM_UPDATE_REQUEST event is generated. Client has to either accept the request or deny it. bt_gatt_client_accept_conn_param_update
is used to accept the request.
session | GATT session. |
min_interval | Minimum connection interval expressed in 1.25ms units. |
max_interval | Maximum connection interval expressed in 1.25ms units. |
slave_latency | Slave latency expressed as number of connection events. |
supervision_timeout | Link supervision timeout expressed in 10ms units. |
min_ce_length | Information parameter about the minimum length of connection needed for this LE connection expressed in 0.625ms units. |
max_ce_length | Information parameter about the maximum length of connection needed for this LE connection expressed in 0.625ms units. |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. #define bt_gatt_client_reject_conn_param_update | ( | session | ) | bt_att_client_reject_conn_param_update(session->att_session) |
Reject connection parameters update.
When a server sends "connection parameters update" request a GATT_CLIENT_EVT_CONN_PARAM_UPDATE_REQUEST event is generated. Client has to either accept the request or deny it. bt_gatt_client_reject_conn_param_update
is used to deny the request.
session | GATT session. |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_gatt_client_session_t* bt_gatt_client_allocate_session | ( | bt_gatt_client_session_callback_fp | callback, |
void * | callback_param | ||
) |
Allocate GATT client session.
This function allocates a new GATT client session.
callback | The callback function that will be called when the GATT client generates an event. |
callback_param | A pointer to arbitrary data to be passed to the callback callback. |
NULL
otherwise. bt_bool bt_gatt_client_connect | ( | bt_gatt_client_session_t * | session, |
bt_bdaddr_t * | addr | ||
) |
Connect to a remote device (peripheral).
This function establishes a connection to a remote device specified by the addr
. If connection cannot be initiated for some reason, for example, there is not enough resources, it returns FALSE and no events are generated. Otherwise the result of an attempt to connect to the remote device is reported via the GATT client callback. The events generated will either be GATT_CLIENT_SESSION_EVT_SESSION_CONNECTED or GATT_CLIENT_SESSION_EVT_CONNECTION_FAILED.
session | GATT session. |
addr | The address of a remote device. |
TRUE
if connection establishment has been started. FALSE
otherwise. bt_bool bt_gatt_client_disconnect | ( | bt_gatt_client_session_t * | session | ) |
Disconnect from a remote device.
This function closes a connection to a remote device. After the connection has been terminated the GATT client callback is called with GATT_CLIENT_SESSION_EVT_SESSION_DISCONNECTED event.
session | GATT session. |
TRUE
if disconnection has been started. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_discover_all_chars_ex | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_service_definition_t * | service, | ||
bt_uint | start_handle, | ||
bt_gatt_client_char_declaration_t * | result, | ||
bt_uint | max_results | ||
) |
Discover All Characteristics of a Service.
This function finds all the characteristic declarations within a service definition on a server.
session | GATT session. |
service | Service definition. |
start_handle | First attribute handle from which the server has to start searching for characteristic declarations. |
result | Pointer to a buffer where the client will store found characteristic declarations. |
max_result | The maximum number of characteristic declarations that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_discover_all_services_ex | ( | bt_gatt_client_session_t * | session, |
bt_uint | service_type, | ||
bt_uint | start_handle, | ||
bt_gatt_client_service_definition_t * | result, | ||
bt_uint | max_results | ||
) |
Discover All Services.
This function discovers all the primary services on the server.
session | GATT session. |
start_handle | First attribute handle from which the server has to start searching for services. |
result | Pointer to a buffer where the client will store definitions of the found services. |
max_result | The maximum number of service definitions that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_discover_by_service_uuid | ( | bt_gatt_client_session_t * | session, |
bt_uint | service_uuid, | ||
bt_gatt_client_service_definition_t * | result, | ||
bt_uint | max_results | ||
) |
Discover Services by UUID (16-bit).
This function discovers a specific primary service on the server when only the Service UUID is known.
session | GATT session. |
service_uuid | 16-bit Service UUID. |
result | Pointer to a buffer where the client will store definitions of the found services. |
max_result | The maximum number of service definitions that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_discover_by_service_uuid_80 | ( | bt_gatt_client_session_t * | session, |
bt_uuid_t * | service_uuid, | ||
bt_gatt_client_service_definition_t * | result, | ||
bt_uint | max_results | ||
) |
Discover Services by UUID (128-bit).
This function discovers a specific primary service on the server when only the Service UUID is known.
session | GATT session. |
service_uuid | 128-bit Service UUID. |
result | Pointer to a buffer where the client will store definitions of the found services. |
max_result | The maximum number of service definitions that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_discover_char_by_uuid | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_service_definition_t * | service, | ||
bt_uint | char_uuid, | ||
bt_gatt_client_char_declaration_t * | result, | ||
bt_uint | max_results | ||
) |
Discover Characteristics by UUID (16-bit).
This function finds characteristic declarations within a service definition on a server by the characteristic UUID.
session | GATT session. |
service | Service definition. |
char_uuid | 16-bit characteristic UUID. |
result | Pointer to a buffer where the client will store found characteristic declarations. |
max_result | The maximum number of characteristic declarations that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_discover_char_by_uuid_80 | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_service_definition_t * | service, | ||
bt_uuid_t * | char_uuid, | ||
bt_gatt_client_char_declaration_t * | result, | ||
bt_uint | max_results | ||
) |
Discover Characteristics by UUID (128-bit).
This function finds characteristic declarations within a service definition on a server by the characteristic UUID.
session | GATT session. |
service | Service definition. |
char_uuid | 128-bit characteristic UUID. |
result | Pointer to a buffer where the client will store found characteristic declarations. |
max_result | The maximum number of characteristic declarations that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_discover_char_descriptors | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_declaration_t * | characteristic, | ||
bt_gatt_client_char_descriptor_t * | result, | ||
bt_uint | max_results | ||
) |
Discover All Characteristic Descriptors.
This function finds all the characteristic descriptors.
session | GATT session. |
characteristic | Characteristic declaration. |
start_handle | First attribute handle from which the server has to start searching for characteristic declarations. |
result | Pointer to a buffer where the client will store found characteristic descriptors. |
max_result | The maximum number of characteristic descriptors that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_find_included_services_ex | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_service_definition_t * | service, | ||
bt_uint | start_handle, | ||
bt_gatt_client_inc_service_declaration_t * | result, | ||
bt_uint | max_results | ||
) |
Find Included Services.
This function finds include service declarations within a service definition on a server.
session | GATT session. |
service | Service definition. |
start_handle | First attribute handle from which the server has to start searching for include service declarations. |
result | Pointer to a buffer where the client will store found include service declarations. |
max_result | The maximum number of include service declarations that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. void bt_gatt_client_free_sessions | ( | bt_gatt_client_session_t * | session | ) |
Destroy GATT client session.
This function frees memory used by the session. The session has to exist and be in the "idle" state for this function to succeed. I.e. the session has to be disconnected before this function can be called.
session | GATT session. |
TRUE
if the function succeeds. FALSE
otherwise. bt_hci_conn_state_t* bt_gatt_client_get_hci_connection | ( | const bt_gatt_client_session_t * | session | ) |
Get HCI connection for a session.
This function returns a pointer to a structure that describes an HCI connection a session is open on. The return value can be used to call various function from the HCI layer. For example, if an app wants to force disconnection from a remote device it can call bt_hci_disconnect.
session | GATT session. |
Pointer
to a structure that describes an HCI connection if the function succeeds. NULL
otherwise. The function fails only if a session specified by the session
parameter bt_bool bt_gatt_client_init | ( | void | ) |
Initialize the GATT client.
This function initializes the GATT client of the stack. It must be called prior to any other GATT client function can be called.
TRUE
bt_bool bt_gatt_client_read_by_char_uuid | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_service_definition_t * | service, | ||
bt_uint | char_uuid, | ||
bt_gatt_client_char_value_t * | result, | ||
bt_uint | max_results | ||
) |
Read Using Characteristic UUID (16-bit).
This function reads characteristic values from a server when only the characteristic UUID is known.
session | GATT session. |
service | Service definition. |
char_uuid | 16-bit characteristic UUID. |
result | Pointer to a buffer where the client will store characteristic values. |
max_result | The maximum number of characteristic values that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_read_by_char_uuid_80 | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_service_definition_t * | service, | ||
bt_uuid_t * | char_uuid, | ||
bt_gatt_client_char_value_t * | result, | ||
bt_uint | max_results | ||
) |
Read Using Characteristic UUID (128-bit).
This function reads characteristic values from a server when only the characteristic UUID is known.
session | GATT session. |
service | Service definition. |
char_uuid | 128-bit characteristic UUID. |
result | Pointer to a buffer where the client will store characteristic values. |
max_result | The maximum number of characteristic values that can be stored in result . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_read_char_descriptor | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_descriptor_t * | descriptor, | ||
bt_byte * | buffer, | ||
bt_uint | len | ||
) |
Read Characteristic Descriptor.
This function reads characteristic descriptor.
session | GATT session. |
descriptor | Characteristic descriptor. |
buffer | Pointer to a buffer where the client will store the characteristic's descriptor. |
len | The length of the buffer . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_read_char_long_descriptor | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_descriptor_t * | descriptor, | ||
bt_uint | offset, | ||
bt_byte * | buffer, | ||
bt_uint | len | ||
) |
Read Long Characteristic Descriptor.
This function reads long characteristic descriptor.
session | GATT session. |
descriptor | Characteristic descriptor. |
offset | The offset of the first octet to read. |
buffer | Pointer to a buffer where the client will store the characteristic's descriptor. |
len | The length of the buffer . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_read_char_long_value | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_declaration_t * | characteristic, | ||
bt_uint | offset, | ||
bt_byte * | buffer, | ||
bt_uint | len | ||
) |
Read Long Characteristic Value.
This function reads characteristic value.
session | GATT session. |
characteristic | Characteristic declaration. |
offset | The offset of the first octet to read. |
buffer | Pointer to a buffer where the client will store the characteristic's value. |
len | The length of the buffer . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_read_char_value | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_declaration_t * | characteristic, | ||
bt_byte * | buffer, | ||
bt_uint | len | ||
) |
Read Characteristic Value.
This function reads characteristic value.
session | GATT session. |
characteristic | Characteristic declaration. |
buffer | Pointer to a buffer where the client will store the characteristic's value. |
len | The length of the buffer . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_read_multiple_char_values | ( | bt_gatt_client_session_t * | session, |
const bt_uint * | handles, | ||
bt_uint | count, | ||
bt_byte * | buffer, | ||
bt_uint | len | ||
) |
Read Multiple Characteristic Values.
This function reads multiple characteristic values from a server when the characteristic value handles are known.
session | GATT session. |
handles | An array of characteristic value handles. |
count | The number of handles. |
buffer | Pointer to a buffer where the client will store the characteristic values. |
len | The length of the buffer . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_set_char_value | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_declaration_t * | characteristic, | ||
const bt_byte * | value, | ||
bt_uint | len | ||
) |
Write Without Response.
This function writes characteristic value to a server using ATT "write" command, i.e. the server will not send a response after writing the value.
session | GATT session. |
characteristic | Characteristic declaration. |
value | Characteristic value. |
len | The length of the value . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_write_char_descriptor | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_descriptor_t * | descriptor, | ||
const bt_byte * | value, | ||
bt_uint | len | ||
) |
Write Characteristic Descriptor.
This function writes characteristic descriptor.
session | GATT session. |
descriptor | Characteristic descriptor. |
value | Characteristic descriptor value. |
len | The length of the value . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_write_char_long_descriptor | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_descriptor_t * | descriptor, | ||
bt_uint | value_offset, | ||
const bt_byte * | value, | ||
bt_uint | len | ||
) |
Write Long Characteristic Descriptor.
This function writes characteristic descriptor.
session | GATT session. |
descriptor | Characteristic descriptor. |
value_offset | The offset of the first octet to be written. |
value | Characteristic descriptor value. |
len | The length of the buffer . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_write_char_long_value | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_declaration_t * | characteristic, | ||
bt_uint | value_offset, | ||
const bt_byte * | value, | ||
bt_uint | len | ||
) |
Write Long Characteristic Value.
This function writes characteristic value to a server using ATT "prepare write" and "execute write" requests.
session | GATT session. |
characteristic | Characteristic declaration. |
value_offset | The offset of the first octet to be written. |
value | Characteristic value. |
len | The length of the value . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_client_write_char_value | ( | bt_gatt_client_session_t * | session, |
const bt_gatt_client_char_declaration_t * | characteristic, | ||
const bt_byte * | value, | ||
bt_uint | len | ||
) |
Write Characteristic Value.
This function writes characteristic value to a server using ATT "write" request, i.e. the server will send a response after writing the value.
session | GATT session. |
characteristic | Characteristic declaration. |
value | Characteristic value. |
len | The length of the value . |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_bool bt_gatt_exchange_mtu | ( | bt_gatt_client_session_t * | session, |
bt_uint | mtu | ||
) |
Exchange MTU.
This function informs the server about the client's MTU. In response to the "exchange MTU" request the server sends its MTU to the client.
session | GATT session. |
mtu | Client's MTU. |
TRUE
if a request has been sent. FALSE
otherwise. No events will be generated. bt_gatt_client_mgr_t* bt_gatt_get_client_mgr | ( | void | ) |
Return a pointer to an instance of the GATT client manager.
This function returns a pointer to an instance of the GATT client manager. There is only one instance of the manager allocated by the stack.