Lines Matching refs:id

74   uint32_t id;  // Non-zero indicates a valid (in-use) slot.
135 if (rfc_slots[i].id)
150 static rfc_slot_t *find_rfc_slot_by_id(uint32_t id) {
151 assert(id != 0);
154 if (rfc_slots[i].id == id)
157 LOG_ERROR(LOG_TAG, "%s unable to find RFCOMM slot id: %d", __func__, id);
165 if (rfc_slots[i].id && rfc_slots[i].f.pending_sdp_request && rfc_slots[i].id < min_id) {
166 min_id = rfc_slots[i].id;
175 if (rfc_slots[i].id && rfc_slots[i].f.doing_sdp_request)
203 // Increment slot id and make sure we don't use id=0.
228 slot->id = rfc_slot_id;
255 // now swap the slot id
256 uint32_t new_listen_id = accept_rs->id;
257 accept_rs->id = srv_rs->id;
258 srv_rs->id = new_listen_id;
299 BTA_JvGetChannelId(BTA_JV_CONN_TYPE_RFCOMM, UINT_TO_PTR(slot->id), channel);
310 btsock_thread_add_fd(pth, slot->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_EXCEPTION, slot->id);
340 tBTA_JV_STATUS ret = BTA_JvRfcommConnect(slot->security, slot->role, slot->scn, slot->addr.address, rfcomm_cback, (void *)(uintptr_t)slot->id);
358 BTA_JvStartDiscovery((uint8_t *)bd_addr->address, 1, &sdp_uuid, (void *)(uintptr_t)slot->id);
370 btsock_thread_add_fd(pth, slot->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_RD, slot->id);
391 BTA_JvRfcommStopServer(slot->rfc_handle, (void *)(uintptr_t)slot->id);
418 BTA_JvRfcommClose(slot->rfc_handle, (void *)(uintptr_t)slot->id);
427 slot->id = 0;
454 static void on_cl_rfc_init(tBTA_JV_RFCOMM_CL_INIT *p_init, uint32_t id) {
457 rfc_slot_t *slot = find_rfc_slot_by_id(id);
470 static void on_srv_rfc_listen_started(tBTA_JV_RFCOMM_START *p_start, uint32_t id) {
473 rfc_slot_t *slot = find_rfc_slot_by_id(id);
486 static uint32_t on_srv_rfc_connect(tBTA_JV_RFCOMM_SRV_OPEN *p_open, uint32_t id) {
490 rfc_slot_t *srv_rs = find_rfc_slot_by_id(id);
499 btsock_thread_add_fd(pth, srv_rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_EXCEPTION, srv_rs->id);
500 btsock_thread_add_fd(pth, accept_rs->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_RD, accept_rs->id);
503 new_listen_slot_id = srv_rs->id;
510 static void on_cli_rfc_connect(tBTA_JV_RFCOMM_OPEN *p_open, uint32_t id) {
513 rfc_slot_t *slot = find_rfc_slot_by_id(id);
534 static void on_rfc_close(UNUSED_ATTR tBTA_JV_RFCOMM_CLOSE *p_close, uint32_t id) {
538 rfc_slot_t *slot = find_rfc_slot_by_id(id);
545 static void on_rfc_write_done(UNUSED_ATTR tBTA_JV_RFCOMM_WRITE *p, uint32_t id) {
549 rfc_slot_t *slot = find_rfc_slot_by_id(id);
553 btsock_thread_add_fd(pth, slot->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_RD, slot->id);
562 static void on_rfc_outgoing_congest(tBTA_JV_RFCOMM_CONG *p, uint32_t id) {
565 rfc_slot_t *slot = find_rfc_slot_by_id(id);
569 btsock_thread_add_fd(pth, slot->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_RD, slot->id);
615 LOG_ERROR(LOG_TAG, "%s unhandled event %d, slot id: %zi", __func__, event, (uintptr_t)user_data);
622 uint32_t id = PTR_TO_UINT(user_data);
627 rfc_slot_t* rs = find_rfc_slot_by_id(id);
643 APPL_TRACE_DEBUG("send_app_scn() failed, close rs->id:%d", rs->id);
648 BTA_JvCreateRecordByUser(UINT_TO_PTR(rs->id));
651 "just start the RFCOMM server", rs->id);
654 rfcomm_cback, UINT_TO_PTR(rs->id));
667 on_l2cap_psm_assigned(id, p_data->psm);
673 rfc_slot_t *slot = find_rfc_slot_by_id(id);
676 BTA_JvRfcommStartServer(slot->security, slot->role, slot->scn, MAX_RFC_SESSION, rfcomm_cback, (void *)(uintptr_t)slot->id);
688 rfc_slot_t *slot = find_rfc_slot_by_id(id);
692 if (BTA_JvRfcommConnect(slot->security, slot->role, p_data->disc_comp.scn, slot->addr.address, rfcomm_cback, (void *)(uintptr_t)slot->id) == BTA_JV_SUCCESS) {
702 LOG_ERROR(LOG_TAG, "%s SDP response returned but RFCOMM slot %d did not request SDP record.", __func__, id);
714 BTA_JvStartDiscovery((uint8_t *)slot->addr.address, 1, &sdp_uuid, (void *)(uintptr_t)slot->id);
724 APPL_TRACE_DEBUG("unhandled event:%d, slot id:%d", event, id);
769 btsock_thread_add_fd(pth, slot->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_WR, slot->id);
785 slot->rfc_handle, slot->rfc_port_handle, slot->id);
806 BTA_JvRfcommWrite(slot->rfc_handle, slot->id);
809 LOG_ERROR(LOG_TAG, "%s socket signaled for read while disconnected, slot: %d, channel: %d", __func__, slot->id, slot->scn);
817 LOG_ERROR(LOG_TAG, "%s socket signaled for write while disconnected (or write failure), slot: %d, channel: %d", __func__, slot->id, slot->scn);
840 uint32_t id = (uintptr_t)user_data;
841 rfc_slot_t *slot = find_rfc_slot_by_id(id);
853 btsock_thread_add_fd(pth, slot->fd, BTSOCK_RFCOMM, SOCK_THREAD_FD_WR, slot->id);
881 uint32_t id = (uintptr_t)user_data;
884 rfc_slot_t *slot = find_rfc_slot_by_id(id);
903 uint32_t id = (uintptr_t)user_data;
905 rfc_slot_t *slot = find_rfc_slot_by_id(id);