bta: Apply clang-format
clang-format -i --style=file bta/*/*
(twice)
Test: mma -j32
Change-Id: Ib118b1dfb6a34f9a5bfe153d65841e9041165264
diff --git a/bta/dm/bta_dm_api.cc b/bta/dm/bta_dm_api.cc
index efbfe81..c21647a 100644
--- a/bta/dm/bta_dm_api.cc
+++ b/bta/dm/bta_dm_api.cc
@@ -24,10 +24,10 @@
#include <string.h>
#include "bt_common.h"
-#include "bta_sys.h"
#include "bta_api.h"
#include "bta_closure_api.h"
#include "bta_dm_int.h"
+#include "bta_sys.h"
#include "bta_sys_int.h"
#include "btm_api.h"
#include "btm_int.h"
@@ -38,17 +38,10 @@
* Constants
****************************************************************************/
-static const tBTA_SYS_REG bta_dm_reg =
-{
- bta_dm_sm_execute,
- bta_dm_sm_disable
-};
+static const tBTA_SYS_REG bta_dm_reg = {bta_dm_sm_execute, bta_dm_sm_disable};
-static const tBTA_SYS_REG bta_dm_search_reg =
-{
- bta_dm_search_sm_execute,
- bta_dm_search_sm_disable
-};
+static const tBTA_SYS_REG bta_dm_search_reg = {bta_dm_search_sm_execute,
+ bta_dm_search_sm_disable};
/*******************************************************************************
*
@@ -61,26 +54,24 @@
* Returns tBTA_STATUS
*
******************************************************************************/
-tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK *p_cback)
-{
- /* Bluetooth disabling is in progress */
- if (bta_dm_cb.disabling)
- return BTA_FAILURE;
+tBTA_STATUS BTA_EnableBluetooth(tBTA_DM_SEC_CBACK* p_cback) {
+ /* Bluetooth disabling is in progress */
+ if (bta_dm_cb.disabling) return BTA_FAILURE;
- bta_sys_register(BTA_ID_DM, &bta_dm_reg );
- bta_sys_register(BTA_ID_DM_SEARCH, &bta_dm_search_reg );
+ bta_sys_register(BTA_ID_DM, &bta_dm_reg);
+ bta_sys_register(BTA_ID_DM_SEARCH, &bta_dm_search_reg);
- /* if UUID list is not provided as static data */
- bta_sys_eir_register(bta_dm_eir_update_uuid);
+ /* if UUID list is not provided as static data */
+ bta_sys_eir_register(bta_dm_eir_update_uuid);
- tBTA_DM_API_ENABLE *p_msg =
- (tBTA_DM_API_ENABLE *)osi_malloc(sizeof(tBTA_DM_API_ENABLE));
- p_msg->hdr.event = BTA_DM_API_ENABLE_EVT;
- p_msg->p_sec_cback = p_cback;
+ tBTA_DM_API_ENABLE* p_msg =
+ (tBTA_DM_API_ENABLE*)osi_malloc(sizeof(tBTA_DM_API_ENABLE));
+ p_msg->hdr.event = BTA_DM_API_ENABLE_EVT;
+ p_msg->p_sec_cback = p_cback;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
- return BTA_SUCCESS;
+ return BTA_SUCCESS;
}
/*******************************************************************************
@@ -93,15 +84,14 @@
* Returns void
*
******************************************************************************/
-tBTA_STATUS BTA_DisableBluetooth(void)
-{
- BT_HDR *p_msg = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
+tBTA_STATUS BTA_DisableBluetooth(void) {
+ BT_HDR* p_msg = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
- p_msg->event = BTA_DM_API_DISABLE_EVT;
+ p_msg->event = BTA_DM_API_DISABLE_EVT;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
- return BTA_SUCCESS;
+ return BTA_SUCCESS;
}
/*******************************************************************************
@@ -114,16 +104,15 @@
* Returns tBTA_STATUS
*
******************************************************************************/
-tBTA_STATUS BTA_EnableTestMode(void)
-{
- BT_HDR *p_msg = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
+tBTA_STATUS BTA_EnableTestMode(void) {
+ BT_HDR* p_msg = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
- APPL_TRACE_API("%s", __func__);
+ APPL_TRACE_API("%s", __func__);
- p_msg->event = BTA_DM_API_ENABLE_TEST_MODE_EVT;
- bta_sys_sendmsg(p_msg);
+ p_msg->event = BTA_DM_API_ENABLE_TEST_MODE_EVT;
+ bta_sys_sendmsg(p_msg);
- return BTA_SUCCESS;
+ return BTA_SUCCESS;
}
/*******************************************************************************
@@ -136,14 +125,13 @@
* Returns None
*
******************************************************************************/
-void BTA_DisableTestMode(void)
-{
- BT_HDR *p_msg = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
+void BTA_DisableTestMode(void) {
+ BT_HDR* p_msg = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
- APPL_TRACE_API("%s", __func__);
+ APPL_TRACE_API("%s", __func__);
- p_msg->event = BTA_DM_API_DISABLE_TEST_MODE_EVT;
- bta_sys_sendmsg(p_msg);
+ p_msg->event = BTA_DM_API_DISABLE_TEST_MODE_EVT;
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -156,15 +144,14 @@
* Returns void
*
******************************************************************************/
-void BTA_DmSetDeviceName(char *p_name)
-{
- tBTA_DM_API_SET_NAME *p_msg =
- (tBTA_DM_API_SET_NAME *)osi_malloc(sizeof(tBTA_DM_API_SET_NAME));
+void BTA_DmSetDeviceName(char* p_name) {
+ tBTA_DM_API_SET_NAME* p_msg =
+ (tBTA_DM_API_SET_NAME*)osi_malloc(sizeof(tBTA_DM_API_SET_NAME));
- p_msg->hdr.event = BTA_DM_API_SET_NAME_EVT;
- strlcpy((char*)p_msg->name, p_name, BD_NAME_LEN);
+ p_msg->hdr.event = BTA_DM_API_SET_NAME_EVT;
+ strlcpy((char*)p_msg->name, p_name, BD_NAME_LEN);
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -172,31 +159,33 @@
* Function BTA_DmSetVisibility
*
* Description This function sets the Bluetooth connectable,
- * discoverable, pairable and conn paired only modes of local device
+ * discoverable, pairable and conn paired only modes of local
+ *device
*
*
* Returns void
*
******************************************************************************/
-void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode, uint8_t pairable_mode, uint8_t conn_filter )
-{
- tBTA_DM_API_SET_VISIBILITY *p_msg =
- (tBTA_DM_API_SET_VISIBILITY *)osi_malloc(sizeof(tBTA_DM_MSG));
+void BTA_DmSetVisibility(tBTA_DM_DISC disc_mode, tBTA_DM_CONN conn_mode,
+ uint8_t pairable_mode, uint8_t conn_filter) {
+ tBTA_DM_API_SET_VISIBILITY* p_msg =
+ (tBTA_DM_API_SET_VISIBILITY*)osi_malloc(sizeof(tBTA_DM_MSG));
- p_msg->hdr.event = BTA_DM_API_SET_VISIBILITY_EVT;
- p_msg->disc_mode = disc_mode;
- p_msg->conn_mode = conn_mode;
- p_msg->pair_mode = pairable_mode;
- p_msg->conn_paired_only = conn_filter;
+ p_msg->hdr.event = BTA_DM_API_SET_VISIBILITY_EVT;
+ p_msg->disc_mode = disc_mode;
+ p_msg->conn_mode = conn_mode;
+ p_msg->pair_mode = pairable_mode;
+ p_msg->conn_paired_only = conn_filter;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
*
* Function BTA_DmSearch
*
- * Description This function searches for peer Bluetooth devices. It performs
+ * Description This function searches for peer Bluetooth devices. It
+ *performs
* an inquiry and gets the remote name for devices. Service
* discovery is done if services is non zero
*
@@ -204,18 +193,18 @@
* Returns void
*
******************************************************************************/
-void BTA_DmSearch(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK services, tBTA_DM_SEARCH_CBACK *p_cback)
-{
- tBTA_DM_API_SEARCH *p_msg =
- (tBTA_DM_API_SEARCH *)osi_calloc(sizeof(tBTA_DM_API_SEARCH));
+void BTA_DmSearch(tBTA_DM_INQ* p_dm_inq, tBTA_SERVICE_MASK services,
+ tBTA_DM_SEARCH_CBACK* p_cback) {
+ tBTA_DM_API_SEARCH* p_msg =
+ (tBTA_DM_API_SEARCH*)osi_calloc(sizeof(tBTA_DM_API_SEARCH));
- p_msg->hdr.event = BTA_DM_API_SEARCH_EVT;
- memcpy(&p_msg->inq_params, p_dm_inq, sizeof(tBTA_DM_INQ));
- p_msg->services = services;
- p_msg->p_cback = p_cback;
- p_msg->rs_res = BTA_DM_RS_NONE;
+ p_msg->hdr.event = BTA_DM_API_SEARCH_EVT;
+ memcpy(&p_msg->inq_params, p_dm_inq, sizeof(tBTA_DM_INQ));
+ p_msg->services = services;
+ p_msg->p_cback = p_cback;
+ p_msg->rs_res = BTA_DM_RS_NONE;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -228,12 +217,11 @@
* Returns void
*
******************************************************************************/
-void BTA_DmSearchCancel(void)
-{
- BT_HDR *p_msg = (BT_HDR *)osi_malloc(sizeof(BT_HDR));
+void BTA_DmSearchCancel(void) {
+ BT_HDR* p_msg = (BT_HDR*)osi_malloc(sizeof(BT_HDR));
- p_msg->event = BTA_DM_API_SEARCH_CANCEL_EVT;
- bta_sys_sendmsg(p_msg);
+ p_msg->event = BTA_DM_API_SEARCH_CANCEL_EVT;
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -248,18 +236,17 @@
*
******************************************************************************/
void BTA_DmDiscover(BD_ADDR bd_addr, tBTA_SERVICE_MASK services,
- tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search)
-{
- tBTA_DM_API_DISCOVER *p_msg =
- (tBTA_DM_API_DISCOVER *)osi_calloc(sizeof(tBTA_DM_API_DISCOVER));
+ tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search) {
+ tBTA_DM_API_DISCOVER* p_msg =
+ (tBTA_DM_API_DISCOVER*)osi_calloc(sizeof(tBTA_DM_API_DISCOVER));
- p_msg->hdr.event = BTA_DM_API_DISCOVER_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->services = services;
- p_msg->p_cback = p_cback;
- p_msg->sdp_search = sdp_search;
+ p_msg->hdr.event = BTA_DM_API_DISCOVER_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->services = services;
+ p_msg->p_cback = p_cback;
+ p_msg->sdp_search = sdp_search;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -273,25 +260,24 @@
* Returns void
*
******************************************************************************/
-void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID *uuid,
- tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search)
-{
- tBTA_DM_API_DISCOVER *p_msg =
- (tBTA_DM_API_DISCOVER *)osi_malloc(sizeof(tBTA_DM_API_DISCOVER));
+void BTA_DmDiscoverUUID(BD_ADDR bd_addr, tSDP_UUID* uuid,
+ tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search) {
+ tBTA_DM_API_DISCOVER* p_msg =
+ (tBTA_DM_API_DISCOVER*)osi_malloc(sizeof(tBTA_DM_API_DISCOVER));
- p_msg->hdr.event = BTA_DM_API_DISCOVER_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->services = BTA_USER_SERVICE_MASK; //Not exposed at API level
- p_msg->p_cback = p_cback;
- p_msg->sdp_search = sdp_search;
+ p_msg->hdr.event = BTA_DM_API_DISCOVER_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->services = BTA_USER_SERVICE_MASK; // Not exposed at API level
+ p_msg->p_cback = p_cback;
+ p_msg->sdp_search = sdp_search;
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
- p_msg->num_uuid = 0;
- p_msg->p_uuid = NULL;
+ p_msg->num_uuid = 0;
+ p_msg->p_uuid = NULL;
#endif
- memcpy(&p_msg->uuid, uuid, sizeof(tSDP_UUID) );
+ memcpy(&p_msg->uuid, uuid, sizeof(tSDP_UUID));
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -305,16 +291,15 @@
* Returns void
*
******************************************************************************/
-void BTA_DmBond(BD_ADDR bd_addr)
-{
- tBTA_DM_API_BOND *p_msg =
- (tBTA_DM_API_BOND *)osi_malloc(sizeof(tBTA_DM_API_BOND));
+void BTA_DmBond(BD_ADDR bd_addr) {
+ tBTA_DM_API_BOND* p_msg =
+ (tBTA_DM_API_BOND*)osi_malloc(sizeof(tBTA_DM_API_BOND));
- p_msg->hdr.event = BTA_DM_API_BOND_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->transport = BTA_TRANSPORT_UNKNOWN;
+ p_msg->hdr.event = BTA_DM_API_BOND_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->transport = BTA_TRANSPORT_UNKNOWN;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -328,16 +313,15 @@
* Returns void
*
******************************************************************************/
-void BTA_DmBondByTransport(BD_ADDR bd_addr, tBTA_TRANSPORT transport)
-{
- tBTA_DM_API_BOND *p_msg =
- (tBTA_DM_API_BOND *)osi_malloc(sizeof(tBTA_DM_API_BOND));
+void BTA_DmBondByTransport(BD_ADDR bd_addr, tBTA_TRANSPORT transport) {
+ tBTA_DM_API_BOND* p_msg =
+ (tBTA_DM_API_BOND*)osi_malloc(sizeof(tBTA_DM_API_BOND));
- p_msg->hdr.event = BTA_DM_API_BOND_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->transport = transport;
+ p_msg->hdr.event = BTA_DM_API_BOND_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->transport = transport;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -351,15 +335,14 @@
* Returns void
*
******************************************************************************/
-void BTA_DmBondCancel(BD_ADDR bd_addr)
-{
- tBTA_DM_API_BOND_CANCEL *p_msg =
- (tBTA_DM_API_BOND_CANCEL *)osi_malloc(sizeof(tBTA_DM_API_BOND_CANCEL));
+void BTA_DmBondCancel(BD_ADDR bd_addr) {
+ tBTA_DM_API_BOND_CANCEL* p_msg =
+ (tBTA_DM_API_BOND_CANCEL*)osi_malloc(sizeof(tBTA_DM_API_BOND_CANCEL));
- p_msg->hdr.event = BTA_DM_API_BOND_CANCEL_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->hdr.event = BTA_DM_API_BOND_CANCEL_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -373,21 +356,22 @@
* Returns void
*
******************************************************************************/
-void BTA_DmPinReply(BD_ADDR bd_addr, bool accept, uint8_t pin_len, uint8_t *p_pin)
+void BTA_DmPinReply(BD_ADDR bd_addr, bool accept, uint8_t pin_len,
+ uint8_t* p_pin)
{
- tBTA_DM_API_PIN_REPLY *p_msg =
- (tBTA_DM_API_PIN_REPLY *)osi_malloc(sizeof(tBTA_DM_API_PIN_REPLY));
+ tBTA_DM_API_PIN_REPLY* p_msg =
+ (tBTA_DM_API_PIN_REPLY*)osi_malloc(sizeof(tBTA_DM_API_PIN_REPLY));
- p_msg->hdr.event = BTA_DM_API_PIN_REPLY_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->accept = accept;
- if (accept) {
- p_msg->pin_len = pin_len;
- memcpy(p_msg->p_pin, p_pin, pin_len);
- }
+ p_msg->hdr.event = BTA_DM_API_PIN_REPLY_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->accept = accept;
+ if (accept) {
+ p_msg->pin_len = pin_len;
+ memcpy(p_msg->p_pin, p_pin, pin_len);
+ }
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -403,13 +387,12 @@
* Returns void
*
******************************************************************************/
-void BTA_DmLocalOob(void)
-{
- tBTA_DM_API_LOC_OOB *p_msg =
- (tBTA_DM_API_LOC_OOB *)osi_malloc(sizeof(tBTA_DM_API_LOC_OOB));
+void BTA_DmLocalOob(void) {
+ tBTA_DM_API_LOC_OOB* p_msg =
+ (tBTA_DM_API_LOC_OOB*)osi_malloc(sizeof(tBTA_DM_API_LOC_OOB));
- p_msg->hdr.event = BTA_DM_API_LOC_OOB_EVT;
- bta_sys_sendmsg(p_msg);
+ p_msg->hdr.event = BTA_DM_API_LOC_OOB_EVT;
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -422,16 +405,15 @@
* Returns void
*
******************************************************************************/
-void BTA_DmConfirm(BD_ADDR bd_addr, bool accept)
-{
- tBTA_DM_API_CONFIRM *p_msg =
- (tBTA_DM_API_CONFIRM *)osi_malloc(sizeof(tBTA_DM_API_CONFIRM));
+void BTA_DmConfirm(BD_ADDR bd_addr, bool accept) {
+ tBTA_DM_API_CONFIRM* p_msg =
+ (tBTA_DM_API_CONFIRM*)osi_malloc(sizeof(tBTA_DM_API_CONFIRM));
- p_msg->hdr.event = BTA_DM_API_CONFIRM_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->accept = accept;
+ p_msg->hdr.event = BTA_DM_API_CONFIRM_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->accept = accept;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -447,58 +429,57 @@
******************************************************************************/
void BTA_DmAddDevice(BD_ADDR bd_addr, DEV_CLASS dev_class, LINK_KEY link_key,
tBTA_SERVICE_MASK trusted_mask, bool is_trusted,
- uint8_t key_type, tBTA_IO_CAP io_cap, uint8_t pin_length)
-{
- tBTA_DM_API_ADD_DEVICE *p_msg =
- (tBTA_DM_API_ADD_DEVICE *)osi_calloc(sizeof(tBTA_DM_API_ADD_DEVICE));
+ uint8_t key_type, tBTA_IO_CAP io_cap, uint8_t pin_length) {
+ tBTA_DM_API_ADD_DEVICE* p_msg =
+ (tBTA_DM_API_ADD_DEVICE*)osi_calloc(sizeof(tBTA_DM_API_ADD_DEVICE));
- p_msg->hdr.event = BTA_DM_API_ADD_DEVICE_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->tm = trusted_mask;
- p_msg->is_trusted = is_trusted;
- p_msg->io_cap = io_cap;
+ p_msg->hdr.event = BTA_DM_API_ADD_DEVICE_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->tm = trusted_mask;
+ p_msg->is_trusted = is_trusted;
+ p_msg->io_cap = io_cap;
- if (link_key) {
- p_msg->link_key_known = true;
- p_msg->key_type = key_type;
- memcpy(p_msg->link_key, link_key, LINK_KEY_LEN);
- }
+ if (link_key) {
+ p_msg->link_key_known = true;
+ p_msg->key_type = key_type;
+ memcpy(p_msg->link_key, link_key, LINK_KEY_LEN);
+ }
- /* Load device class if specified */
- if (dev_class) {
- p_msg->dc_known = true;
- memcpy(p_msg->dc, dev_class, DEV_CLASS_LEN);
- }
+ /* Load device class if specified */
+ if (dev_class) {
+ p_msg->dc_known = true;
+ memcpy(p_msg->dc, dev_class, DEV_CLASS_LEN);
+ }
- memset(p_msg->bd_name, 0, BD_NAME_LEN + 1);
- memset(p_msg->features, 0, sizeof (p_msg->features));
- p_msg->pin_length = pin_length;
+ memset(p_msg->bd_name, 0, BD_NAME_LEN + 1);
+ memset(p_msg->features, 0, sizeof(p_msg->features));
+ p_msg->pin_length = pin_length;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
*
* Function BTA_DmRemoveDevice
*
- * Description This function removes a device fromthe security database list of
+ * Description This function removes a device fromthe security database
+ *list of
* peer device. It manages unpairing even while connected.
*
*
* Returns void
*
******************************************************************************/
-tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr)
-{
- tBTA_DM_API_REMOVE_DEVICE *p_msg =
- (tBTA_DM_API_REMOVE_DEVICE *)osi_calloc(sizeof(tBTA_DM_API_REMOVE_DEVICE));
+tBTA_STATUS BTA_DmRemoveDevice(BD_ADDR bd_addr) {
+ tBTA_DM_API_REMOVE_DEVICE* p_msg =
+ (tBTA_DM_API_REMOVE_DEVICE*)osi_calloc(sizeof(tBTA_DM_API_REMOVE_DEVICE));
- p_msg->hdr.event = BTA_DM_API_REMOVE_DEVICE_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->hdr.event = BTA_DM_API_REMOVE_DEVICE_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
- return BTA_SUCCESS;
+ return BTA_SUCCESS;
}
/*******************************************************************************
@@ -513,39 +494,35 @@
* Returns None
*
******************************************************************************/
-extern const uint16_t bta_service_id_to_uuid_lkup_tbl [];
-void BTA_GetEirService( uint8_t *p_eir, tBTA_SERVICE_MASK *p_services )
-{
- uint8_t xx, yy;
- uint8_t num_uuid, max_num_uuid = 32;
- uint8_t uuid_list[32*LEN_UUID_16];
- uint16_t *p_uuid16 = (uint16_t *)uuid_list;
- tBTA_SERVICE_MASK mask;
+extern const uint16_t bta_service_id_to_uuid_lkup_tbl[];
+void BTA_GetEirService(uint8_t* p_eir, tBTA_SERVICE_MASK* p_services) {
+ uint8_t xx, yy;
+ uint8_t num_uuid, max_num_uuid = 32;
+ uint8_t uuid_list[32 * LEN_UUID_16];
+ uint16_t* p_uuid16 = (uint16_t*)uuid_list;
+ tBTA_SERVICE_MASK mask;
- BTM_GetEirUuidList( p_eir, LEN_UUID_16, &num_uuid, uuid_list, max_num_uuid);
- for( xx = 0; xx < num_uuid; xx++ )
- {
- mask = 1;
- for( yy = 0; yy < BTA_MAX_SERVICE_ID; yy++ )
- {
- if( *(p_uuid16 + xx) == bta_service_id_to_uuid_lkup_tbl[yy] )
- {
- *p_services |= mask;
- break;
- }
- mask <<= 1;
- }
-
- /* for HSP v1.2 only device */
- if (*(p_uuid16 + xx) == UUID_SERVCLASS_HEADSET_HS)
- *p_services |= BTA_HSP_SERVICE_MASK;
-
- if (*(p_uuid16 + xx) == UUID_SERVCLASS_HDP_SOURCE)
- *p_services |= BTA_HL_SERVICE_MASK;
-
- if (*(p_uuid16 + xx) == UUID_SERVCLASS_HDP_SINK)
- *p_services |= BTA_HL_SERVICE_MASK;
+ BTM_GetEirUuidList(p_eir, LEN_UUID_16, &num_uuid, uuid_list, max_num_uuid);
+ for (xx = 0; xx < num_uuid; xx++) {
+ mask = 1;
+ for (yy = 0; yy < BTA_MAX_SERVICE_ID; yy++) {
+ if (*(p_uuid16 + xx) == bta_service_id_to_uuid_lkup_tbl[yy]) {
+ *p_services |= mask;
+ break;
+ }
+ mask <<= 1;
}
+
+ /* for HSP v1.2 only device */
+ if (*(p_uuid16 + xx) == UUID_SERVCLASS_HEADSET_HS)
+ *p_services |= BTA_HSP_SERVICE_MASK;
+
+ if (*(p_uuid16 + xx) == UUID_SERVCLASS_HDP_SOURCE)
+ *p_services |= BTA_HL_SERVICE_MASK;
+
+ if (*(p_uuid16 + xx) == UUID_SERVCLASS_HDP_SINK)
+ *p_services |= BTA_HL_SERVICE_MASK;
+ }
}
/*******************************************************************************
@@ -557,13 +534,11 @@
* Returns 0 if the device is NOT connected.
*
******************************************************************************/
-uint16_t BTA_DmGetConnectionState(const BD_ADDR bd_addr )
-{
- tBTA_DM_PEER_DEVICE * p_dev = bta_dm_find_peer_device(bd_addr);
- return (p_dev && p_dev->conn_state == BTA_DM_CONNECTED);
+uint16_t BTA_DmGetConnectionState(const BD_ADDR bd_addr) {
+ tBTA_DM_PEER_DEVICE* p_dev = bta_dm_find_peer_device(bd_addr);
+ return (p_dev && p_dev->conn_state == BTA_DM_CONNECTED);
}
-
/*******************************************************************************
* Device Identification (DI) Server Functions
******************************************************************************/
@@ -576,50 +551,47 @@
* Returns BTA_SUCCESS if record set sucessfully, otherwise error code.
*
******************************************************************************/
-tBTA_STATUS BTA_DmSetLocalDiRecord( tBTA_DI_RECORD *p_device_info,
- uint32_t *p_handle )
-{
- tBTA_STATUS status = BTA_FAILURE;
+tBTA_STATUS BTA_DmSetLocalDiRecord(tBTA_DI_RECORD* p_device_info,
+ uint32_t* p_handle) {
+ tBTA_STATUS status = BTA_FAILURE;
- if(bta_dm_di_cb.di_num < BTA_DI_NUM_MAX)
- {
- if(SDP_SetLocalDiRecord((tSDP_DI_RECORD *)p_device_info, p_handle) == SDP_SUCCESS)
- {
- if(!p_device_info->primary_record)
- {
- bta_dm_di_cb.di_handle[bta_dm_di_cb.di_num] = *p_handle;
- bta_dm_di_cb.di_num ++;
- }
+ if (bta_dm_di_cb.di_num < BTA_DI_NUM_MAX) {
+ if (SDP_SetLocalDiRecord((tSDP_DI_RECORD*)p_device_info, p_handle) ==
+ SDP_SUCCESS) {
+ if (!p_device_info->primary_record) {
+ bta_dm_di_cb.di_handle[bta_dm_di_cb.di_num] = *p_handle;
+ bta_dm_di_cb.di_num++;
+ }
- bta_sys_add_uuid(UUID_SERVCLASS_PNP_INFORMATION);
- status = BTA_SUCCESS;
- }
+ bta_sys_add_uuid(UUID_SERVCLASS_PNP_INFORMATION);
+ status = BTA_SUCCESS;
}
+ }
- return status;
+ return status;
}
/*******************************************************************************
*
* Function bta_dmexecutecallback
*
- * Description This function will request BTA to execute a call back in the context of BTU task
+ * Description This function will request BTA to execute a call back in the
+ *context of BTU task
* This API was named in lower case because it is only intended
* for the internal customers(like BTIF).
*
* Returns void
*
******************************************************************************/
-void bta_dmexecutecallback (tBTA_DM_EXEC_CBACK* p_callback, void * p_param)
-{
- tBTA_DM_API_EXECUTE_CBACK *p_msg =
- (tBTA_DM_API_EXECUTE_CBACK *)osi_malloc(sizeof(tBTA_DM_MSG));
+void bta_dmexecutecallback(tBTA_DM_EXEC_CBACK* p_callback, void* p_param) {
+ tBTA_DM_API_EXECUTE_CBACK* p_msg =
+ (tBTA_DM_API_EXECUTE_CBACK*)osi_malloc(sizeof(tBTA_DM_MSG));
- p_msg->hdr.event = BTA_DM_API_EXECUTE_CBACK_EVT;
- p_msg->p_param= p_param;
- p_msg->p_exec_cback= p_callback;
+ p_msg->hdr.event = BTA_DM_API_EXECUTE_CBACK_EVT;
+ p_msg->p_param = p_param;
+ p_msg->p_exec_cback = p_callback;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -638,19 +610,19 @@
* BTA_FAIL if operation failed.
*
******************************************************************************/
-void BTA_DmAddBleKey (BD_ADDR bd_addr, tBTA_LE_KEY_VALUE *p_le_key, tBTA_LE_KEY_TYPE key_type)
-{
+void BTA_DmAddBleKey(BD_ADDR bd_addr, tBTA_LE_KEY_VALUE* p_le_key,
+ tBTA_LE_KEY_TYPE key_type) {
#if (BLE_INCLUDED == TRUE)
- tBTA_DM_API_ADD_BLEKEY *p_msg =
- (tBTA_DM_API_ADD_BLEKEY *)osi_calloc(sizeof(tBTA_DM_API_ADD_BLEKEY));
+ tBTA_DM_API_ADD_BLEKEY* p_msg =
+ (tBTA_DM_API_ADD_BLEKEY*)osi_calloc(sizeof(tBTA_DM_API_ADD_BLEKEY));
- p_msg->hdr.event = BTA_DM_API_ADD_BLEKEY_EVT;
- p_msg->key_type = key_type;
- bdcpy(p_msg->bd_addr, bd_addr);
- memcpy(&p_msg->blekey, p_le_key, sizeof(tBTA_LE_KEY_VALUE));
+ p_msg->hdr.event = BTA_DM_API_ADD_BLEKEY_EVT;
+ p_msg->key_type = key_type;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ memcpy(&p_msg->blekey, p_le_key, sizeof(tBTA_LE_KEY_VALUE));
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#endif
}
@@ -669,18 +641,18 @@
* Returns void
*
******************************************************************************/
-void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type, tBT_DEVICE_TYPE dev_type)
-{
+void BTA_DmAddBleDevice(BD_ADDR bd_addr, tBLE_ADDR_TYPE addr_type,
+ tBT_DEVICE_TYPE dev_type) {
#if (BLE_INCLUDED == TRUE)
- tBTA_DM_API_ADD_BLE_DEVICE *p_msg =
- (tBTA_DM_API_ADD_BLE_DEVICE *)osi_calloc(sizeof(tBTA_DM_API_ADD_BLE_DEVICE));
+ tBTA_DM_API_ADD_BLE_DEVICE* p_msg = (tBTA_DM_API_ADD_BLE_DEVICE*)osi_calloc(
+ sizeof(tBTA_DM_API_ADD_BLE_DEVICE));
- p_msg->hdr.event = BTA_DM_API_ADD_BLEDEVICE_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->addr_type = addr_type;
- p_msg->dev_type = dev_type;
+ p_msg->hdr.event = BTA_DM_API_ADD_BLEDEVICE_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->addr_type = addr_type;
+ p_msg->dev_type = dev_type;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#endif
}
@@ -698,20 +670,18 @@
* Returns void
*
******************************************************************************/
-void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, bool accept, uint32_t passkey)
-{
+void BTA_DmBlePasskeyReply(BD_ADDR bd_addr, bool accept, uint32_t passkey) {
#if (BLE_INCLUDED == TRUE)
- tBTA_DM_API_PASSKEY_REPLY *p_msg =
- (tBTA_DM_API_PASSKEY_REPLY *)osi_calloc(sizeof(tBTA_DM_API_PASSKEY_REPLY));
+ tBTA_DM_API_PASSKEY_REPLY* p_msg =
+ (tBTA_DM_API_PASSKEY_REPLY*)osi_calloc(sizeof(tBTA_DM_API_PASSKEY_REPLY));
- p_msg->hdr.event = BTA_DM_API_BLE_PASSKEY_REPLY_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->accept = accept;
+ p_msg->hdr.event = BTA_DM_API_BLE_PASSKEY_REPLY_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->accept = accept;
- if (accept)
- p_msg->passkey = passkey;
+ if (accept) p_msg->passkey = passkey;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#endif
}
@@ -722,22 +692,22 @@
* Description Send BLE SMP SC user confirmation reply.
*
* Parameters: bd_addr - BD address of the peer
- * accept - numbers to compare are the same or different.
+ * accept - numbers to compare are the same or
+ *different.
*
* Returns void
*
******************************************************************************/
-void BTA_DmBleConfirmReply(BD_ADDR bd_addr, bool accept)
-{
+void BTA_DmBleConfirmReply(BD_ADDR bd_addr, bool accept) {
#if (BLE_INCLUDED == TRUE)
- tBTA_DM_API_CONFIRM *p_msg =
- (tBTA_DM_API_CONFIRM *)osi_calloc(sizeof(tBTA_DM_API_CONFIRM));
+ tBTA_DM_API_CONFIRM* p_msg =
+ (tBTA_DM_API_CONFIRM*)osi_calloc(sizeof(tBTA_DM_API_CONFIRM));
- p_msg->hdr.event = BTA_DM_API_BLE_CONFIRM_REPLY_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->accept = accept;
+ p_msg->hdr.event = BTA_DM_API_BLE_CONFIRM_REPLY_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->accept = accept;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#endif
}
@@ -753,17 +723,16 @@
* Returns void
*
******************************************************************************/
-void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res)
-{
+void BTA_DmBleSecurityGrant(BD_ADDR bd_addr, tBTA_DM_BLE_SEC_GRANT res) {
#if (BLE_INCLUDED == TRUE)
- tBTA_DM_API_BLE_SEC_GRANT *p_msg =
- (tBTA_DM_API_BLE_SEC_GRANT *)osi_calloc(sizeof(tBTA_DM_API_BLE_SEC_GRANT));
+ tBTA_DM_API_BLE_SEC_GRANT* p_msg =
+ (tBTA_DM_API_BLE_SEC_GRANT*)osi_calloc(sizeof(tBTA_DM_API_BLE_SEC_GRANT));
- p_msg->hdr.event = BTA_DM_API_BLE_SEC_GRANT_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->res = res;
+ p_msg->hdr.event = BTA_DM_API_BLE_SEC_GRANT_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->res = res;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#endif
}
@@ -786,22 +755,21 @@
* Returns void
*
******************************************************************************/
-void BTA_DmSetBlePrefConnParams(const BD_ADDR bd_addr,
- uint16_t min_conn_int, uint16_t max_conn_int,
- uint16_t slave_latency, uint16_t supervision_tout )
-{
+void BTA_DmSetBlePrefConnParams(const BD_ADDR bd_addr, uint16_t min_conn_int,
+ uint16_t max_conn_int, uint16_t slave_latency,
+ uint16_t supervision_tout) {
#if (BLE_INCLUDED == TRUE)
- tBTA_DM_API_BLE_CONN_PARAMS *p_msg =
- (tBTA_DM_API_BLE_CONN_PARAMS *)osi_calloc(sizeof(tBTA_DM_API_BLE_CONN_PARAMS));
+ tBTA_DM_API_BLE_CONN_PARAMS* p_msg = (tBTA_DM_API_BLE_CONN_PARAMS*)osi_calloc(
+ sizeof(tBTA_DM_API_BLE_CONN_PARAMS));
- p_msg->hdr.event = BTA_DM_API_BLE_CONN_PARAM_EVT;
- memcpy(p_msg->peer_bda, bd_addr, BD_ADDR_LEN);
- p_msg->conn_int_max = max_conn_int;
- p_msg->conn_int_min = min_conn_int;
- p_msg->slave_latency = slave_latency;
- p_msg->supervision_tout = supervision_tout;
+ p_msg->hdr.event = BTA_DM_API_BLE_CONN_PARAM_EVT;
+ memcpy(p_msg->peer_bda, bd_addr, BD_ADDR_LEN);
+ p_msg->conn_int_max = max_conn_int;
+ p_msg->conn_int_min = min_conn_int;
+ p_msg->slave_latency = slave_latency;
+ p_msg->supervision_tout = supervision_tout;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#endif
}
@@ -818,17 +786,16 @@
* Returns void
*
******************************************************************************/
-void BTA_DmSetBleConnScanParams(uint32_t scan_interval, uint32_t scan_window)
-{
+void BTA_DmSetBleConnScanParams(uint32_t scan_interval, uint32_t scan_window) {
#if (BLE_INCLUDED == TRUE)
- tBTA_DM_API_BLE_SCAN_PARAMS *p_msg =
- (tBTA_DM_API_BLE_SCAN_PARAMS *)osi_calloc(sizeof(tBTA_DM_API_BLE_SCAN_PARAMS));
+ tBTA_DM_API_BLE_SCAN_PARAMS* p_msg = (tBTA_DM_API_BLE_SCAN_PARAMS*)osi_calloc(
+ sizeof(tBTA_DM_API_BLE_SCAN_PARAMS));
- p_msg->hdr.event = BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT;
- p_msg->scan_int = scan_interval;
- p_msg->scan_window = scan_window;
+ p_msg->hdr.event = BTA_DM_API_BLE_CONN_SCAN_PARAM_EVT;
+ p_msg->scan_int = scan_interval;
+ p_msg->scan_window = scan_window;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#endif // BLE_INCLUDED == true
}
@@ -842,28 +809,29 @@
* scan_interval - scan interval
* scan_window - scan window
* scan_mode - scan mode
- * scan_param_setup_status_cback - Set scan param status callback
+ * scan_param_setup_status_cback - Set scan param status
+ *callback
*
* Returns void
*
******************************************************************************/
#if (BLE_INCLUDED == TRUE)
-void BTA_DmSetBleScanParams(tGATT_IF client_if, uint32_t scan_interval,
- uint32_t scan_window, tBLE_SCAN_MODE scan_mode,
- tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback)
-{
- tBTA_DM_API_BLE_SCAN_PARAMS *p_msg =
- (tBTA_DM_API_BLE_SCAN_PARAMS *)osi_calloc(sizeof(tBTA_DM_API_BLE_SCAN_PARAMS));
+void BTA_DmSetBleScanParams(
+ tGATT_IF client_if, uint32_t scan_interval, uint32_t scan_window,
+ tBLE_SCAN_MODE scan_mode,
+ tBLE_SCAN_PARAM_SETUP_CBACK scan_param_setup_cback) {
+ tBTA_DM_API_BLE_SCAN_PARAMS* p_msg = (tBTA_DM_API_BLE_SCAN_PARAMS*)osi_calloc(
+ sizeof(tBTA_DM_API_BLE_SCAN_PARAMS));
- p_msg->hdr.event = BTA_DM_API_BLE_SCAN_PARAM_EVT;
- p_msg->client_if = client_if;
- p_msg->scan_int = scan_interval;
- p_msg->scan_window = scan_window;
- p_msg->scan_mode = scan_mode;
- p_msg->scan_param_setup_cback = scan_param_setup_cback;
+ p_msg->hdr.event = BTA_DM_API_BLE_SCAN_PARAM_EVT;
+ p_msg->client_if = client_if;
+ p_msg->scan_int = scan_interval;
+ p_msg->scan_window = scan_window;
+ p_msg->scan_mode = scan_mode;
+ p_msg->scan_param_setup_cback = scan_param_setup_cback;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
#endif // BLE_INCLUDED == true
@@ -871,8 +839,10 @@
*
* Function BTA_DmSetBleAdvParams
*
- * Description This function sets the advertising parameters BLE functionality.
- * It is to be called when device act in peripheral or broadcaster
+ * Description This function sets the advertising parameters BLE
+ *functionality.
+ * It is to be called when device act in peripheral or
+ *broadcaster
* role.
*
*
@@ -880,18 +850,18 @@
*
******************************************************************************/
void BTA_DmSetBleAdvParams(uint16_t adv_int_min, uint16_t adv_int_max,
- tBLE_BD_ADDR *p_dir_bda)
-{
+ tBLE_BD_ADDR* p_dir_bda) {
#if (BLE_INCLUDED == TRUE)
- if (p_dir_bda != NULL) {
- tBLE_BD_ADDR *bda = new tBLE_BD_ADDR;
- memcpy(bda, p_dir_bda, sizeof(tBLE_BD_ADDR));
- do_in_bta_thread(FROM_HERE,
- base::Bind(&bta_dm_ble_set_adv_params, adv_int_min, adv_int_max, base::Owned(bda)));
- }
-
+ if (p_dir_bda != NULL) {
+ tBLE_BD_ADDR* bda = new tBLE_BD_ADDR;
+ memcpy(bda, p_dir_bda, sizeof(tBLE_BD_ADDR));
do_in_bta_thread(FROM_HERE,
- base::Bind(&bta_dm_ble_set_adv_params, adv_int_min, adv_int_max, nullptr));
+ base::Bind(&bta_dm_ble_set_adv_params, adv_int_min,
+ adv_int_max, base::Owned(bda)));
+ }
+
+ do_in_bta_thread(FROM_HERE, base::Bind(&bta_dm_ble_set_adv_params,
+ adv_int_min, adv_int_max, nullptr));
#endif
}
@@ -907,9 +877,12 @@
*
* Description This function is called to override the BTA scan response.
*
- * Parameters batch_scan_full_max -Max storage space (in %) allocated to full scanning
- * batch_scan_trunc_max -Max storage space (in %) allocated to truncated scanning
- * batch_scan_notify_threshold -Setup notification level based on total space
+ * Parameters batch_scan_full_max -Max storage space (in %) allocated to
+ *full scanning
+ * batch_scan_trunc_max -Max storage space (in %) allocated to
+ *truncated scanning
+ * batch_scan_notify_threshold -Setup notification level based
+ *on total space
* p_setup_cback - Setup callback pointer
* p_thres_cback - Threshold callback pointer
* p_rep_cback - Reports callback pointer
@@ -918,29 +891,28 @@
* Returns None
*
******************************************************************************/
-extern void BTA_DmBleSetStorageParams(uint8_t batch_scan_full_max,
- uint8_t batch_scan_trunc_max,
- uint8_t batch_scan_notify_threshold,
- tBTA_BLE_SCAN_SETUP_CBACK *p_setup_cback,
- tBTA_BLE_SCAN_THRESHOLD_CBACK *p_thres_cback,
- tBTA_BLE_SCAN_REP_CBACK* p_rep_cback,
- tBTA_DM_BLE_REF_VALUE ref_value)
-{
- tBTA_DM_API_SET_STORAGE_CONFIG *p_msg =
- (tBTA_DM_API_SET_STORAGE_CONFIG *)osi_malloc(sizeof(tBTA_DM_API_SET_STORAGE_CONFIG));
+extern void BTA_DmBleSetStorageParams(
+ uint8_t batch_scan_full_max, uint8_t batch_scan_trunc_max,
+ uint8_t batch_scan_notify_threshold,
+ tBTA_BLE_SCAN_SETUP_CBACK* p_setup_cback,
+ tBTA_BLE_SCAN_THRESHOLD_CBACK* p_thres_cback,
+ tBTA_BLE_SCAN_REP_CBACK* p_rep_cback, tBTA_DM_BLE_REF_VALUE ref_value) {
+ tBTA_DM_API_SET_STORAGE_CONFIG* p_msg =
+ (tBTA_DM_API_SET_STORAGE_CONFIG*)osi_malloc(
+ sizeof(tBTA_DM_API_SET_STORAGE_CONFIG));
- bta_dm_cb.p_setup_cback = p_setup_cback;
+ bta_dm_cb.p_setup_cback = p_setup_cback;
- p_msg->hdr.event = BTA_DM_API_BLE_SETUP_STORAGE_EVT;
- p_msg->p_setup_cback=bta_ble_scan_setup_cb;
- p_msg->p_thres_cback=p_thres_cback;
- p_msg->p_read_rep_cback=p_rep_cback;
- p_msg->ref_value = ref_value;
- p_msg->batch_scan_full_max = batch_scan_full_max;
- p_msg->batch_scan_trunc_max = batch_scan_trunc_max;
- p_msg->batch_scan_notify_threshold = batch_scan_notify_threshold;
+ p_msg->hdr.event = BTA_DM_API_BLE_SETUP_STORAGE_EVT;
+ p_msg->p_setup_cback = bta_ble_scan_setup_cb;
+ p_msg->p_thres_cback = p_thres_cback;
+ p_msg->p_read_rep_cback = p_rep_cback;
+ p_msg->ref_value = ref_value;
+ p_msg->batch_scan_full_max = batch_scan_full_max;
+ p_msg->batch_scan_trunc_max = batch_scan_trunc_max;
+ p_msg->batch_scan_notify_threshold = batch_scan_notify_threshold;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -960,23 +932,23 @@
*
******************************************************************************/
extern void BTA_DmBleEnableBatchScan(tBTA_BLE_BATCH_SCAN_MODE scan_mode,
- uint32_t scan_interval, uint32_t scan_window,
- tBTA_BLE_DISCARD_RULE discard_rule,
- tBLE_ADDR_TYPE addr_type,
- tBTA_DM_BLE_REF_VALUE ref_value)
-{
- tBTA_DM_API_ENABLE_SCAN *p_msg =
- (tBTA_DM_API_ENABLE_SCAN *)osi_malloc(sizeof(tBTA_DM_API_ENABLE_SCAN));
+ uint32_t scan_interval,
+ uint32_t scan_window,
+ tBTA_BLE_DISCARD_RULE discard_rule,
+ tBLE_ADDR_TYPE addr_type,
+ tBTA_DM_BLE_REF_VALUE ref_value) {
+ tBTA_DM_API_ENABLE_SCAN* p_msg =
+ (tBTA_DM_API_ENABLE_SCAN*)osi_malloc(sizeof(tBTA_DM_API_ENABLE_SCAN));
- p_msg->hdr.event = BTA_DM_API_BLE_ENABLE_BATCH_SCAN_EVT;
- p_msg->scan_mode = scan_mode;
- p_msg->scan_int = scan_interval;
- p_msg->scan_window = scan_window;
- p_msg->discard_rule = discard_rule;
- p_msg->addr_type = addr_type;
- p_msg->ref_value = ref_value;
+ p_msg->hdr.event = BTA_DM_API_BLE_ENABLE_BATCH_SCAN_EVT;
+ p_msg->scan_mode = scan_mode;
+ p_msg->scan_int = scan_interval;
+ p_msg->scan_window = scan_window;
+ p_msg->discard_rule = discard_rule;
+ p_msg->addr_type = addr_type;
+ p_msg->ref_value = ref_value;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -990,15 +962,14 @@
* Returns None
*
******************************************************************************/
-extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value)
-{
- tBTA_DM_API_DISABLE_SCAN *p_msg =
- (tBTA_DM_API_DISABLE_SCAN *)osi_malloc(sizeof(tBTA_DM_API_DISABLE_SCAN));
+extern void BTA_DmBleDisableBatchScan(tBTA_DM_BLE_REF_VALUE ref_value) {
+ tBTA_DM_API_DISABLE_SCAN* p_msg =
+ (tBTA_DM_API_DISABLE_SCAN*)osi_malloc(sizeof(tBTA_DM_API_DISABLE_SCAN));
- p_msg->hdr.event = BTA_DM_API_BLE_DISABLE_BATCH_SCAN_EVT;
- p_msg->ref_value = ref_value;
+ p_msg->hdr.event = BTA_DM_API_BLE_DISABLE_BATCH_SCAN_EVT;
+ p_msg->ref_value = ref_value;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -1014,16 +985,16 @@
*
******************************************************************************/
extern void BTA_DmBleReadScanReports(tBTA_BLE_BATCH_SCAN_MODE scan_type,
- tBTA_DM_BLE_REF_VALUE ref_value)
-{
- tBTA_DM_API_READ_SCAN_REPORTS *p_msg =
- (tBTA_DM_API_READ_SCAN_REPORTS *)osi_malloc(sizeof(tBTA_DM_API_READ_SCAN_REPORTS));
+ tBTA_DM_BLE_REF_VALUE ref_value) {
+ tBTA_DM_API_READ_SCAN_REPORTS* p_msg =
+ (tBTA_DM_API_READ_SCAN_REPORTS*)osi_malloc(
+ sizeof(tBTA_DM_API_READ_SCAN_REPORTS));
- p_msg->hdr.event = BTA_DM_API_BLE_READ_SCAN_REPORTS_EVT;
- p_msg->scan_type = scan_type;
- p_msg->ref_value = ref_value;
+ p_msg->hdr.event = BTA_DM_API_BLE_READ_SCAN_REPORTS_EVT;
+ p_msg->scan_type = scan_type;
+ p_msg->ref_value = ref_value;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -1038,17 +1009,18 @@
* Returns None
*
******************************************************************************/
-extern void BTA_DmBleTrackAdvertiser(tBTA_DM_BLE_REF_VALUE ref_value,
- tBTA_BLE_TRACK_ADV_CBACK *p_track_adv_cback)
-{
- tBTA_DM_API_TRACK_ADVERTISER *p_msg =
- (tBTA_DM_API_TRACK_ADVERTISER *)osi_malloc(sizeof(tBTA_DM_API_TRACK_ADVERTISER));
+extern void BTA_DmBleTrackAdvertiser(
+ tBTA_DM_BLE_REF_VALUE ref_value,
+ tBTA_BLE_TRACK_ADV_CBACK* p_track_adv_cback) {
+ tBTA_DM_API_TRACK_ADVERTISER* p_msg =
+ (tBTA_DM_API_TRACK_ADVERTISER*)osi_malloc(
+ sizeof(tBTA_DM_API_TRACK_ADVERTISER));
- p_msg->hdr.event = BTA_DM_API_BLE_TRACK_ADVERTISER_EVT;
- p_msg->p_track_adv_cback = p_track_adv_cback;
- p_msg->ref_value = ref_value;
+ p_msg->hdr.event = BTA_DM_API_BLE_TRACK_ADVERTISER_EVT;
+ p_msg->p_track_adv_cback = p_track_adv_cback;
+ p_msg->ref_value = ref_value;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
#endif
@@ -1064,24 +1036,27 @@
* Description This function is called to set BLE connectable mode for a
* peripheral device.
*
- * Parameters bg_conn_type: it can be auto connection, or selective connection.
- * p_select_cback: callback function when selective connection procedure
+ * Parameters bg_conn_type: it can be auto connection, or selective
+ *connection.
+ * p_select_cback: callback function when selective connection
+ *procedure
* is being used.
*
* Returns void
*
******************************************************************************/
-void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type, tBTA_DM_BLE_SEL_CBACK *p_select_cback)
-{
+void BTA_DmBleSetBgConnType(tBTA_DM_BLE_CONN_TYPE bg_conn_type,
+ tBTA_DM_BLE_SEL_CBACK* p_select_cback) {
#if (BLE_INCLUDED == TRUE)
- tBTA_DM_API_BLE_SET_BG_CONN_TYPE *p_msg =
- (tBTA_DM_API_BLE_SET_BG_CONN_TYPE *)osi_calloc(sizeof(tBTA_DM_API_BLE_SET_BG_CONN_TYPE));
+ tBTA_DM_API_BLE_SET_BG_CONN_TYPE* p_msg =
+ (tBTA_DM_API_BLE_SET_BG_CONN_TYPE*)osi_calloc(
+ sizeof(tBTA_DM_API_BLE_SET_BG_CONN_TYPE));
- p_msg->hdr.event = BTA_DM_API_BLE_SET_BG_CONN_TYPE;
- p_msg->bg_conn_type = bg_conn_type;
- p_msg->p_select_cback = p_select_cback;
+ p_msg->hdr.event = BTA_DM_API_BLE_SET_BG_CONN_TYPE;
+ p_msg->bg_conn_type = bg_conn_type;
+ p_msg->p_select_cback = p_select_cback;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#endif
}
@@ -1095,34 +1070,35 @@
*
******************************************************************************/
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
-static void bta_dm_discover_send_msg(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
- tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search,
- tBTA_TRANSPORT transport)
-{
- const size_t len = p_services ?
- (sizeof(tBTA_DM_API_DISCOVER) + sizeof(tBT_UUID) * p_services->num_uuid)
- : sizeof(tBTA_DM_API_DISCOVER);
- tBTA_DM_API_DISCOVER *p_msg = (tBTA_DM_API_DISCOVER *)osi_calloc(len);
+static void bta_dm_discover_send_msg(BD_ADDR bd_addr,
+ tBTA_SERVICE_MASK_EXT* p_services,
+ tBTA_DM_SEARCH_CBACK* p_cback,
+ bool sdp_search,
+ tBTA_TRANSPORT transport) {
+ const size_t len = p_services ? (sizeof(tBTA_DM_API_DISCOVER) +
+ sizeof(tBT_UUID) * p_services->num_uuid)
+ : sizeof(tBTA_DM_API_DISCOVER);
+ tBTA_DM_API_DISCOVER* p_msg = (tBTA_DM_API_DISCOVER*)osi_calloc(len);
- p_msg->hdr.event = BTA_DM_API_DISCOVER_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->p_cback = p_cback;
- p_msg->sdp_search = sdp_search;
- p_msg->transport = transport;
+ p_msg->hdr.event = BTA_DM_API_DISCOVER_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->p_cback = p_cback;
+ p_msg->sdp_search = sdp_search;
+ p_msg->transport = transport;
- if (p_services != NULL) {
+ if (p_services != NULL) {
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
- p_msg->services = p_services->srvc_mask;
- p_msg->num_uuid = p_services->num_uuid;
- if (p_services->num_uuid != 0) {
- p_msg->p_uuid = (tBT_UUID *)(p_msg + 1);
- memcpy(p_msg->p_uuid, p_services->p_uuid,
- sizeof(tBT_UUID) * p_services->num_uuid);
- }
-#endif
+ p_msg->services = p_services->srvc_mask;
+ p_msg->num_uuid = p_services->num_uuid;
+ if (p_services->num_uuid != 0) {
+ p_msg->p_uuid = (tBT_UUID*)(p_msg + 1);
+ memcpy(p_msg->p_uuid, p_services->p_uuid,
+ sizeof(tBT_UUID) * p_services->num_uuid);
}
+#endif
+ }
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
#endif
@@ -1142,16 +1118,15 @@
* Returns void
*
******************************************************************************/
-void BTA_DmDiscoverByTransport(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
- tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search,
- tBTA_TRANSPORT transport)
-{
+void BTA_DmDiscoverByTransport(BD_ADDR bd_addr,
+ tBTA_SERVICE_MASK_EXT* p_services,
+ tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search,
+ tBTA_TRANSPORT transport) {
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
- bta_dm_discover_send_msg(bd_addr, p_services, p_cback, sdp_search, transport);
+ bta_dm_discover_send_msg(bd_addr, p_services, p_cback, sdp_search, transport);
#endif
}
-
/*******************************************************************************
*
* Function BTA_DmDiscoverExt
@@ -1167,26 +1142,28 @@
* Returns void
*
******************************************************************************/
-void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT *p_services,
- tBTA_DM_SEARCH_CBACK *p_cback, bool sdp_search)
-{
+void BTA_DmDiscoverExt(BD_ADDR bd_addr, tBTA_SERVICE_MASK_EXT* p_services,
+ tBTA_DM_SEARCH_CBACK* p_cback, bool sdp_search) {
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
- bta_dm_discover_send_msg(bd_addr, p_services, p_cback, sdp_search, BTA_TRANSPORT_UNKNOWN);
+ bta_dm_discover_send_msg(bd_addr, p_services, p_cback, sdp_search,
+ BTA_TRANSPORT_UNKNOWN);
#endif
-
}
/*******************************************************************************
*
* Function BTA_DmSearchExt
*
- * Description This function searches for peer Bluetooth devices. It performs
+ * Description This function searches for peer Bluetooth devices. It
+ *performs
* an inquiry and gets the remote name for devices. Service
* discovery is done if services is non zero
*
* Parameters p_dm_inq: inquiry conditions
- * p_services: if service is not empty, service discovery will be done.
- * for all GATT based service condition, put num_uuid, and
+ * p_services: if service is not empty, service discovery will
+ *be done.
+ * for all GATT based service condition, put
+ *num_uuid, and
* p_uuid is the pointer to the list of UUID values.
* p_cback: callback functino when search is completed.
*
@@ -1196,49 +1173,50 @@
*
******************************************************************************/
#if (BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE)
-void BTA_DmSearchExt(tBTA_DM_INQ *p_dm_inq, tBTA_SERVICE_MASK_EXT *p_services, tBTA_DM_SEARCH_CBACK *p_cback)
-{
- const size_t len = p_services ?
- (sizeof(tBTA_DM_API_SEARCH) + sizeof(tBT_UUID) * p_services->num_uuid)
- : sizeof(tBTA_DM_API_SEARCH);
- tBTA_DM_API_SEARCH *p_msg = (tBTA_DM_API_SEARCH *)osi_calloc(len);
+void BTA_DmSearchExt(tBTA_DM_INQ* p_dm_inq, tBTA_SERVICE_MASK_EXT* p_services,
+ tBTA_DM_SEARCH_CBACK* p_cback) {
+ const size_t len = p_services ? (sizeof(tBTA_DM_API_SEARCH) +
+ sizeof(tBT_UUID) * p_services->num_uuid)
+ : sizeof(tBTA_DM_API_SEARCH);
+ tBTA_DM_API_SEARCH* p_msg = (tBTA_DM_API_SEARCH*)osi_calloc(len);
- p_msg->hdr.event = BTA_DM_API_SEARCH_EVT;
- memcpy(&p_msg->inq_params, p_dm_inq, sizeof(tBTA_DM_INQ));
- p_msg->p_cback = p_cback;
- p_msg->rs_res = BTA_DM_RS_NONE;
+ p_msg->hdr.event = BTA_DM_API_SEARCH_EVT;
+ memcpy(&p_msg->inq_params, p_dm_inq, sizeof(tBTA_DM_INQ));
+ p_msg->p_cback = p_cback;
+ p_msg->rs_res = BTA_DM_RS_NONE;
- if (p_services != NULL) {
- p_msg->services = p_services->srvc_mask;
- p_msg->num_uuid = p_services->num_uuid;
+ if (p_services != NULL) {
+ p_msg->services = p_services->srvc_mask;
+ p_msg->num_uuid = p_services->num_uuid;
- if (p_services->num_uuid != 0) {
- p_msg->p_uuid = (tBT_UUID *)(p_msg + 1);
- memcpy(p_msg->p_uuid, p_services->p_uuid,
- sizeof(tBT_UUID) * p_services->num_uuid);
- } else {
- p_msg->p_uuid = NULL;
- }
+ if (p_services->num_uuid != 0) {
+ p_msg->p_uuid = (tBT_UUID*)(p_msg + 1);
+ memcpy(p_msg->p_uuid, p_services->p_uuid,
+ sizeof(tBT_UUID) * p_services->num_uuid);
+ } else {
+ p_msg->p_uuid = NULL;
}
+ }
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
#else
-void BTA_DmSearchExt(UNUSED_ATTR tBTA_DM_INQ *p_dm_inq,
- UNUSED_ATTR tBTA_SERVICE_MASK_EXT *p_services,
- UNUSED_ATTR tBTA_DM_SEARCH_CBACK *p_cback)
-{
-}
+void BTA_DmSearchExt(UNUSED_ATTR tBTA_DM_INQ* p_dm_inq,
+ UNUSED_ATTR tBTA_SERVICE_MASK_EXT* p_services,
+ UNUSED_ATTR tBTA_DM_SEARCH_CBACK* p_cback) {}
#endif
/*******************************************************************************
*
* Function BTA_DmBleUpdateConnectionParam
*
- * Description Update connection parameters, can only be used when connection is up.
+ * Description Update connection parameters, can only be used when
+ *connection is up.
*
* Parameters: bd_addr - BD address of the peer
- * min_int - minimum connection interval, [0x0004~ 0x4000]
- * max_int - maximum connection interval, [0x0004~ 0x4000]
+ * min_int - minimum connection interval, [0x0004~
+ *0x4000]
+ * max_int - maximum connection interval, [0x0004~
+ *0x4000]
* latency - slave latency [0 ~ 500]
* timeout - supervision timeout [0x000a ~ 0xc80]
*
@@ -1247,20 +1225,20 @@
******************************************************************************/
void BTA_DmBleUpdateConnectionParam(BD_ADDR bd_addr, uint16_t min_int,
uint16_t max_int, uint16_t latency,
- uint16_t timeout)
-{
+ uint16_t timeout) {
#if (BLE_INCLUDED == TRUE)
- tBTA_DM_API_UPDATE_CONN_PARAM *p_msg =
- (tBTA_DM_API_UPDATE_CONN_PARAM *)osi_calloc(sizeof(tBTA_DM_API_UPDATE_CONN_PARAM));
+ tBTA_DM_API_UPDATE_CONN_PARAM* p_msg =
+ (tBTA_DM_API_UPDATE_CONN_PARAM*)osi_calloc(
+ sizeof(tBTA_DM_API_UPDATE_CONN_PARAM));
- p_msg->hdr.event = BTA_DM_API_UPDATE_CONN_PARAM_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->min_int = min_int;
- p_msg->max_int = max_int;
- p_msg->latency = latency;
- p_msg->timeout = timeout;
+ p_msg->hdr.event = BTA_DM_API_UPDATE_CONN_PARAM_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->min_int = min_int;
+ p_msg->max_int = max_int;
+ p_msg->latency = latency;
+ p_msg->timeout = timeout;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#endif
}
@@ -1275,18 +1253,17 @@
* Returns void
*
******************************************************************************/
-void BTA_DmBleConfigLocalPrivacy(bool privacy_enable)
-{
+void BTA_DmBleConfigLocalPrivacy(bool privacy_enable) {
#if (BLE_INCLUDED == TRUE && BLE_PRIVACY_SPT == TRUE)
- tBTA_DM_API_LOCAL_PRIVACY *p_msg =
- (tBTA_DM_API_LOCAL_PRIVACY *)osi_calloc(sizeof(tBTA_DM_API_ENABLE_PRIVACY));
+ tBTA_DM_API_LOCAL_PRIVACY* p_msg = (tBTA_DM_API_LOCAL_PRIVACY*)osi_calloc(
+ sizeof(tBTA_DM_API_ENABLE_PRIVACY));
- p_msg->hdr.event = BTA_DM_API_LOCAL_PRIVACY_EVT;
- p_msg->privacy_enable = privacy_enable;
+ p_msg->hdr.event = BTA_DM_API_LOCAL_PRIVACY_EVT;
+ p_msg->privacy_enable = privacy_enable;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
#else
- UNUSED (privacy_enable);
+ UNUSED(privacy_enable);
#endif
}
@@ -1295,7 +1272,8 @@
*
* Function BTA_DmBleCfgFilterCondition
*
- * Description This function is called to configure the adv data payload filter
+ * Description This function is called to configure the adv data payload
+ *filter
* condition.
*
* Parameters action: to read/write/clear
@@ -1312,120 +1290,115 @@
void BTA_DmBleCfgFilterCondition(tBTA_DM_BLE_SCAN_COND_OP action,
tBTA_DM_BLE_PF_COND_TYPE cond_type,
tBTA_DM_BLE_PF_FILT_INDEX filt_index,
- tBTA_DM_BLE_PF_COND_PARAM *p_cond,
- tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
- tBTA_DM_BLE_REF_VALUE ref_value)
-{
- tBTA_DM_API_CFG_FILTER_COND *p_msg;
- APPL_TRACE_API ("BTA_DmBleCfgFilterCondition: %d, %d", action, cond_type);
+ tBTA_DM_BLE_PF_COND_PARAM* p_cond,
+ tBTA_DM_BLE_PF_CFG_CBACK* p_cmpl_cback,
+ tBTA_DM_BLE_REF_VALUE ref_value) {
+ tBTA_DM_API_CFG_FILTER_COND* p_msg;
+ APPL_TRACE_API("BTA_DmBleCfgFilterCondition: %d, %d", action, cond_type);
- uint16_t len = sizeof(tBTA_DM_API_CFG_FILTER_COND) +
- sizeof(tBTA_DM_BLE_PF_COND_PARAM);
- uint8_t *p;
+ uint16_t len =
+ sizeof(tBTA_DM_API_CFG_FILTER_COND) + sizeof(tBTA_DM_BLE_PF_COND_PARAM);
+ uint8_t* p;
- if (NULL != p_cond)
- {
- switch(cond_type)
- {
- case BTA_DM_BLE_PF_SRVC_DATA_PATTERN:
- case BTA_DM_BLE_PF_MANU_DATA:
- /* Length of pattern and pattern mask and other elements in */
- /* tBTA_DM_BLE_PF_MANU_COND */
- len += ((p_cond->manu_data.data_len) * 2) +
- sizeof(uint16_t) + sizeof(uint16_t) + sizeof(uint8_t);
- break;
+ if (NULL != p_cond) {
+ switch (cond_type) {
+ case BTA_DM_BLE_PF_SRVC_DATA_PATTERN:
+ case BTA_DM_BLE_PF_MANU_DATA:
+ /* Length of pattern and pattern mask and other elements in */
+ /* tBTA_DM_BLE_PF_MANU_COND */
+ len += ((p_cond->manu_data.data_len) * 2) + sizeof(uint16_t) +
+ sizeof(uint16_t) + sizeof(uint8_t);
+ break;
- case BTA_DM_BLE_PF_LOCAL_NAME:
- len += ((p_cond->local_name.data_len) + sizeof(uint8_t));
- break;
+ case BTA_DM_BLE_PF_LOCAL_NAME:
+ len += ((p_cond->local_name.data_len) + sizeof(uint8_t));
+ break;
- case BTM_BLE_PF_SRVC_UUID:
- case BTM_BLE_PF_SRVC_SOL_UUID:
- len += sizeof(tBLE_BD_ADDR) + sizeof(tBTA_DM_BLE_PF_COND_MASK);
- break;
+ case BTM_BLE_PF_SRVC_UUID:
+ case BTM_BLE_PF_SRVC_SOL_UUID:
+ len += sizeof(tBLE_BD_ADDR) + sizeof(tBTA_DM_BLE_PF_COND_MASK);
+ break;
- default:
- break;
- }
+ default:
+ break;
}
+ }
- p_msg = (tBTA_DM_API_CFG_FILTER_COND *)osi_calloc(len);
- p_msg->hdr.event = BTA_DM_API_CFG_FILTER_COND_EVT;
- p_msg->action = action;
- p_msg->cond_type = cond_type;
- p_msg->filt_index = filt_index;
- p_msg->p_filt_cfg_cback = p_cmpl_cback;
- p_msg->ref_value = ref_value;
- if (p_cond) {
- p_msg->p_cond_param = (tBTA_DM_BLE_PF_COND_PARAM *)(p_msg + 1);
- memcpy(p_msg->p_cond_param, p_cond, sizeof(tBTA_DM_BLE_PF_COND_PARAM));
+ p_msg = (tBTA_DM_API_CFG_FILTER_COND*)osi_calloc(len);
+ p_msg->hdr.event = BTA_DM_API_CFG_FILTER_COND_EVT;
+ p_msg->action = action;
+ p_msg->cond_type = cond_type;
+ p_msg->filt_index = filt_index;
+ p_msg->p_filt_cfg_cback = p_cmpl_cback;
+ p_msg->ref_value = ref_value;
+ if (p_cond) {
+ p_msg->p_cond_param = (tBTA_DM_BLE_PF_COND_PARAM*)(p_msg + 1);
+ memcpy(p_msg->p_cond_param, p_cond, sizeof(tBTA_DM_BLE_PF_COND_PARAM));
- p = (uint8_t *)(p_msg->p_cond_param + 1);
+ p = (uint8_t*)(p_msg->p_cond_param + 1);
- if (cond_type == BTA_DM_BLE_PF_SRVC_DATA_PATTERN ||
- cond_type == BTA_DM_BLE_PF_MANU_DATA) {
- p_msg->p_cond_param->manu_data.p_pattern = p;
- p_msg->p_cond_param->manu_data.data_len = p_cond->manu_data.data_len;
- memcpy(p_msg->p_cond_param->manu_data.p_pattern, p_cond->manu_data.p_pattern,
- p_cond->manu_data.data_len);
- p += p_cond->manu_data.data_len;
+ if (cond_type == BTA_DM_BLE_PF_SRVC_DATA_PATTERN ||
+ cond_type == BTA_DM_BLE_PF_MANU_DATA) {
+ p_msg->p_cond_param->manu_data.p_pattern = p;
+ p_msg->p_cond_param->manu_data.data_len = p_cond->manu_data.data_len;
+ memcpy(p_msg->p_cond_param->manu_data.p_pattern,
+ p_cond->manu_data.p_pattern, p_cond->manu_data.data_len);
+ p += p_cond->manu_data.data_len;
- if (cond_type == BTA_DM_BLE_PF_MANU_DATA) {
- p_msg->p_cond_param->manu_data.company_id_mask =
- p_cond->manu_data.company_id_mask;
- if ( p_cond->manu_data.p_pattern_mask != NULL) {
- p_msg->p_cond_param->manu_data.p_pattern_mask = p;
- memcpy(p_msg->p_cond_param->manu_data.p_pattern_mask,
- p_cond->manu_data.p_pattern_mask,
- p_cond->manu_data.data_len);
- }
- }
- } else if (cond_type == BTA_DM_BLE_PF_LOCAL_NAME) {
- p_msg->p_cond_param->local_name.p_data = p;
- p_msg->p_cond_param->local_name.data_len =
- p_cond->local_name.data_len;
- memcpy(p_msg->p_cond_param->local_name.p_data,
- p_cond->local_name.p_data, p_cond->local_name.data_len);
- } else if (cond_type == BTM_BLE_PF_SRVC_UUID ||
- cond_type == BTM_BLE_PF_SRVC_SOL_UUID) {
- if (p_cond->srvc_uuid.p_target_addr != NULL) {
- p_msg->p_cond_param->srvc_uuid.p_target_addr = (tBLE_BD_ADDR *)(p);
- p_msg->p_cond_param->srvc_uuid.p_target_addr->type =
- p_cond->srvc_uuid.p_target_addr->type;
- memcpy(p_msg->p_cond_param->srvc_uuid.p_target_addr->bda,
- p_cond->srvc_uuid.p_target_addr->bda, BD_ADDR_LEN);
- p = (uint8_t *)(p_msg->p_cond_param->srvc_uuid.p_target_addr + 1);
- }
- if (p_cond->srvc_uuid.p_uuid_mask) {
- p_msg->p_cond_param->srvc_uuid.p_uuid_mask = (tBTA_DM_BLE_PF_COND_MASK *)p;
- memcpy(p_msg->p_cond_param->srvc_uuid.p_uuid_mask,
- p_cond->srvc_uuid.p_uuid_mask,
- sizeof(tBTA_DM_BLE_PF_COND_MASK));
- }
+ if (cond_type == BTA_DM_BLE_PF_MANU_DATA) {
+ p_msg->p_cond_param->manu_data.company_id_mask =
+ p_cond->manu_data.company_id_mask;
+ if (p_cond->manu_data.p_pattern_mask != NULL) {
+ p_msg->p_cond_param->manu_data.p_pattern_mask = p;
+ memcpy(p_msg->p_cond_param->manu_data.p_pattern_mask,
+ p_cond->manu_data.p_pattern_mask, p_cond->manu_data.data_len);
}
+ }
+ } else if (cond_type == BTA_DM_BLE_PF_LOCAL_NAME) {
+ p_msg->p_cond_param->local_name.p_data = p;
+ p_msg->p_cond_param->local_name.data_len = p_cond->local_name.data_len;
+ memcpy(p_msg->p_cond_param->local_name.p_data, p_cond->local_name.p_data,
+ p_cond->local_name.data_len);
+ } else if (cond_type == BTM_BLE_PF_SRVC_UUID ||
+ cond_type == BTM_BLE_PF_SRVC_SOL_UUID) {
+ if (p_cond->srvc_uuid.p_target_addr != NULL) {
+ p_msg->p_cond_param->srvc_uuid.p_target_addr = (tBLE_BD_ADDR*)(p);
+ p_msg->p_cond_param->srvc_uuid.p_target_addr->type =
+ p_cond->srvc_uuid.p_target_addr->type;
+ memcpy(p_msg->p_cond_param->srvc_uuid.p_target_addr->bda,
+ p_cond->srvc_uuid.p_target_addr->bda, BD_ADDR_LEN);
+ p = (uint8_t*)(p_msg->p_cond_param->srvc_uuid.p_target_addr + 1);
+ }
+ if (p_cond->srvc_uuid.p_uuid_mask) {
+ p_msg->p_cond_param->srvc_uuid.p_uuid_mask =
+ (tBTA_DM_BLE_PF_COND_MASK*)p;
+ memcpy(p_msg->p_cond_param->srvc_uuid.p_uuid_mask,
+ p_cond->srvc_uuid.p_uuid_mask, sizeof(tBTA_DM_BLE_PF_COND_MASK));
+ }
}
+ }
- bta_sys_sendmsg(p_msg);
-
+ bta_sys_sendmsg(p_msg);
}
#else
-void BTA_DmBleCfgFilterCondition(UNUSED_ATTR tBTA_DM_BLE_SCAN_COND_OP action,
- UNUSED_ATTR tBTA_DM_BLE_PF_COND_TYPE cond_type,
- UNUSED_ATTR tBTA_DM_BLE_PF_FILT_INDEX filt_index,
- UNUSED_ATTR tBTA_DM_BLE_PF_COND_PARAM *p_cond,
- UNUSED_ATTR tBTA_DM_BLE_PF_CFG_CBACK *p_cmpl_cback,
- UNUSED_ATTR tBTA_DM_BLE_REF_VALUE ref_value)
-{
-}
+void BTA_DmBleCfgFilterCondition(
+ UNUSED_ATTR tBTA_DM_BLE_SCAN_COND_OP action,
+ UNUSED_ATTR tBTA_DM_BLE_PF_COND_TYPE cond_type,
+ UNUSED_ATTR tBTA_DM_BLE_PF_FILT_INDEX filt_index,
+ UNUSED_ATTR tBTA_DM_BLE_PF_COND_PARAM* p_cond,
+ UNUSED_ATTR tBTA_DM_BLE_PF_CFG_CBACK* p_cmpl_cback,
+ UNUSED_ATTR tBTA_DM_BLE_REF_VALUE ref_value) {}
#endif
/*******************************************************************************
*
* Function BTA_DmBleScanFilterSetup
*
- * Description This function is called to setup the adv data payload filter param
+ * Description This function is called to setup the adv data payload filter
+ *param
*
- * Parameters p_target: enable the filter condition on a target device; if NULL
+ * Parameters p_target: enable the filter condition on a target device; if
+ *NULL
* filt_index - Filter index
* p_filt_params -Filter parameters
* ref_value - Reference value
@@ -1438,42 +1411,42 @@
#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
void BTA_DmBleScanFilterSetup(uint8_t action,
tBTA_DM_BLE_PF_FILT_INDEX filt_index,
- tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params,
- tBLE_BD_ADDR *p_target,
- tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback,
- tBTA_DM_BLE_REF_VALUE ref_value)
-{
- const size_t len = sizeof(tBTA_DM_API_SCAN_FILTER_PARAM_SETUP) +
- sizeof(tBLE_BD_ADDR);
- tBTA_DM_API_SCAN_FILTER_PARAM_SETUP *p_msg =
- (tBTA_DM_API_SCAN_FILTER_PARAM_SETUP *)osi_calloc(len);
+ tBTA_DM_BLE_PF_FILT_PARAMS* p_filt_params,
+ tBLE_BD_ADDR* p_target,
+ tBTA_DM_BLE_PF_PARAM_CBACK* p_cmpl_cback,
+ tBTA_DM_BLE_REF_VALUE ref_value) {
+ const size_t len =
+ sizeof(tBTA_DM_API_SCAN_FILTER_PARAM_SETUP) + sizeof(tBLE_BD_ADDR);
+ tBTA_DM_API_SCAN_FILTER_PARAM_SETUP* p_msg =
+ (tBTA_DM_API_SCAN_FILTER_PARAM_SETUP*)osi_calloc(len);
- APPL_TRACE_API("%s: %d", __func__, action);
+ APPL_TRACE_API("%s: %d", __func__, action);
- p_msg->hdr.event = BTA_DM_API_SCAN_FILTER_SETUP_EVT;
- p_msg->action = action;
- p_msg->filt_index = filt_index;
- if (p_filt_params) {
- memcpy(&p_msg->filt_params, p_filt_params,
- sizeof(tBTA_DM_BLE_PF_FILT_PARAMS));
- }
- p_msg->p_filt_param_cback = p_cmpl_cback;
- p_msg->ref_value = ref_value;
+ p_msg->hdr.event = BTA_DM_API_SCAN_FILTER_SETUP_EVT;
+ p_msg->action = action;
+ p_msg->filt_index = filt_index;
+ if (p_filt_params) {
+ memcpy(&p_msg->filt_params, p_filt_params,
+ sizeof(tBTA_DM_BLE_PF_FILT_PARAMS));
+ }
+ p_msg->p_filt_param_cback = p_cmpl_cback;
+ p_msg->ref_value = ref_value;
- if (p_target) {
- p_msg->p_target = (tBLE_BD_ADDR *)(p_msg + 1);
- memcpy(p_msg->p_target, p_target, sizeof(tBLE_BD_ADDR));
- }
+ if (p_target) {
+ p_msg->p_target = (tBLE_BD_ADDR*)(p_msg + 1);
+ memcpy(p_msg->p_target, p_target, sizeof(tBLE_BD_ADDR));
+ }
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
#else
-void BTA_DmBleScanFilterSetup(UNUSED_ATTR uint8_t action,
- UNUSED_ATTR tBTA_DM_BLE_PF_FILT_INDEX filt_index,
- UNUSED_ATTR tBTA_DM_BLE_PF_FILT_PARAMS *p_filt_params,
- UNUSED_ATTR tBLE_BD_ADDR *p_target,
- UNUSED_ATTR tBTA_DM_BLE_PF_PARAM_CBACK *p_cmpl_cback,
- UNUSED_ATTR tBTA_DM_BLE_REF_VALUE ref_value)
+void BTA_DmBleScanFilterSetup(
+ UNUSED_ATTR uint8_t action,
+ UNUSED_ATTR tBTA_DM_BLE_PF_FILT_INDEX filt_index,
+ UNUSED_ATTR tBTA_DM_BLE_PF_FILT_PARAMS* p_filt_params,
+ UNUSED_ATTR tBLE_BD_ADDR* p_target,
+ UNUSED_ATTR tBTA_DM_BLE_PF_PARAM_CBACK* p_cmpl_cback,
+ UNUSED_ATTR tBTA_DM_BLE_REF_VALUE ref_value)
}
#endif
@@ -1488,24 +1461,24 @@
* Returns void
*
******************************************************************************/
-void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK *p_cmpl_cback)
-{
- const size_t len = sizeof(tBTA_DM_API_ENERGY_INFO) + sizeof(tBLE_BD_ADDR);
- tBTA_DM_API_ENERGY_INFO *p_msg = (tBTA_DM_API_ENERGY_INFO *)osi_calloc(len);
+void BTA_DmBleGetEnergyInfo(tBTA_BLE_ENERGY_INFO_CBACK* p_cmpl_cback) {
+ const size_t len = sizeof(tBTA_DM_API_ENERGY_INFO) + sizeof(tBLE_BD_ADDR);
+ tBTA_DM_API_ENERGY_INFO* p_msg = (tBTA_DM_API_ENERGY_INFO*)osi_calloc(len);
- APPL_TRACE_API("%s", __func__);
+ APPL_TRACE_API("%s", __func__);
- p_msg->hdr.event = BTA_DM_API_BLE_ENERGY_INFO_EVT;
- p_msg->p_energy_info_cback = p_cmpl_cback;
+ p_msg->hdr.event = BTA_DM_API_BLE_ENERGY_INFO_EVT;
+ p_msg->p_energy_info_cback = p_cmpl_cback;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
*
* Function BTA_DmEnableScanFilter
*
- * Description This function is called to enable the adv data payload filter
+ * Description This function is called to enable the adv data payload
+ *filter
*
* Parameters action - enable or disable the APCF feature
* p_cmpl_cback - Command completed callback
@@ -1515,61 +1488,63 @@
*
******************************************************************************/
#if (BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
-void BTA_DmEnableScanFilter(uint8_t action, tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
- tBTA_DM_BLE_REF_VALUE ref_value)
-{
- const size_t len = sizeof(tBTA_DM_API_ENABLE_SCAN_FILTER) +
- sizeof(tBLE_BD_ADDR);
- tBTA_DM_API_ENABLE_SCAN_FILTER *p_msg =
- (tBTA_DM_API_ENABLE_SCAN_FILTER *)osi_calloc(len);
+void BTA_DmEnableScanFilter(uint8_t action,
+ tBTA_DM_BLE_PF_STATUS_CBACK* p_cmpl_cback,
+ tBTA_DM_BLE_REF_VALUE ref_value) {
+ const size_t len =
+ sizeof(tBTA_DM_API_ENABLE_SCAN_FILTER) + sizeof(tBLE_BD_ADDR);
+ tBTA_DM_API_ENABLE_SCAN_FILTER* p_msg =
+ (tBTA_DM_API_ENABLE_SCAN_FILTER*)osi_calloc(len);
- APPL_TRACE_API("%s: %d", __func__, action);
+ APPL_TRACE_API("%s: %d", __func__, action);
- p_msg->hdr.event = BTA_DM_API_SCAN_FILTER_ENABLE_EVT;
- p_msg->action = action;
- p_msg->ref_value = ref_value;
- p_msg->p_filt_status_cback = p_cmpl_cback;
+ p_msg->hdr.event = BTA_DM_API_SCAN_FILTER_ENABLE_EVT;
+ p_msg->action = action;
+ p_msg->ref_value = ref_value;
+ p_msg->p_filt_status_cback = p_cmpl_cback;
- bta_sys_sendmsg(p_msg);
-
+ bta_sys_sendmsg(p_msg);
}
#else
-void BTA_DmEnableScanFilter(UNUSED_ATTR uint8_t action,
- UNUSED_ATTR tBTA_DM_BLE_PF_STATUS_CBACK *p_cmpl_cback,
- UNUSED_ATTR tBTA_DM_BLE_REF_VALUE ref_value)
-{
-}
+void BTA_DmEnableScanFilter(
+ UNUSED_ATTR uint8_t action,
+ UNUSED_ATTR tBTA_DM_BLE_PF_STATUS_CBACK* p_cmpl_cback,
+ UNUSED_ATTR tBTA_DM_BLE_REF_VALUE ref_value) {}
#endif
/*******************************************************************************
*
* Function BTA_DmBleUpdateConnectionParams
*
- * Description Update connection parameters, can only be used when connection is up.
+ * Description Update connection parameters, can only be used when
+ *connection is up.
*
* Parameters: bd_addr - BD address of the peer
- * min_int - minimum connection interval, [0x0004~ 0x4000]
- * max_int - maximum connection interval, [0x0004~ 0x4000]
+ * min_int - minimum connection interval, [0x0004~
+ *0x4000]
+ * max_int - maximum connection interval, [0x0004~
+ *0x4000]
* latency - slave latency [0 ~ 500]
* timeout - supervision timeout [0x000a ~ 0xc80]
*
* Returns void
*
******************************************************************************/
-void BTA_DmBleUpdateConnectionParams(const BD_ADDR bd_addr, uint16_t min_int, uint16_t max_int,
- uint16_t latency, uint16_t timeout)
-{
- tBTA_DM_API_UPDATE_CONN_PARAM *p_msg =
- (tBTA_DM_API_UPDATE_CONN_PARAM *)osi_calloc(sizeof(tBTA_DM_API_UPDATE_CONN_PARAM));
+void BTA_DmBleUpdateConnectionParams(const BD_ADDR bd_addr, uint16_t min_int,
+ uint16_t max_int, uint16_t latency,
+ uint16_t timeout) {
+ tBTA_DM_API_UPDATE_CONN_PARAM* p_msg =
+ (tBTA_DM_API_UPDATE_CONN_PARAM*)osi_calloc(
+ sizeof(tBTA_DM_API_UPDATE_CONN_PARAM));
- p_msg->hdr.event = BTA_DM_API_UPDATE_CONN_PARAM_EVT;
- bdcpy(p_msg->bd_addr, bd_addr);
- p_msg->min_int = min_int;
- p_msg->max_int = max_int;
- p_msg->latency = latency;
- p_msg->timeout = timeout;
+ p_msg->hdr.event = BTA_DM_API_UPDATE_CONN_PARAM_EVT;
+ bdcpy(p_msg->bd_addr, bd_addr);
+ p_msg->min_int = min_int;
+ p_msg->max_int = max_int;
+ p_msg->latency = latency;
+ p_msg->timeout = timeout;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -1582,16 +1557,16 @@
*
*
******************************************************************************/
-void BTA_DmBleSetDataLength(BD_ADDR remote_device, uint16_t tx_data_length)
-{
- tBTA_DM_API_BLE_SET_DATA_LENGTH *p_msg =
- (tBTA_DM_API_BLE_SET_DATA_LENGTH *)osi_malloc(sizeof(tBTA_DM_API_BLE_SET_DATA_LENGTH));
+void BTA_DmBleSetDataLength(BD_ADDR remote_device, uint16_t tx_data_length) {
+ tBTA_DM_API_BLE_SET_DATA_LENGTH* p_msg =
+ (tBTA_DM_API_BLE_SET_DATA_LENGTH*)osi_malloc(
+ sizeof(tBTA_DM_API_BLE_SET_DATA_LENGTH));
- bdcpy(p_msg->remote_bda, remote_device);
- p_msg->hdr.event = BTA_DM_API_SET_DATA_LENGTH_EVT;
- p_msg->tx_data_length = tx_data_length;
+ bdcpy(p_msg->remote_bda, remote_device);
+ p_msg->hdr.event = BTA_DM_API_SET_DATA_LENGTH_EVT;
+ p_msg->tx_data_length = tx_data_length;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
#endif
@@ -1610,35 +1585,39 @@
* p_callback - Pointer to callback function to indicat the
* link encryption status
* sec_act - This is the security action to indicate
- * what knid of BLE security level is required for
+ * what knid of BLE security level is required
+ *for
* the BLE link if the BLE is supported
- * Note: This parameter is ignored for the BR/EDR link
+ * Note: This parameter is ignored for the
+ *BR/EDR link
* or the BLE is not supported
*
* Returns void
*
******************************************************************************/
-void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport, tBTA_DM_ENCRYPT_CBACK *p_callback,
- tBTA_DM_BLE_SEC_ACT sec_act)
-{
- tBTA_DM_API_SET_ENCRYPTION *p_msg = (tBTA_DM_API_SET_ENCRYPTION *)osi_calloc(sizeof(tBTA_DM_API_SET_ENCRYPTION));
+void BTA_DmSetEncryption(BD_ADDR bd_addr, tBTA_TRANSPORT transport,
+ tBTA_DM_ENCRYPT_CBACK* p_callback,
+ tBTA_DM_BLE_SEC_ACT sec_act) {
+ tBTA_DM_API_SET_ENCRYPTION* p_msg = (tBTA_DM_API_SET_ENCRYPTION*)osi_calloc(
+ sizeof(tBTA_DM_API_SET_ENCRYPTION));
- APPL_TRACE_API("%s", __func__);
+ APPL_TRACE_API("%s", __func__);
- p_msg->hdr.event = BTA_DM_API_SET_ENCRYPTION_EVT;
- memcpy(p_msg->bd_addr, bd_addr, BD_ADDR_LEN);
- p_msg->transport = transport;
- p_msg->p_callback = p_callback;
- p_msg->sec_act = sec_act;
+ p_msg->hdr.event = BTA_DM_API_SET_ENCRYPTION_EVT;
+ memcpy(p_msg->bd_addr, bd_addr, BD_ADDR_LEN);
+ p_msg->transport = transport;
+ p_msg->p_callback = p_callback;
+ p_msg->sec_act = sec_act;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
*
* Function BTA_DmCloseACL
*
- * Description This function force to close an ACL connection and remove the
+ * Description This function force to close an ACL connection and remove
+ *the
* device from the security database list of known devices.
*
* Parameters: bd_addr - Address of the peer device
@@ -1647,19 +1626,19 @@
* Returns void
*
******************************************************************************/
-void BTA_DmCloseACL(BD_ADDR bd_addr, bool remove_dev, tBTA_TRANSPORT transport)
-{
- tBTA_DM_API_REMOVE_ACL *p_msg =
- (tBTA_DM_API_REMOVE_ACL *)osi_calloc(sizeof(tBTA_DM_API_REMOVE_ACL));
+void BTA_DmCloseACL(BD_ADDR bd_addr, bool remove_dev,
+ tBTA_TRANSPORT transport) {
+ tBTA_DM_API_REMOVE_ACL* p_msg =
+ (tBTA_DM_API_REMOVE_ACL*)osi_calloc(sizeof(tBTA_DM_API_REMOVE_ACL));
- APPL_TRACE_API("%s", __func__);
+ APPL_TRACE_API("%s", __func__);
- p_msg->hdr.event = BTA_DM_API_REMOVE_ACL_EVT;
- memcpy(p_msg->bd_addr, bd_addr, BD_ADDR_LEN);
- p_msg->remove_dev = remove_dev;
- p_msg->transport = transport;
+ p_msg->hdr.event = BTA_DM_API_REMOVE_ACL_EVT;
+ memcpy(p_msg->bd_addr, bd_addr, BD_ADDR_LEN);
+ p_msg->remove_dev = remove_dev;
+ p_msg->transport = transport;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
#if (BLE_INCLUDED == TRUE)
@@ -1679,19 +1658,18 @@
*
******************************************************************************/
extern void BTA_DmBleObserve(bool start, uint8_t duration,
- tBTA_DM_SEARCH_CBACK *p_results_cb)
-{
- tBTA_DM_API_BLE_OBSERVE *p_msg =
- (tBTA_DM_API_BLE_OBSERVE *)osi_calloc(sizeof(tBTA_DM_API_BLE_OBSERVE));
+ tBTA_DM_SEARCH_CBACK* p_results_cb) {
+ tBTA_DM_API_BLE_OBSERVE* p_msg =
+ (tBTA_DM_API_BLE_OBSERVE*)osi_calloc(sizeof(tBTA_DM_API_BLE_OBSERVE));
- APPL_TRACE_API("%s:start = %d ", __func__, start);
+ APPL_TRACE_API("%s:start = %d ", __func__, start);
- p_msg->hdr.event = BTA_DM_API_BLE_OBSERVE_EVT;
- p_msg->start = start;
- p_msg->duration = duration;
- p_msg->p_cback = p_results_cb;
+ p_msg->hdr.event = BTA_DM_API_BLE_OBSERVE_EVT;
+ p_msg->start = start;
+ p_msg->duration = duration;
+ p_msg->p_cback = p_results_cb;
- bta_sys_sendmsg(p_msg);
+ bta_sys_sendmsg(p_msg);
}
/*******************************************************************************
@@ -1703,40 +1681,34 @@
* Returns void
*
******************************************************************************/
-void BTA_VendorInit (void)
-{
- APPL_TRACE_API("BTA_VendorInit");
-}
+void BTA_VendorInit(void) { APPL_TRACE_API("BTA_VendorInit"); }
/*******************************************************************************
*
* Function BTA_VendorCleanup
*
- * Description This function frees up Broadcom specific VS specific dynamic memory
+ * Description This function frees up Broadcom specific VS specific dynamic
+ *memory
*
* Returns void
*
******************************************************************************/
-void BTA_VendorCleanup (void)
-{
- tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
- BTM_BleGetVendorCapabilities(&cmn_ble_vsc_cb);
+void BTA_VendorCleanup(void) {
+ tBTM_BLE_VSC_CB cmn_ble_vsc_cb;
+ BTM_BleGetVendorCapabilities(&cmn_ble_vsc_cb);
#if (BLE_INCLUDED == TRUE && BLE_ANDROID_CONTROLLER_SCAN_FILTER == TRUE)
- if (cmn_ble_vsc_cb.max_filter > 0)
- {
- btm_ble_adv_filter_cleanup();
+ if (cmn_ble_vsc_cb.max_filter > 0) {
+ btm_ble_adv_filter_cleanup();
#if (BLE_PRIVACY_SPT == TRUE)
- btm_ble_resolving_list_cleanup ();
+ btm_ble_resolving_list_cleanup();
#endif
- }
+ }
- if (cmn_ble_vsc_cb.tot_scan_results_strg > 0)
- btm_ble_batchscan_cleanup();
+ if (cmn_ble_vsc_cb.tot_scan_results_strg > 0) btm_ble_batchscan_cleanup();
#endif
- if(cmn_ble_vsc_cb.adv_inst_max > 0)
- btm_ble_multi_adv_cleanup();
+ if (cmn_ble_vsc_cb.adv_inst_max > 0) btm_ble_multi_adv_cleanup();
}
#endif