Lines Matching full:p_data
65 static void bta_dm_bl_change_cback (tBTM_BL_EVENT_DATA *p_data);
70 static UINT8 bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data);
93 static UINT8 bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_DATA *p_data);
100 static void bta_dm_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC *p_data);
260 void bta_dm_enable(tBTA_DM_MSG *p_data)
270 if (p_data->enable.p_sec_cback != NULL)
271 p_data->enable.p_sec_cback(BTA_DM_ENABLE_EVT, (tBTA_DM_SEC *)&enable_event);
280 if( p_data->enable.p_sec_cback != NULL )
281 bta_dm_cb.p_sec_cback = p_data->enable.p_sec_cback;
466 void bta_dm_disable (tBTA_DM_MSG *p_data)
468 UNUSED(p_data);
575 void bta_dm_set_dev_name (tBTA_DM_MSG *p_data)
578 BTM_SetLocalDeviceName((char*)p_data->set_name.name);
579 bta_dm_set_eir ((char*)p_data->set_name.name);
592 void bta_dm_set_visibility(tBTA_DM_MSG *p_data)
603 if (p_data->set_visibility.disc_mode != (BTA_DM_IGNORE | BTA_DM_LE_IGNORE))
606 if ((p_data->set_visibility.disc_mode & BTA_DM_LE_IGNORE) == BTA_DM_LE_IGNORE)
607 p_data->set_visibility.disc_mode =
608 ((p_data->set_visibility.disc_mode & ~BTA_DM_LE_IGNORE) | le_disc_mode);
610 if ((p_data->set_visibility.disc_mode & BTA_DM_IGNORE) == BTA_DM_IGNORE)
611 p_data->set_visibility.disc_mode =
612 ((p_data->set_visibility.disc_mode & ~BTA_DM_IGNORE) | disc_mode);
614 BTM_SetDiscoverability(p_data->set_visibility.disc_mode,
619 if (p_data->set_visibility.conn_mode != (BTA_DM_IGNORE | BTA_DM_LE_IGNORE))
622 if ((p_data->set_visibility.conn_mode & BTA_DM_LE_IGNORE) == BTA_DM_LE_IGNORE)
623 p_data->set_visibility.conn_mode =
624 ((p_data->set_visibility.conn_mode & ~BTA_DM_LE_IGNORE) | le_conn_mode);
626 if ((p_data->set_visibility.conn_mode & BTA_DM_IGNORE) == BTA_DM_IGNORE)
627 p_data->set_visibility.conn_mode =
628 ((p_data->set_visibility.conn_mode & ~BTA_DM_IGNORE) | conn_mode);
630 BTM_SetConnectability(p_data->set_visibility.conn_mode,
636 if (p_data->set_visibility.pair_mode != BTA_DM_IGNORE )
639 if (p_data->set_visibility.pair_mode == BTA_DM_NON_PAIRABLE)
647 if (p_data->set_visibility.conn_paired_only != BTA_DM_IGNORE)
650 if (p_data->set_visibility.conn_paired_only == BTA_DM_CONN_ALL)
658 if (p_data->set_visibility.pair_mode != BTA_DM_IGNORE || p_data->set_visibility.conn_paired_only != BTA_DM_IGNORE)
701 void bta_dm_remove_device(tBTA_DM_MSG *p_data)
703 tBTA_DM_API_REMOVE_DEVICE *p_dev = &p_data->remove_dev;
796 void bta_dm_add_device (tBTA_DM_MSG *p_data)
798 tBTA_DM_API_ADD_DEVICE *p_dev = &p_data->add_dev;
851 void bta_dm_close_acl(tBTA_DM_MSG *p_data)
853 tBTA_DM_API_REMOVE_ACL *p_remove_acl = &p_data->remove_acl;
902 void bta_dm_remove_all_acl(tBTA_DM_MSG *p_data)
904 const tBTA_DM_LINK_TYPE link_type = p_data->remove_all_acl.link_type;
937 void bta_dm_bond (tBTA_DM_MSG *p_data)
943 if (p_data->bond.transport == BTA_TRANSPORT_UNKNOWN)
944 status = BTM_SecBond ( p_data->bond.bd_addr, 0, NULL, 0 );
946 status = BTM_SecBondByTransport ( p_data->bond.bd_addr, p_data->bond.transport, 0, NULL, 0 );
953 bdcpy(sec_event.auth_cmpl.bd_addr, p_data->bond.bd_addr);
954 p_name = BTM_SecReadDevName(p_data->bond.bd_addr);
973 bta_dm_remove_sec_dev_entry(p_data->bond.bd_addr);
990 void bta_dm_bond_cancel (tBTA_DM_MSG *p_data)
996 status = BTM_SecBondCancel ( p_data->bond_cancel.bd_addr );
1017 void bta_dm_pin_reply (tBTA_DM_MSG *p_data)
1022 current_trusted_mask = BTM_ReadTrustedMask(p_data->pin_reply.bd_addr);
1033 if(p_data->pin_reply.accept)
1036 BTM_PINCodeReply(p_data->pin_reply.bd_addr, BTM_SUCCESS, p_data->pin_reply.pin_len, p_data->pin_reply.p_pin, trusted_mask );
1040 BTM_PINCodeReply(p_data->pin_reply.bd_addr, BTM_NOT_AUTHORIZED, 0, NULL, trusted_mask );
1119 void bta_dm_confirm(tBTA_DM_MSG *p_data)
1123 if(p_data->confirm.accept == TRUE)
1125 BTM_ConfirmReqReply(res, p_data->confirm.bd_addr);
1137 void bta_dm_loc_oob(tBTA_DM_MSG *p_data)
1139 UNUSED(p_data);
1152 void bta_dm_ci_io_req_act(tBTA_DM_MSG *p_data)
1155 if(p_data->ci_io_req.auth_req)
1157 BTM_IoCapRsp(p_data->ci_io_req.bd_addr, p_data->ci_io_req.io_cap,
1158 p_data->ci_io_req.oob_data, auth_req);
1171 void bta_dm_ci_rmt_oob_act(tBTA_DM_MSG *p_data)
1175 if(p_data->ci_rmt_oob.accept == TRUE)
1177 BTM_RemoteOobDataReply(res, p_data->ci_rmt_oob.bd_addr,
1178 p_data->ci_rmt_oob.c, p_data->ci_rmt_oob.r );
1191 void bta_dm_search_start (tBTA_DM_MSG *p_data)
1196 size_t len = sizeof(tBT_UUID) * p_data->search.num_uuid;
1203 (p_data->search.rs_res == BTA_DM_RS_NONE) && bta_dm_check_av(BTA_DM_API_SEARCH_EVT))
1205 memcpy(&bta_dm_cb.search_msg, &p_data->search, sizeof(tBTA_DM_API_SEARCH));
1211 bta_dm_search_cb.p_search_cback = p_data->search.p_cback;
1212 bta_dm_search_cb.services = p_data->search.services;
1217 if ((bta_dm_search_cb.num_uuid = p_data->search.num_uuid) != 0 &&
1218 p_data->search.p_uuid != NULL) {
1220 memcpy(bta_dm_search_cb.p_srvc_uuid, p_data->search.p_uuid, len);
1223 result.status = BTM_StartInquiry( (tBTM_INQ_PARMS*)&p_data->search.inq_params,
1245 void bta_dm_search_cancel (tBTA_DM_MSG *p_data)
1247 UNUSED(p_data);
1298 void bta_dm_discover (tBTA_DM_MSG *p_data)
1301 size_t len = sizeof(tBT_UUID) * p_data->discover.num_uuid;
1304 p_data->discover.services, p_data->discover.sdp_search);
1307 bta_dm_search_cb.services = p_data->discover.services;
1312 if ((bta_dm_search_cb.num_uuid = p_data->discover.num_uuid) != 0 &&
1313 p_data->discover.p_uuid != NULL) {
1315 memcpy(bta_dm_search_cb.p_srvc_uuid, p_data->discover.p_uuid, len);
1320 bta_dm_search_cb.p_search_cback = p_data->discover.p_cback;
1321 bta_dm_search_cb.sdp_search = p_data->discover.sdp_search;
1326 bta_dm_search_cb.sdp_search = p_data->discover.sdp_search;
1327 bta_dm_search_cb.p_btm_inq_info = BTM_InqDbRead (p_data->discover.bd_addr);
1328 bta_dm_search_cb.transport = p_data->discover.transport;
1331 memcpy(&bta_dm_search_cb.uuid, &p_data->discover.uuid, sizeof(tSDP_UUID));
1332 bta_dm_discover_device(p_data->discover.bd_addr);
1344 void bta_dm_di_disc_cmpl(tBTA_DM_MSG *p_data)
1351 if((p_data->hdr.offset == SDP_SUCCESS)
1352 || (p_data->hdr.offset == SDP_DB_FULL))
1423 void bta_dm_di_disc (tBTA_DM_MSG *p_data)
1427 bta_dm_search_cb.p_search_cback = p_data->di_disc.p_cback;
1428 bdcpy(bta_dm_search_cb.peer_bdaddr, p_data->di_disc.bd_addr);
1429 bta_dm_di_cb.p_di_db = p_data->di_disc.p_sdp_db;
1432 if (SDP_DiDiscover(bta_dm_search_cb.peer_bdaddr, p_data->di_disc.p_sdp_db,
1433 p_data->di_disc.len,
1443 p_data->hdr.offset = result;
1503 void bta_dm_inq_cmpl (tBTA_DM_MSG *p_data)
1509 data.inq_cmpl.num_resps = p_data->inq_cmpl.num;
1539 void bta_dm_rmt_name (tBTA_DM_MSG *p_data)
1543 if( p_data->rem_name.result.disc_res.bd_name[0] && bta_dm_search_cb.p_btm_inq_info)
1561 void bta_dm_disc_rmt_name (tBTA_DM_MSG *p_data)
1567 p_btm_inq_info = BTM_InqDbRead (p_data->rem_name.result.disc_res.bd_addr);
1570 if( p_data->rem_name.result.disc_res.bd_name[0] )
1576 bta_dm_discover_device(p_data->rem_name.result.disc_res.bd_addr);
1588 void bta_dm_sdp_result (tBTA_DM_MSG *p_data)
1606 if((p_data->sdp_event.sdp_result == SDP_SUCCESS)
1607 || (p_data->sdp_event.sdp_result == SDP_NO_RECS_MATCH)
1608 || (p_data->sdp_event.sdp_result == SDP_DB_FULL))
1610 APPL_TRACE_DEBUG("sdp_result::0x%x", p_data->sdp_event.sdp_result);
1671 if (((p_data->sdp_event.sdp_result == SDP_DB_FULL) &&
1801 if(p_data->sdp_event.sdp_result == SDP_CONN_FAILED || p_data->sdp_event.sdp_result == SDP_CONN_REJECTED
1802 || p_data->sdp_event.sdp_result == SDP_SECURITY_ERR)
1833 void bta_dm_search_cmpl(tBTA_DM_MSG *p_data)
1841 if (p_data->hdr.layer_specific == BTA_DM_API_DI_DISCOVER_EVT)
1842 bta_dm_di_disc_cmpl(p_data);
1856 void bta_dm_disc_result (tBTA_DM_MSG *p_data)
1864 bta_dm_search_cb.p_search_cback(BTA_DM_DISC_RES_EVT, &p_data->disc_result.result);
1883 void bta_dm_search_result (tBTA_DM_MSG *p_data)
1887 p_data->disc_result.result.disc_res.services);
1891 ||(( bta_dm_search_cb.services ) && ( p_data->disc_result.result.disc_res.services )))
1893 bta_dm_search_cb.p_search_cback(BTA_DM_DISC_RES_EVT, &p_data->disc_result.result);
1944 void bta_dm_free_sdp_db (tBTA_DM_MSG *p_data)
1946 UNUSED(p_data);
1959 void bta_dm_queue_search(tBTA_DM_MSG *p_data)
1964 memcpy(bta_dm_search_cb.p_search_queue, p_data,
1977 void bta_dm_queue_disc(tBTA_DM_MSG *p_data)
1982 memcpy(bta_dm_search_cb.p_search_queue, p_data,
1995 void bta_dm_search_clear_queue(tBTA_DM_MSG *p_data)
1997 UNUSED(p_data);
2010 void bta_dm_search_cancel_cmpl (tBTA_DM_MSG *p_data)
2012 UNUSED(p_data);
2031 void bta_dm_search_cancel_transac_cmpl(tBTA_DM_MSG *p_data)
2033 UNUSED(p_data);
2049 void bta_dm_search_cancel_notify (tBTA_DM_MSG *p_data)
2051 UNUSED(p_data);
2635 static void bta_dm_pinname_cback (void *p_data)
2637 tBTM_REMOTE_DEV_NAME *p_result = (tBTM_REMOTE_DEV_NAME *)p_data;
2830 static UINT8 bta_dm_sp_cback (tBTM_SP_EVT event, tBTM_SP_EVT_DATA *p_data)
2846 bta_dm_co_io_req(p_data->io_req.bd_addr, &p_data->io_req.io_cap,
2847 &p_data->io_req.oob_data, &p_data->io_req.auth_req, p_data->io_req.is_orig);
2849 APPL_TRACE_EVENT("io mitm: %d oob_data:%d", p_data->io_req.auth_req, p_data->io_req.oob_data);
2853 bta_dm_co_io_rsp(p_data->io_rsp.bd_addr, p_data->io_rsp.io_cap,
2854 p_data->io_rsp.oob_data, p_data->io_rsp.auth_req );
2860 bta_dm_cb.just_works = sec_event.cfm_req.just_works = p_data->cfm_req.just_works;
2861 sec_event.cfm_req.loc_auth_req = p_data->cfm_req.loc_auth_req;
2862 sec_event.cfm_req.rmt_auth_req = p_data->cfm_req.rmt_auth_req;
2863 sec_event.cfm_req.loc_io_caps = p_data->cfm_req.loc_io_caps;
2864 sec_event.cfm_req.rmt_io_caps = p_data->cfm_req.rmt_io_caps;
2877 if(p_data->cfm_req.bd_name[0] == 0)
2880 bdcpy(bta_dm_cb.pin_bd_addr, p_data->cfm_req.bd_addr);
2881 BTA_COPY_DEVICE_CLASS(bta_dm_cb.pin_dev_class, p_data->cfm_req.dev_class);
2882 if ((BTM_ReadRemoteDeviceName(p_data->cfm_req.bd_addr, bta_dm_pinname_cback,
2891 bdcpy(sec_event.key_notif.bd_addr, p_data->cfm_req.bd_addr);
2892 BTA_COPY_DEVICE_CLASS(sec_event.key_notif.dev_class, p_data->cfm_req.dev_class);
2894 (char*)p_data->cfm_req.bd_name, BD_NAME_LEN);
2898 bta_dm_cb.num_val = sec_event.key_notif.passkey = p_data->key_notif.passkey;
2903 if(p_data->key_notif.bd_name[0] == 0)
2906 bdcpy(bta_dm_cb.pin_bd_addr, p_data->key_notif.bd_addr);
2907 BTA_COPY_DEVICE_CLASS(bta_dm_cb.pin_dev_class, p_data->key_notif.dev_class);
2908 if ((BTM_ReadRemoteDeviceName(p_data->key_notif.bd_addr, bta_dm_pinname_cback,
2915 bdcpy(sec_event.key_notif.bd_addr, p_data->key_notif.bd_addr);
2916 BTA_COPY_DEVICE_CLASS(sec_event.key_notif.dev_class, p_data->key_notif.dev_class);
2918 (char*)p_data->key_notif.bd_name, BD_NAME_LEN);
2928 bta_dm_co_loc_oob((BOOLEAN)(p_data->loc_oob.status == BTM_SUCCESS),
2929 p_data->loc_oob.c, p_data->loc_oob.r);
2934 if (p_data->rmt_oob.bd_name[0] == 0)
2937 bdcpy(bta_dm_cb.pin_bd_addr, p_data->rmt_oob.bd_addr);
2938 BTA_COPY_DEVICE_CLASS(bta_dm_cb.pin_dev_class, p_data->rmt_oob.dev_class);
2939 if ((BTM_ReadRemoteDeviceName(p_data->rmt_oob.bd_addr, bta_dm_pinname_cback,
2945 bdcpy(sec_event.rmt_oob.bd_addr, p_data->rmt_oob.bd_addr);
2946 BTA_COPY_DEVICE_CLASS(sec_event.rmt_oob.dev_class, p_data->rmt_oob.dev_class);
2947 strlcpy((char*)sec_event.rmt_oob.bd_name, (char*)p_data->rmt_oob.bd_name, BD_NAME_LEN);
2951 bta_dm_co_rmt_oob(p_data->rmt_oob.bd_addr);
2959 memcpy(&sec_event.key_press, &p_data->key_press, sizeof(tBTM_SP_KEYPRESS));
2964 bta_dm_co_lk_upgrade(p_data->upgrade.bd_addr, &p_data->upgrade.upgrade );
3007 static void bta_dm_bl_change_cback (tBTM_BL_EVENT_DATA *p_data)
3012 p_msg->event = p_data->event;
3018 bdcpy(p_msg->bd_addr, p_data->conn.p_bda);
3020 p_msg->transport = p_data->conn.transport;
3021 p_msg->handle = p_data->conn.handle;
3025 bdcpy(p_msg->bd_addr, p_data->discn.p_bda);
3027 p_msg->transport = p_data->discn.transport;
3028 p_msg->handle = p_data->discn.handle;
3032 p_msg->busy_level = p_data->update.busy_level;
3033 p_msg->busy_level_flags = p_data->update.busy_level_flags;
3036 p_msg->new_role = p_data->role_chg.new_role;
3037 p_msg->hci_status = p_data->role_chg.hci_status;
3038 bdcpy(p_msg->bd_addr, p_data->role_chg.p_bda);
3041 bdcpy(p_msg->bd_addr, p_data->conn.p_bda);
3134 void bta_dm_acl_change(tBTA_DM_MSG *p_data)
3140 BOOLEAN is_new = p_data->acl_change.is_new;
3141 BD_ADDR_PTR p_bda = p_data->acl_change.bd_addr;
3148 switch(p_data->acl_change.event)
3153 conn.busy_level.level = p_data->acl_change.busy_level;
3154 conn.busy_level.level_flags = p_data->acl_change.busy_level_flags;
3164 p_dev->info, p_data->acl_change.new_role, bta_dm_cb.device_list.count);
3168 if(p_data->acl_change.new_role == HCI_ROLE_SLAVE && bta_dm_cb.device_list.count > 1
3169 && p_data->acl_change.hci_status == HCI_SUCCESS)
3176 else if (p_bta_dm_cfg->avoid_scatter && (p_data->acl_change.new_role == HCI_ROLE_MASTER))
3194 bta_sys_notify_role_chg(p_data->acl_change.bd_addr, p_data->acl_change.new_role, p_data->acl_change.hci_status);
3196 conn.role_chg.new_role = (UINT8) p_data->acl_change.new_role;
3204 if (p_data->acl_change.event == BTM_BL_COLLISION_EVT)
3216 && bta_dm_cb.device_list.peer_device[i].conn_handle == p_data->acl_change.handle
3231 bta_dm_cb.device_list.peer_device[i].conn_handle = p_data->acl_change.handle;
3232 if (p_data->acl_change.transport == BT_TRANSPORT_LE)
3246 conn.link_up.link_type = p_data->acl_change.transport;
3247 bta_dm_cb.device_list.peer_device[i].transport = p_data->acl_change.transport;
3265 ||bta_dm_cb.device_list.peer_device[i].transport != p_data->acl_change.transport
3289 if ((p_data->acl_change.transport == BT_TRANSPORT_LE) &&
3292 conn.link_down.link_type = p_data->acl_change.transport;
4102 void bta_dm_enable_test_mode(tBTA_DM_MSG *p_data)
4104 UNUSED(p_data);
4118 void bta_dm_disable_test_mode(tBTA_DM_MSG *p_data)
4120 UNUSED(p_data);
4134 void bta_dm_execute_callback(tBTA_DM_MSG *p_data)
4137 if(p_data->exec_cback.p_exec_cback == NULL)
4142 p_data->exec_cback.p_exec_cback(p_data->exec_cback.p_param);
4209 void bta_dm_set_encryption (tBTA_DM_MSG *p_data)
4214 if (!p_data->set_encryption.p_callback)
4221 if (bdcmp( bta_dm_cb.device_list.peer_device[i].peer_bdaddr, p_data->set_encryption.bd_addr) == 0 &&
4230 (*p_data->set_encryption.p_callback)(p_data->set_encryption.bd_addr,
4231 p_data->set_encryption.transport,
4236 if (BTM_SetEncryption(p_data->set_encryption.bd_addr, p_data->set_encryption.transport,
4237 bta_dm_encrypt_cback, NULL, p_data->set_encryption.sec_act)
4240 bta_dm_cb.device_list.peer_device[i].p_encrypt_cback = p_data->set_encryption.p_callback;
4325 static UINT8 bta_dm_ble_smp_cback (tBTM_LE_EVT event, BD_ADDR bda, tBTM_LE_EVT_DATA *p_data)
4341 &p_data->io_req.io_cap,
4342 &p_data->io_req.oob_data,
4343 &p_data->io_req.auth_req,
4344 &p_data->io_req.max_key_size,
4345 &p_data->io_req.init_keys,
4346 &p_data->io_req.resp_keys);
4348 APPL_TRACE_EVENT("io mitm: %d oob_data:%d", p_data->io_req.auth_req, p_data->io_req.oob_data);
4369 sec_event.key_notif.passkey = p_data->key_notif;
4386 sec_event.key_notif.passkey = p_data->key_notif;
4392 sec_event.ble_key.key_type = p_data->key.key_type;
4393 sec_event.ble_key.p_key_value = p_data->key.p_key_value;
4408 if (p_data->complt.reason != 0)
4410 sec_event.auth_cmpl.fail_reason = BTA_DM_AUTH_CONVERT_SMP_CODE(((UINT8)p_data->complt.reason));
4417 if (!p_data->complt.smp_over_br)
4485 void bta_dm_add_blekey (tBTA_DM_MSG *p_data)
4487 if (!BTM_SecAddBleKey (p_data->add_ble_key.bd_addr,
4488 (tBTM_LE_KEY_VALUE *)&p_data->add_ble_key.blekey,
4489 p_data->add_ble_key.key_type))
4492 (p_data->add_ble_key.bd_addr[0]<<24)+(p_data->add_ble_key.bd_addr[1]<<16)+\
4493 (p_data->add_ble_key.bd_addr[2]<<8)+p_data->add_ble_key.bd_addr[3],
4494 (p_data->add_ble_key.bd_addr[4]<<8)+p_data->add_ble_key.bd_addr[5]);
4509 void bta_dm_add_ble_device (tBTA_DM_MSG *p_data)
4511 if (!BTM_SecAddBleDevice (p_data->add_ble_device.bd_addr, NULL,
4512 p_data->add_ble_device.dev_type ,
4513 p_data->add_ble_device.addr_type))
4516 (p_data->add_ble_device.bd_addr[0]<<24)+(p_data->add_ble_device.bd_addr[1]<<16)+ \
4517 (p_data->add_ble_device.bd_addr[2]<<8)+p_data->add_ble_device.bd_addr[3],
4518 (p_data->add_ble_device.bd_addr[4]<<8)+p_data->add_ble_device.bd_addr[5]);
4533 void bta_dm_ble_passkey_reply (tBTA_DM_MSG *p_data)
4535 if (p_data->pin_reply.accept)
4537 BTM_BlePasskeyReply(p_data->ble_passkey_reply.bd_addr, BTM_SUCCESS, p_data->ble_passkey_reply.passkey);
4541 BTM_BlePasskeyReply(p_data->ble_passkey_reply.bd_addr, BTM_NOT_AUTHORIZED, p_data->ble_passkey_reply.passkey);
4556 void bta_dm_ble_confirm_reply (tBTA_DM_MSG *p_data)
4558 if (p_data->confirm.accept)
4560 BTM_BleConfirmReply(p_data->confirm.bd_addr, BTM_SUCCESS);
4564 BTM_BleConfirmReply(p_data->ble_passkey_reply.bd_addr, BTM_NOT_AUTHORIZED);
4577 void bta_dm_security_grant (tBTA_DM_MSG *p_data)
4579 BTM_SecurityGrant(p_data->ble_sec_grant.bd_addr, p_data->ble_sec_grant.res);
4591 void bta_dm_ble_set_bg_conn_type (tBTA_DM_MSG *p_data)
4593 BTM_BleSetBgConnType(p_data->ble_set_bd_conn_type.bg_conn_type,
4594 p_data->ble_set_bd_conn_type.p_select_cback);
4606 void bta_dm_ble_set_conn_params (tBTA_DM_MSG *p_data)
4608 BTM_BleSetPrefConnParams(p_data->ble_set_conn_params.peer_bda,
4609 p_data->ble_set_conn_params.conn_int_min,
4610 p_data->ble_set_conn_params.conn_int_max,
4611 p_data->ble_set_conn_params.slave_latency,
4612 p_data->ble_set_conn_params.supervision_tout);
4624 void bta_dm_ble_set_scan_params(tBTA_DM_MSG *p_data)
4626 BTM_BleSetScanParams(p_data->ble_set_scan_params.client_if,
4627 p_data->ble_set_scan_params.scan_int,
4628 p_data->ble_set_scan_params.scan_window,
4629 p_data->ble_set_scan_params.scan_mode,
4630 p_data->ble_set_scan_params.scan_param_setup_cback);
4642 void bta_dm_ble_set_conn_scan_params (tBTA_DM_MSG *p_data)
4644 BTM_BleSetConnScanParams(p_data->ble_set_conn_scan_params.scan_int,
4645 p_data->ble_set_conn_scan_params.scan_window);
4656 void bta_dm_ble_update_conn_params (tBTA_DM_MSG *p_data)
4658 if (!L2CA_UpdateBleConnParams(p_data->ble_update_conn_params.bd_addr,
4659 p_data->ble_update_conn_params.min_int,
4660 p_data->ble_update_conn_params.max_int,
4661 p_data->ble_update_conn_params.latency,
4662 p_data->ble_update_conn_params.timeout))
4678 void bta_dm_ble_config_local_privacy (tBTA_DM_MSG *p_data)
4680 BTM_BleConfigPrivacy (p_data->ble_local_privacy.privacy_enable);
4693 void bta_dm_ble_observe (tBTA_DM_MSG *p_data)
4696 if (p_data->ble_observe.start)
4699 bta_dm_search_cb.p_scan_cback = p_data->ble_observe.p_cback;
4700 if ((status = BTM_BleObserve(TRUE, p_data->ble_observe.duration,
4727 void bta_dm_ble_set_adv_params (tBTA_DM_MSG *p_data)
4729 BTM_BleSetAdvParams(p_data->ble_set_adv_params.adv_int_min,
4730 p_data->ble_set_adv_params.adv_int_max,
4731 p_data->ble_set_adv_params.p_dir_bda,
4744 void bta_dm_ble_set_adv_config (tBTA_DM_MSG *p_data)
4748 if (BTM_BleWriteAdvData(p_data->ble_set_adv_data.data_mask,
4749 (tBTM_BLE_ADV_DATA *)&p_data->ble_set_adv_data.adv_cfg) == BTM_SUCCESS)
4754 if (p_data->ble_set_adv_data.p_adv_data_cback)
4755 (*p_data->ble_set_adv_data.p_adv_data_cback)(status);
4767 void bta_dm_ble_set_scan_rsp (tBTA_DM_MSG *p_data)
4771 if(BTM_BleWriteScanRsp(p_data->ble_set_adv_data.data_mask,
4772 (tBTM_BLE_ADV_DATA *)&p_data->ble_set_adv_data.adv_cfg) == BTM_SUCCESS)
4777 if (p_data->ble_set_adv_data.p_adv_data_cback)
4778 (*p_data->ble_set_adv_data.p_adv_data_cback)(status);
4790 void bta_dm_ble_set_data_length(tBTA_DM_MSG *p_data)
4792 if (BTM_SetBleDataLength(p_data->ble_set_data_length.remote_bda,
4793 p_data->ble_set_data_length.tx_data_length) != BTM_SUCCESS)
4808 void bta_dm_ble_broadcast (tBTA_DM_MSG *p_data)
4810 BTM_BleBroadcast(p_data->ble_observe.start);
4822 void bta_dm_ble_multi_adv_enb(tBTA_DM_MSG *p_data)
4826 bta_dm_cb.p_multi_adv_cback = p_data->ble_multi_adv_enb.p_cback;
4827 if(BTM_BleMaxMultiAdvInstanceCount() > 0 && NULL != p_data->ble_multi_adv_enb.p_ref)
4830 p_data->ble_multi_adv_enb.p_params,
4831 p_data->ble_multi_adv_enb.p_cback,
4832 p_data->ble_multi_adv_enb.p_ref);
4838 p_data->ble_multi_adv_enb.p_ref, BTA_FAILURE);
4850 void bta_dm_ble_multi_adv_upd_param(tBTA_DM_MSG *p_data)
4855 if(BTM_BleMaxMultiAdvInstanceCount() > 0 && p_data->ble_multi_adv_param.inst_id > 0
4856 && p_data->ble_multi_adv_param.inst_id < BTM_BleMaxMultiAdvInstanceCount())
4858 btm_status = BTM_BleUpdateAdvInstParam(p_data->ble_multi_adv_param.inst_id,
4859 (tBTM_BLE_ADV_PARAMS*)p_data->ble_multi_adv_param.p_params);
4864 p_ref = btm_ble_multi_adv_get_ref(p_data->ble_multi_adv_param.inst_id);
4866 p_data->ble_multi_adv_param.inst_id, p_ref, BTA_FAILURE);
4879 void bta_dm_ble_multi_adv_data(tBTA_DM_MSG *p_data)
4884 if(BTM_BleMaxMultiAdvInstanceCount() > 0 && p_data->ble_multi_adv_data.inst_id > 0
4885 && p_data->ble_multi_adv_data.inst_id < BTM_BleMaxMultiAdvInstanceCount())
4887 btm_status = BTM_BleCfgAdvInstData(p_data->ble_multi_adv_data.inst_id,
4888 p_data->ble_multi_adv_data.is_scan_rsp,
4889 p_data->ble_multi_adv_data.data_mask,
4890 (tBTM_BLE_ADV_DATA*)&p_data->ble_multi_adv_data.data);
4895 p_ref = btm_ble_multi_adv_get_ref(p_data->ble_multi_adv_data.inst_id);
4897 p_data->ble_multi_adv_data.inst_id, p_ref, BTA_FAILURE);
4910 void btm_dm_ble_multi_adv_disable(tBTA_DM_MSG *p_data)
4915 if(BTM_BleMaxMultiAdvInstanceCount() > 0 && p_data->ble_multi_adv_disable.inst_id > 0
4916 && p_data->ble_multi_adv_disable.inst_id < BTM_BleMaxMultiAdvInstanceCount())
4918 btm_status = BTM_BleDisableAdvInstance(p_data->ble_multi_adv_disable.inst_id);
4923 p_ref = btm_ble_multi_adv_get_ref(p_data->ble_multi_adv_disable.inst_id);
4925 p_data->ble_multi_adv_disable.inst_id, p_ref, BTA_FAILURE);
4938 void bta_dm_ble_setup_storage (tBTA_DM_MSG *p_data)
4947 btm_status = BTM_BleSetStorageConfig(p_data->ble_set_storage.batch_scan_full_max,
4948 p_data->ble_set_storage.batch_scan_trunc_max,
4949 p_data->ble_set_storage.batch_scan_notify_threshold,
4950 p_data->ble_set_storage.p_setup_cback,
4951 p_data->ble_set_storage.p_thres_cback,
4952 p_data->ble_set_storage.p_read_rep_cback,
4953 p_data->ble_set_storage.ref_value);
4957 bta_ble_scan_setup_cb(BTM_BLE_BATCH_SCAN_CFG_STRG_EVT, p_data->ble_set_storage.ref_value,
4970 void bta_dm_ble_enable_batch_scan (tBTA_DM_MSG *p_data)
4979 btm_status = BTM_BleEnableBatchScan(p_data->ble_enable_scan.scan_mode,
4980 p_data->ble_enable_scan.scan_int,
4981 p_data->ble_enable_scan.scan_window,
4982 p_data->ble_enable_scan.discard_rule,
4983 p_data->ble_enable_scan.addr_type,
4984 p_data->ble_enable_scan.ref_value);
4988 p_data->ble_enable_scan.ref_value,
5001 void bta_dm_ble_disable_batch_scan (tBTA_DM_MSG *p_data)
5003 UNUSED(p_data);
5011 btm_status = BTM_BleDisableBatchScan(p_data->ble_disable_scan.ref_value);
5015 bta_ble_scan_setup_cb(BTM_BLE_BATCH_SCAN_DISABLE_EVT, p_data->ble_enable_scan.ref_value,
5028 void bta_dm_ble_read_scan_reports(tBTA_DM_MSG *p_data)
5037 btm_status = BTM_BleReadScanReports(p_data->ble_read_reports.scan_type,
5038 p_data->ble_read_reports.ref_value);
5042 bta_ble_scan_setup_cb(BTM_BLE_BATCH_SCAN_READ_REPTS_EVT, p_data->ble_enable_scan.ref_value,
5055 void bta_dm_ble_track_advertiser(tBTA_DM_MSG *p_data)
5068 p_data->ble_track_advert.p_track_adv_cback,
5069 p_data->ble_track_advert.ref_value);
5076 track_adv_data.client_if = (UINT8)p_data->ble_track_advert.ref_value;
5077 p_data->ble_track_advert.p_track_adv_cback(&track_adv_data);
5153 void bta_dm_cfg_filter_cond (tBTA_DM_MSG *p_data)
5164 if ((st = BTM_BleCfgFilterCondition(p_data->ble_cfg_filter_cond.action,
5165 p_data->ble_cfg_filter_cond.cond_type,
5166 (tBTM_BLE_PF_FILT_INDEX)p_data->ble_cfg_filter_cond.filt_index,
5167 (tBTM_BLE_PF_COND_PARAM *)p_data->ble_cfg_filter_cond.p_cond_param,
5168 bta_ble_scan_cfg_cmpl, p_data->ble_cfg_filter_cond.ref_value))
5171 bta_dm_cb.p_scan_filt_cfg_cback = p_data->ble_cfg_filter_cond.p_filt_cfg_cback;
5176 if (p_data->ble_cfg_filter_cond.p_filt_cfg_cback)
5177 p_data->ble_cfg_filter_cond.p_filt_cfg_cback(BTA_DM_BLE_PF_CONFIG_EVT,
5178 p_data->ble_cfg_filter_cond.cond_type, 0, status,
5179 p_data->ble_cfg_filter_cond.ref_value);
5192 void bta_dm_enable_scan_filter(tBTA_DM_MSG *p_data)
5203 if((st = BTM_BleEnableDisableFilterFeature(p_data->ble_enable_scan_filt.action,
5204 p_data->ble_enable_scan_filt.p_filt_status_cback,
5205 (tBTM_BLE_REF_VALUE)p_data->ble_enable_scan_filt.ref_value)) == BTM_CMD_STARTED)
5206 bta_dm_cb.p_scan_filt_status_cback = p_data->ble_enable_scan_filt.p_filt_status_cback;
5210 if (p_data->ble_enable_scan_filt.p_filt_status_cback)
5211 p_data->ble_enable_scan_filt.p_filt_status_cback (BTA_DM_BLE_PF_ENABLE_EVT,
5212 p_data->ble_enable_scan_filt.ref_value, status);
5225 void bta_dm_scan_filter_param_setup (tBTA_DM_MSG *p_data)
5236 if ((st = BTM_BleAdvFilterParamSetup(p_data->ble_scan_filt_param_setup.action,
5237 p_data->ble_scan_filt_param_setup.filt_index,
5238 (tBTM_BLE_PF_FILT_PARAMS *)&p_data->ble_scan_filt_param_setup.filt_params,
5239 p_data->ble_scan_filt_param_setup.p_target,
5240 p_data->ble_scan_filt_param_setup.p_filt_param_cback,
5241 p_data->ble_scan_filt_param_setup.ref_value)) == BTM_CMD_STARTED)
5243 bta_dm_cb.p_scan_filt_param_cback = p_data->ble_scan_filt_param_setup.p_filt_param_cback;
5248 if (p_data->ble_scan_filt_param_setup.p_filt_param_cback)
5249 p_data->ble_scan_filt_param_setup.p_filt_param_cback (BTA_DM_BLE_PF_ENABLE_EVT, 0,
5250 p_data->ble_scan_filt_param_setup.ref_value, status);
5291 void bta_dm_ble_get_energy_info(tBTA_DM_MSG *p_data)
5295 bta_dm_cb.p_energy_info_cback = p_data->ble_energy_info.p_energy_info_cback;
5479 void bta_dm_close_gatt_conn(tBTA_DM_MSG *p_data)
5481 UNUSED(p_data);
5543 void bta_dm_proc_open_evt(tBTA_GATTC_OPEN *p_data)
5549 p2 = p_data->remote_bda;
5559 p_data->conn_id,
5560 p_data->client_if,
5561 p_data->status);
5563 bta_dm_search_cb.conn_id = p_data->conn_id;
5565 if (p_data->status == BTA_GATT_OK)
5567 btm_dm_start_disc_gatt_services(p_data->conn_id);
5571 bta_dm_gatt_disc_complete(BTA_GATT_INVALID_CONN_ID, p_data->status);
5584 static void bta_dm_gattc_callback(tBTA_GATTC_EVT event, tBTA_GATTC *p_data)
5591 APPL_TRACE_DEBUG("BTA_GATTC_REG_EVT client_if = %d", p_data->reg_oper.client_if);
5592 if (p_data->reg_oper.status == BTA_GATT_OK)
5593 bta_dm_search_cb.client_if = p_data->reg_oper.client_if;
5599 bta_dm_proc_open_evt(&p_data->open);
5603 bta_dm_gatt_disc_result(p_data->srvc_res.service_uuid);
5608 bta_dm_gatt_disc_complete(p_data->search_cmpl.conn_id, p_data->search_cmpl.status);
5612 APPL_TRACE_DEBUG("BTA_GATTC_CLOSE_EVT reason = %d", p_data->close.reason);
5616 !memcmp(p_data->close.remote_bda, bta_dm_search_cb.peer_bdaddr, BD_ADDR_LEN))