/******************************************************************************* ** ** Function nfa_dm_sys_disable ** ** Description This function is called after all subsystems have been disabled. ** ** Returns void ** *******************************************************************************/ void nfa_dm_sys_disable (void) { /* Disable the DM sub-system */ /* If discovery state is not IDLE or DEACTIVATED and graceful disable, */ /* then we need to deactivate link or stop discovery */ if (nfa_sys_is_graceful_disable ()) { if ( (nfa_dm_cb.disc_cb.disc_state == NFA_DM_RFST_IDLE) &&((nfa_dm_cb.disc_cb.disc_flags & NFA_DM_DISC_FLAGS_DISABLING) == 0) ) { /* discovery is not started */ nfa_dm_disable_complete (); } else { /* probably waiting to be disabled */ NFA_TRACE_WARNING2 ("DM disc_state state = %d disc_flags:0x%x", nfa_dm_cb.disc_cb.disc_state, nfa_dm_cb.disc_cb.disc_flags); } } else { nfa_dm_disable_complete (); } }
/******************************************************************************* ** ** Function nfa_hciu_send_to_app ** ** Description Send an event back to an application ** ** Returns none ** *******************************************************************************/ void nfa_hciu_send_to_app (tNFA_HCI_EVT event, tNFA_HCI_EVT_DATA *p_evt, tNFA_HANDLE app_handle) { UINT8 app_inx = app_handle & NFA_HANDLE_MASK; /* First, check if the application handle is valid */ if ( ((app_handle & NFA_HANDLE_GROUP_MASK) == NFA_HANDLE_GROUP_HCI) &&(app_inx < NFA_HCI_MAX_APP_CB) ) { if (nfa_hci_cb.p_app_cback[app_inx] != NULL) { nfa_hci_cb.p_app_cback[app_inx] (event, p_evt); return; } } if (app_handle != NFA_HANDLE_INVALID) { NFA_TRACE_WARNING2 ("nfa_hciu_send_to_app no callback, event: 0x%04x app_handle: 0x%04x", event, app_handle); } }