Esempio n. 1
0
static void free_rfc_slot_scn(rfc_slot_t *slot) {
  if (slot->scn <= 0)
    return;

  if(slot->f.server && !slot->f.closing && slot->rfc_handle) {
    BTA_JvRfcommStopServer(slot->rfc_handle, (void *)(uintptr_t)slot->id);
    slot->rfc_handle = 0;
  }

  if (slot->f.server)
    BTM_FreeSCN(slot->scn);
  slot->scn = 0;
}
static inline void free_rfc_slot_scn(rfc_slot_t* rs)
{
    if(rs->scn > 0)
    {
        if(rs->f.server && !rs->f.closing && rs->rfc_handle)
        {
            BTA_JvRfcommStopServer(rs->rfc_handle, (void*)rs->id);
            rs->rfc_handle = 0;
        }
        if(rs->f.server)
            BTM_FreeSCN(rs->scn);
        rs->scn = 0;
    }
}
Esempio n. 3
0
/*******************************************************************************
**
** Function         bta_hf_client_del_record
**
** Description      Delete SDP record for registered service.
**
**
** Returns          void
**
*******************************************************************************/
void bta_hf_client_del_record(tBTA_HF_CLIENT_DATA *p_data)
{
    UNUSED(p_data);

    APPL_TRACE_DEBUG("bta_hf_client_del_record");

    if (bta_hf_client_cb.sdp_handle != 0) {
        SDP_DeleteRecord(bta_hf_client_cb.sdp_handle);
        bta_hf_client_cb.sdp_handle = 0;
        BTM_FreeSCN(bta_hf_client_cb.scn);
        BTM_SecClrService(BTM_SEC_SERVICE_HF_HANDSFREE);
        bta_sys_remove_uuid(UUID_SERVCLASS_HF_HANDSFREE);
    }
}
Esempio n. 4
0
/*******************************************************************************
**
** Function         bta_ag_del_records
**
** Description      Delete SDP records for any registered services.
**
**
** Returns          void
**
*******************************************************************************/
void bta_ag_del_records(tBTA_AG_SCB *p_scb, tBTA_AG_DATA *p_data)
{
    tBTA_AG_SCB         *p = &bta_ag_cb.scb[0];
    tBTA_SERVICE_MASK   services;
    tBTA_SERVICE_MASK   others = 0;
    int                 i;
    UNUSED(p_data);

    /* get services of all other registered servers */
    for (i = 0; i < BTA_AG_NUM_IDX; i++, p++)
    {
        if (p_scb == p)
        {
            continue;
        }

        if (p->in_use && p->dealloc == FALSE)
        {
            others |= p->reg_services;
        }
    }

    others >>= BTA_HSP_SERVICE_ID;
    services = p_scb->reg_services >> BTA_HSP_SERVICE_ID;
    for (i = 0; i < BTA_AG_NUM_IDX && services != 0; i++, services >>= 1, others >>= 1)
    {
        /* if service registered for this scb and not registered for any other scb */
        if (((services & 1) == 1) && ((others & 1) == 0))
        {
            APPL_TRACE_DEBUG("bta_ag_del_records %d", i);
            if (bta_ag_cb.profile[i].sdp_handle != 0)
            {
                SDP_DeleteRecord(bta_ag_cb.profile[i].sdp_handle);
                bta_ag_cb.profile[i].sdp_handle = 0;
            }
            BTM_FreeSCN(bta_ag_cb.profile[i].scn);
            BTM_SecClrService(bta_ag_sec_id[i]);
            bta_sys_remove_uuid(bta_ag_uuid[i]);
        }
    }
}