******************************************************************************/
extern fixed_queue_t* btu_hci_msg_queue;
-void btif_dm_execute_service_request(uint16_t event, char* p_param);
+void btif_dm_enable_service(tBTA_SERVICE_ID service_id, bool enable);
#ifdef BTIF_DM_OOB_TEST
void btif_dm_load_local_oob(void);
#endif
*
******************************************************************************/
bt_status_t btif_enable_service(tBTA_SERVICE_ID service_id) {
- tBTA_SERVICE_ID* p_id = &service_id;
-
- /* If BT is enabled, we need to switch to BTIF context and trigger the
- * enable for that profile
- *
- * Otherwise, we just set the flag. On BT_Enable, the DM will trigger
- * enable for the profiles that have been enabled */
-
btif_enabled_services |= (1 << service_id);
BTIF_TRACE_DEBUG("%s: current services:0x%x", __func__,
btif_enabled_services);
if (btif_is_enabled()) {
- btif_dm_execute_service_request(BTIF_DM_ENABLE_SERVICE, (char*)p_id);
+ btif_dm_enable_service(service_id, true);
}
-
return BT_STATUS_SUCCESS;
}
/*******************************************************************************
*
******************************************************************************/
bt_status_t btif_disable_service(tBTA_SERVICE_ID service_id) {
- tBTA_SERVICE_ID* p_id = &service_id;
-
- /* If BT is enabled, we need to switch to BTIF context and trigger the
- * disable for that profile so that the appropriate uuid_property_changed will
- * be triggerred. Otherwise, we just need to clear the service_id in the mask
- */
-
btif_enabled_services &= (tBTA_SERVICE_MASK)(~(1 << service_id));
BTIF_TRACE_DEBUG("%s: Current Services:0x%x", __func__,
btif_enabled_services);
if (btif_is_enabled()) {
- btif_dm_execute_service_request(BTIF_DM_DISABLE_SERVICE, (char*)p_id);
+ btif_dm_enable_service(service_id, false);
}
-
return BT_STATUS_SUCCESS;
}
BTA_DmDiscoverUUID(remote_addr, uuid, bte_dm_remote_service_record_evt, true);
}
-void btif_dm_execute_service_request(uint16_t event, char* p_param) {
- bool b_enable = false;
- bt_status_t status;
- if (event == BTIF_DM_ENABLE_SERVICE) {
- b_enable = true;
- }
- status =
- btif_in_execute_service_request(*((tBTA_SERVICE_ID*)p_param), b_enable);
+void btif_dm_enable_service(tBTA_SERVICE_ID service_id, bool enable) {
+ bt_status_t status = btif_in_execute_service_request(service_id, enable);
if (status == BT_STATUS_SUCCESS) {
bt_property_t property;
Uuid local_uuids[BT_MAX_NUM_UUIDS];