Use one type for UUID (2/5)
Currently, we have few different representations for UUID in stack:
tBT_UUID, tSDP_UUID, bt_uuid_t, bluetooth:UUID, or uint8_t*.
Additionally, tBT_UUID and bt_uuid_t are used to hold UUID as 128bit
as Little Endian or Big Endian, depending on which part of stack (GATT
or SDP) is using it.
This patch is creating one type, bluetooth::Uuid, that will replace all
other types.
Bug: 66912853
Test: all sl4a tests for GATT and RFCOMM
Merged-In: Ic9048a6c1f32a16034485b6185f5349e6bac0ff6
Change-Id: Ic9048a6c1f32a16034485b6185f5349e6bac0ff6
diff --git a/include/hardware/bt_sdp.h b/include/hardware/bt_sdp.h
index 76cb579..7db7139 100644
--- a/include/hardware/bt_sdp.h
+++ b/include/hardware/bt_sdp.h
@@ -37,7 +37,7 @@
typedef struct _bluetooth_sdp_hdr {
bluetooth_sdp_types type;
- bt_uuid_t uuid;
+ bluetooth::Uuid uuid;
uint32_t service_name_length;
char *service_name;
int32_t rfcomm_channel_number;
@@ -51,7 +51,7 @@
*/
typedef struct _bluetooth_sdp_hdr_overlay {
bluetooth_sdp_types type;
- bt_uuid_t uuid;
+ bluetooth::Uuid uuid;
uint32_t service_name_length;
char *service_name;
int32_t rfcomm_channel_number;
@@ -109,7 +109,11 @@
/** Callback for SDP search */
-typedef void (*btsdp_search_callback)(bt_status_t status, RawAddress *bd_addr, uint8_t* uuid, int num_records, bluetooth_sdp_record *records);
+typedef void (*btsdp_search_callback)(bt_status_t status,
+ const RawAddress &bd_addr,
+ const bluetooth::Uuid &uuid,
+ int num_records,
+ bluetooth_sdp_record *records);
typedef struct {
/** Set to sizeof(btsdp_callbacks_t) */
@@ -128,7 +132,7 @@
bt_status_t (*deinit)();
/** Search for SDP records with specific uuid on remote device */
- bt_status_t (*sdp_search)(RawAddress *bd_addr, const uint8_t* uuid);
+ bt_status_t (*sdp_search)(RawAddress *bd_addr, const bluetooth::Uuid& uuid);
/**
* Use listen in the socket interface to create rfcomm and/or l2cap PSM channels,