LE: Add instance ID to descriptors (3/4)
If a remote devices offers multiple descriptors with the same UUID, the
instance ID is used to differentiate between them.
Change-Id: Ia5ab989f222a5cf1b7cb66966ad4f91f2b660708
diff --git a/include/hardware/bt_gatt_client.h b/include/hardware/bt_gatt_client.h
index 8b49f59..c03e774 100644
--- a/include/hardware/bt_gatt_client.h
+++ b/include/hardware/bt_gatt_client.h
@@ -40,8 +40,8 @@
typedef struct
{
btgatt_srvc_id_t srvc_id;
- btgatt_char_id_t char_id;
- bt_uuid_t descr_id;
+ btgatt_gatt_id_t char_id;
+ btgatt_gatt_id_t descr_id;
btgatt_unformatted_value_t value;
uint16_t value_type;
uint8_t status;
@@ -51,8 +51,8 @@
typedef struct
{
btgatt_srvc_id_t srvc_id;
- btgatt_char_id_t char_id;
- bt_uuid_t descr_id;
+ btgatt_gatt_id_t char_id;
+ btgatt_gatt_id_t descr_id;
uint8_t status;
} btgatt_write_params_t;
@@ -62,7 +62,7 @@
uint8_t value[BTGATT_MAX_ATTR_LEN];
bt_bdaddr_t bda;
btgatt_srvc_id_t srvc_id;
- btgatt_char_id_t char_id;
+ btgatt_gatt_id_t char_id;
uint16_t len;
uint8_t is_notify;
} btgatt_notify_params_t;
@@ -105,13 +105,13 @@
/** GATT characteristic enumeration result callback */
typedef void (*get_characteristic_callback)(int conn_id, int status,
- btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id,
+ btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
int char_prop);
/** GATT descriptor enumeration result callback */
typedef void (*get_descriptor_callback)(int conn_id, int status,
- btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id,
- bt_uuid_t *descr_id);
+ btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
+ btgatt_gatt_id_t *descr_id);
/** GATT included service enumeration result callback */
typedef void (*get_included_service_callback)(int conn_id, int status,
@@ -120,7 +120,7 @@
/** Callback invoked in response to [de]register_for_notification */
typedef void (*register_for_notification_callback)(int conn_id,
int registered, int status, btgatt_srvc_id_t *srvc_id,
- btgatt_char_id_t *char_id);
+ btgatt_gatt_id_t *char_id);
/**
* Remote device notification callback, invoked when a remote device sends
@@ -212,36 +212,36 @@
* Set start_char_id to NULL to get the first characteristic.
*/
bt_status_t (*get_characteristic)( int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *start_char_id);
+ btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *start_char_id);
/**
* Enumerate descriptors for a given characteristic.
* Set start_descr_id to NULL to get the first descriptor.
*/
bt_status_t (*get_descriptor)( int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id,
- bt_uuid_t *start_descr_id);
+ btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
+ btgatt_gatt_id_t *start_descr_id);
/** Read a characteristic on a remote device */
bt_status_t (*read_characteristic)( int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id,
+ btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
int auth_req );
/** Write a remote characteristic */
bt_status_t (*write_characteristic)(int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id,
+ btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
int write_type, int len, int auth_req,
char* p_value);
/** Read the descriptor for a given characteristic */
bt_status_t (*read_descriptor)(int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id,
- bt_uuid_t *descr_id, int auth_req);
+ btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
+ btgatt_gatt_id_t *descr_id, int auth_req);
/** Write a remote descriptor for a given characteristic */
bt_status_t (*write_descriptor)( int conn_id,
- btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id,
- bt_uuid_t *descr_id, int write_type, int len,
+ btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id,
+ btgatt_gatt_id_t *descr_id, int write_type, int len,
int auth_req, char* p_value);
/** Execute a prepared write operation */
@@ -253,12 +253,12 @@
*/
bt_status_t (*register_for_notification)( int client_if,
const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id,
- btgatt_char_id_t *char_id);
+ btgatt_gatt_id_t *char_id);
/** Deregister a previous request for notifications/indications */
bt_status_t (*deregister_for_notification)( int client_if,
const bt_bdaddr_t *bd_addr, btgatt_srvc_id_t *srvc_id,
- btgatt_char_id_t *char_id);
+ btgatt_gatt_id_t *char_id);
/** Request RSSI for a given remote device */
bt_status_t (*read_remote_rssi)( int client_if, const bt_bdaddr_t *bd_addr);