/******************************************************************************* ** ** Function bta_ag_api_disable ** ** Description Handle an API disable event. ** ** ** Returns void ** *******************************************************************************/ static void bta_ag_api_disable(tBTA_AG_DATA *p_data) { /* deregister all scbs in use */ tBTA_AG_SCB *p_scb = &bta_ag_cb.scb[0]; BOOLEAN do_dereg = FALSE; int i; if (!bta_sys_is_register (BTA_ID_AG)) { APPL_TRACE_ERROR("BTA AG is already disabled, ignoring ..."); return; } /* De-register with BTA system manager */ bta_sys_deregister(BTA_ID_AG); for (i = 0; i < BTA_AG_NUM_SCB; i++, p_scb++) { if (p_scb->in_use) { bta_ag_sm_execute(p_scb, BTA_AG_API_DEREGISTER_EVT, p_data); do_dereg = TRUE; } } if (!do_dereg) { /* Done, send callback evt to app */ (*bta_ag_cb.p_cback)(BTA_AG_DISABLE_EVT, NULL); } bta_sys_collision_register (BTA_ID_AG, NULL); }
/******************************************************************************* ** ** Function BTA_AvDisable ** ** Description Disable the advanced audio/video service. ** ** Returns void ** *******************************************************************************/ void BTA_AvDisable(void) { BT_HDR *p_buf; bta_sys_deregister(BTA_ID_AV); if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL) { p_buf->event = BTA_AV_API_DISABLE_EVT; bta_sys_sendmsg(p_buf); } }
/******************************************************************************* ** ** Function BTA_HdDisable ** ** Description Disables HID device. ** ** Returns void ** *******************************************************************************/ void BTA_HdDisable(void) { BT_HDR *p_buf; APPL_TRACE_API("%s", __FUNCTION__); bta_sys_deregister(BTA_ID_HD); if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL) { p_buf->event = BTA_HD_API_DISABLE_EVT; bta_sys_sendmsg(p_buf); } }
/******************************************************************************* ** ** Function BTA_GATTC_Disable ** ** Description This function is called to disable GATTC module ** ** Parameters None. ** ** Returns None ** *******************************************************************************/ void BTA_GATTC_Disable(void) { BT_HDR *p_buf; if (bta_sys_is_register(BTA_ID_GATTC) == FALSE) { APPL_TRACE_WARNING("GATTC Module not enabled/already disabled\n"); return; } if ((p_buf = (BT_HDR *) osi_malloc(sizeof(BT_HDR))) != NULL) { p_buf->event = BTA_GATTC_API_DISABLE_EVT; bta_sys_sendmsg(p_buf); } bta_sys_deregister(BTA_ID_GATTC); }
/******************************************************************************* ** ** Function BTA_GATTS_Disable ** ** Description This function is called to disable GATTS module ** ** Parameters None. ** ** Returns None ** *******************************************************************************/ void BTA_GATTS_Disable(void) { BT_HDR *p_buf; if (bta_sys_is_register(BTA_ID_GATTS) == FALSE) { APPL_TRACE_WARNING0("GATTS Module not enabled/already disabled"); return; } if ((p_buf = (BT_HDR *) GKI_getbuf(sizeof(BT_HDR))) != NULL) { p_buf->event = BTA_GATTS_API_DISABLE_EVT; bta_sys_sendmsg(p_buf); } bta_sys_deregister(BTA_ID_GATTS); }
/******************************************************************************* ** ** Function bta_dm_sm_search_disable ** ** Description unregister BTA SEARCH DM ** ** ** Returns void ** *******************************************************************************/ void bta_dm_search_sm_disable( ) { bta_sys_deregister( BTA_ID_DM_SEARCH ); }
/******************************************************************************* ** ** Function bta_dm_sm_disable ** ** Description unregister BTA DM ** ** ** Returns void ** *******************************************************************************/ void bta_dm_sm_disable( ) { bta_sys_deregister( BTA_ID_DM ); }