static void init_rfc_slots()
{
    int i;
    memset(rfc_slots, 0, sizeof(rfc_slot_t)*MAX_RFC_CHANNEL);
    for(i = 0; i < MAX_RFC_CHANNEL; i++)
    {
        rfc_slots[i].scn = -1;
        rfc_slots[i].sdp_handle = 0;
        rfc_slots[i].fd = rfc_slots[i].app_fd = -1;
        GKI_init_q(&rfc_slots[i].incoming_que);
    }
    BTA_JvEnable(jv_dm_cback);
    init_slot_lock(&slot_lock);
}
static void init_l2c_slots()
{
    int i;
    memset(l2c_slots, 0, sizeof(l2c_slot_t)*MAX_L2C_SOCK_CHANNEL);
    for(i = 0; i < MAX_L2C_SOCK_CHANNEL; i++)
    {
        l2c_slots[i].psm = -1;
        l2c_slots[i].f.client = FALSE;
        l2c_slots[i].put_size_set = FALSE;
        l2c_slots[i].sdp_handle = 0;
        l2c_slots[i].l2c_handle = INVALID_L2C_HANDLE;
        l2c_slots[i].fd = l2c_slots[i].app_fd = -1;
        l2c_slots[i].id = BASE_L2C_SLOT_ID + i;
        GKI_init_q(&l2c_slots[i].incoming_que);
    }
    BTA_JvRegisterL2cCback(jv_dm_cback);
    init_slot_lock(&slot_lock);
}
Пример #3
0
int btsock_thread_init()
{
    static int initialized;
    APPL_TRACE_DEBUG1("in initialized:%d", initialized);
    if(!initialized)
    {
        initialized = 1;
        init_slot_lock(&thread_slot_lock);
        int h;
        for(h = 0; h < MAX_THREAD; h++)
        {
            ts[h].cmd_fdr = ts[h].cmd_fdw = -1;
            ts[h].used = 0;
            ts[h].thread_id = -1;
            ts[h].poll_count = 0;
            ts[h].callback = NULL;
            ts[h].cmd_callback = NULL;
        }
    }
    return TRUE;
}