9#include "rwip_config.h"
14 const gatt_cli_cb_t *p_cb,
17 return gatt_user_cli_register(pref_mtu, prio_level, p_cb, p_user_lid);
22 return gatt_user_unregister(user_lid);
26 uint16_t dummy, uint8_t disc_type,
bool full,
27 uint16_t start_hdl, uint16_t end_hdl,
28 uint8_t uuid_type,
const uint8_t *p_uuid)
30 return gatt_cli_discover_svc(conidx, user_lid, dummy, disc_type, full,
31 start_hdl, end_hdl, uuid_type, p_uuid);
35 uint16_t dummy, uint16_t start_hdl,
38 return gatt_cli_discover_inc_svc(conidx, user_lid, dummy, start_hdl,
43 uint16_t dummy, uint8_t disc_type,
44 uint16_t start_hdl, uint16_t end_hdl,
45 uint8_t uuid_type,
const uint8_t *p_uuid)
47 return gatt_cli_discover_char(conidx, user_lid, dummy, disc_type, start_hdl,
48 end_hdl, uuid_type, p_uuid);
52 uint16_t dummy, uint16_t start_hdl,
55 return gatt_cli_discover_desc(conidx, user_lid, dummy, start_hdl, end_hdl);
61 return gatt_cli_discover_cancel(conidx, user_lid, dummy);
65 uint16_t hdl, uint16_t offset, uint16_t length)
67 return gatt_cli_read(conidx, user_lid, dummy, hdl, offset, length);
71 uint16_t dummy, uint16_t start_hdl,
72 uint16_t end_hdl, uint8_t uuid_type,
73 const uint8_t *p_uuid)
75 return gatt_cli_read_by_uuid(conidx, user_lid, dummy, start_hdl, end_hdl,
80 uint8_t write_type, uint16_t hdl, uint16_t length,
81 const uint8_t* p_data)
83 co_buf_t* p_buf = NULL;
85 if(co_buf_alloc(&p_buf, GATT_BUFFER_HEADER_LEN, length, GATT_BUFFER_TAIL_LEN) == CO_BUF_ERR_NO_ERROR)
87 co_buf_copy_data_from_mem(p_buf, p_data, length);
88 status = gatt_cli_write(conidx, user_lid, dummy, write_type, hdl, 0, p_buf);
89 co_buf_release(p_buf);
93 status = GAP_ERR_INSUFF_RESOURCES;
100 uint16_t start_hdl, uint16_t end_hdl)
102 return gatt_cli_event_register(conidx, user_lid, start_hdl, end_hdl);
106 uint16_t start_hdl, uint16_t end_hdl)
108 return gatt_cli_event_unregister(conidx, user_lid, start_hdl, end_hdl);
113 return gatt_cli_mtu_exch(conidx, user_lid);
119 return gatt_cli_att_event_cfm(conidx, user_lid, token);
uint16_t xc_ble_gatt_cli_discover_desc(uint8_t conidx, uint8_t user_lid, uint16_t dummy, uint16_t start_hdl, uint16_t end_hdl)
Command used by a GATT client user to discover characteristic descriptor exposed by peer device in it...
uint16_t xc_ble_gatt_cli_discover_inc_svc(uint8_t conidx, uint8_t user_lid, uint16_t dummy, uint16_t start_hdl, uint16_t end_hdl)
Command used by a GATT client user to discover included services, exposed by peer device in its attri...
uint16_t xc_ble_gatt_cli_event_register(uint8_t conidx, uint8_t user_lid, uint16_t start_hdl, uint16_t end_hdl)
Command used by a GATT client user to register for reception of events (notification / indication) fo...
uint16_t xc_ble_gatt_cli_discover_cancel(uint8_t conidx, uint8_t user_lid, uint16_t dummy)
Command used by a GATT client user to cancel an on-going discovery procedure. The dummy parameter in ...
uint16_t xc_ble_gatt_cli_event_unregister(uint8_t conidx, uint8_t user_lid, uint16_t start_hdl, uint16_t end_hdl)
Command used by a GATT client user to stop reception of events (notification / indication) onto a spe...
uint16_t xc_ble_gatt_cli_discover_svc(uint8_t conidx, uint8_t user_lid, uint16_t dummy, uint8_t disc_type, bool full, uint16_t start_hdl, uint16_t end_hdl, uint8_t uuid_type, const uint8_t *p_uuid)
Command used by a GATT client user to discover primary or secondary services, exposed by peer device ...
uint16_t xc_ble_gatt_cli_mtu_exch(uint8_t conidx, uint8_t user_lid)
Request a MTU exchange on legacy attribute bearer. There is no callback executed when the procedure i...
uint16_t xc_ble_gatt_cli_discover_char(uint8_t conidx, uint8_t user_lid, uint16_t dummy, uint8_t disc_type, uint16_t start_hdl, uint16_t end_hdl, uint8_t uuid_type, const uint8_t *p_uuid)
Command used by a GATT client user to discover all or according to a specific UUID characteristics ex...
uint16_t xc_ble_gatt_user_cli_register(uint16_t pref_mtu, uint8_t prio_level, const gatt_cli_cb_t *p_cb, uint8_t *p_user_lid)
Command used to register a GATT user. This must be done prior to any GATT procedure execution.
uint16_t xc_ble_gatt_cli_write(uint8_t conidx, uint8_t user_lid, uint16_t dummy, uint8_t write_type, uint16_t hdl, uint16_t length, const uint8_t *p_data)
Command used by a GATT client user to request to write value of an attribute in peer database.
uint16_t xc_ble_gatt_cli_read(uint8_t conidx, uint8_t user_lid, uint16_t dummy, uint16_t hdl, uint16_t offset, uint16_t length)
Command used by a GATT client user to read value of an attribute (identified by its handle) present i...
uint16_t xc_ble_gatt_user_unregister(uint8_t user_lid)
Command used to unregister a GATT user (client or server).
uint16_t xc_ble_gatt_cli_indicate_cfm(uint8_t conidx, uint8_t user_lid, uint16_t token)
Upper layer provide status of attribute event handled by GATT client user. confirmation of indicate b...
uint16_t xc_ble_gatt_cli_read_by_uuid(uint8_t conidx, uint8_t user_lid, uint16_t dummy, uint16_t start_hdl, uint16_t end_hdl, uint8_t uuid_type, const uint8_t *p_uuid)
Command used by a GATT client user to read value of an attribute with a given UUID in peer database.
GATT client API. Copyright (c) 2022 - 2025, XinChip All rights reserved.