diff --git a/components/bt/host/bluedroid/bta/include/bta/bta_sys.h b/components/bt/host/bluedroid/bta/include/bta/bta_sys.h index 0ee6376fdf16..54376de635a7 100644 --- a/components/bt/host/bluedroid/bta/include/bta/bta_sys.h +++ b/components/bt/host/bluedroid/bta/include/bta/bta_sys.h @@ -263,12 +263,20 @@ extern void bta_sys_notify_collision (BD_ADDR_PTR p_bda); #if (BTA_EIR_CANNED_UUID_LIST != TRUE) extern void bta_sys_eir_register(tBTA_SYS_EIR_CBACK *p_cback); -extern void bta_sys_add_uuid(UINT16 uuid16); +extern void bta_sys_add_uuid(UINT16 uuid); +extern void bta_sys_add_uuid_32(UINT32 uuid32); +extern void bta_sys_add_uuid_128(UINT8 *uuid128); extern void bta_sys_remove_uuid(UINT16 uuid16); +extern void bta_sys_remove_uuid_32(UINT32 uuid32); +extern void bta_sys_remove_uuid_128(UINT8 *uuid128); #else #define bta_sys_eir_register(ut) #define bta_sys_add_uuid(ut) +#define bta_sys_add_uuid_32(ut) +#define bta_sys_add_uuid_128(ut) #define bta_sys_remove_uuid(ut) +#define bta_sys_remove_uuid_32(ut) +#define bta_sys_remove_uuid_128(ut) #endif extern void bta_sys_set_policy (UINT8 id, UINT8 policy, BD_ADDR peer_addr); diff --git a/components/bt/host/bluedroid/bta/sys/bta_sys_conn.c b/components/bt/host/bluedroid/bta/sys/bta_sys_conn.c index 2d55dec48a33..92899c9a9c86 100644 --- a/components/bt/host/bluedroid/bta/sys/bta_sys_conn.c +++ b/components/bt/host/bluedroid/bta/sys/bta_sys_conn.c @@ -527,8 +527,54 @@ void bta_sys_eir_register(tBTA_SYS_EIR_CBACK *p_cback) *******************************************************************************/ void bta_sys_add_uuid(UINT16 uuid16) { + tBT_UUID uuid; + uuid.len = LEN_UUID_16; + memcpy(&uuid.uu.uuid16, &uuid16, LEN_UUID_16); if (bta_sys_cb.eir_cb) { - bta_sys_cb.eir_cb(uuid16, TRUE ); + bta_sys_cb.eir_cb(uuid, TRUE ); + } +} + + +/******************************************************************************* +** +** Function bta_sys_add_uuid_32 +** +** Description Called by BTA subsystems to indicate to DM that new service +** class UUID is added. +** +** Returns void +** +*******************************************************************************/ +void bta_sys_add_uuid_32(UINT32 uuid32) +{ + tBT_UUID uuid; + uuid.len = LEN_UUID_32; + memcpy(&uuid.uu.uuid32, &uuid32, LEN_UUID_32); + + if (bta_sys_cb.eir_cb) { + bta_sys_cb.eir_cb(uuid, TRUE ); + } +} + +/******************************************************************************* +** +** Function bta_sys_add_uuid_128 +** +** Description Called by BTA subsystems to indicate to DM that new service +** class UUID is added. +** +** Returns void +** +*******************************************************************************/ +void bta_sys_add_uuid_128(UINT8 *uuid128) +{ + tBT_UUID uuid; + uuid.len = LEN_UUID_128; + memcpy(&uuid.uu.uuid128, uuid128, LEN_UUID_128); + + if (bta_sys_cb.eir_cb) { + bta_sys_cb.eir_cb(uuid, TRUE ); } } @@ -544,10 +590,54 @@ void bta_sys_add_uuid(UINT16 uuid16) *******************************************************************************/ void bta_sys_remove_uuid(UINT16 uuid16) { + tBT_UUID uuid; + uuid.len = LEN_UUID_16; + memcpy(&uuid.uu.uuid16, &uuid16, LEN_UUID_16); + if (bta_sys_cb.eir_cb) { + bta_sys_cb.eir_cb(uuid, FALSE); + } +} + +/******************************************************************************* +** +** Function bta_sys_remove_uuid_32 +** +** Description Called by BTA subsystems to indicate to DM that the service +** class UUID is removed. +** +** Returns void +** +*******************************************************************************/ +void bta_sys_remove_uuid_32(UINT32 uuid32) +{ + tBT_UUID uuid; + uuid.len = LEN_UUID_32; + memcpy(&uuid.uu.uuid32, &uuid32, LEN_UUID_32); if (bta_sys_cb.eir_cb) { - bta_sys_cb.eir_cb(uuid16, FALSE); + bta_sys_cb.eir_cb(uuid, FALSE); } } + +/******************************************************************************* +** +** Function bta_sys_remove_uuid_128 +** +** Description Called by BTA subsystems to indicate to DM that the service +** class UUID is removed. +** +** Returns void +** +*******************************************************************************/ +void bta_sys_remove_uuid_128(UINT8 *uuid128) +{ + tBT_UUID uuid; + uuid.len = LEN_UUID_128; + memcpy(&uuid.uu.uuid128, uuid128, LEN_UUID_128); + if (bta_sys_cb.eir_cb) { + bta_sys_cb.eir_cb(uuid, FALSE); + } +} + #endif /*******************************************************************************