Lines Matching refs:p_clcb
86 tGAP_CLCB *p_clcb = NULL;
88 for (i_clcb = 0, p_clcb= gap_cb.clcb; i_clcb < GAP_MAX_CL; i_clcb++, p_clcb++)
90 if (p_clcb->in_use && !memcmp(p_clcb->bda, bda, BD_ADDR_LEN))
92 return p_clcb;
111 tGAP_CLCB *p_clcb = NULL;
113 for (i_clcb = 0, p_clcb= gap_cb.clcb; i_clcb < GAP_MAX_CL; i_clcb++, p_clcb++)
115 if (p_clcb->in_use && p_clcb->connected && p_clcb->conn_id == conn_id)
117 return p_clcb;
121 return p_clcb;
136 tGAP_CLCB *p_clcb = NULL;
138 for (i_clcb = 0, p_clcb= gap_cb.clcb; i_clcb < GAP_MAX_CL; i_clcb++, p_clcb++)
140 if (!p_clcb->in_use)
142 p_clcb->in_use = TRUE;
143 p_clcb->conn_id = conn_id;
144 p_clcb->connected = TRUE;
145 memcpy (p_clcb->bda, bda, BD_ADDR_LEN);
149 return p_clcb;
164 tGAP_CLCB *p_clcb = NULL;
166 for (i_clcb = 0, p_clcb= gap_cb.clcb; i_clcb < GAP_MAX_CL; i_clcb++, p_clcb++)
168 if (!p_clcb->in_use)
170 p_clcb->in_use = TRUE;
171 p_clcb->conn_id = conn_id;
172 p_clcb->connected = TRUE;
173 memcpy (p_clcb->bda, bda, BD_ADDR_LEN);
177 return p_clcb;
195 tGAP_CLCB *p_clcb;
202 for (i = 0, p_clcb = gap_cb.clcb; i < GAP_MAX_CL; i++, p_clcb++)
204 if (p_clcb->in_use && p_clcb->connected && !memcmp(p_clcb->bda, bd_addr, BD_ADDR_LEN) )
206 return(p_clcb->conn_id);
224 void gap_ble_enqueue_op( tGAP_CLCB * p_clcb, UINT8 op, BD_ADDR reconn_addr, UINT8 privacy_flag, void *p_cback)
238 GKI_enqueue(&p_clcb->pending_op_q, p_op);
251 static BOOLEAN gap_ble_process_pending_op(tGAP_CLCB *p_clcb)
253 tGAP_BLE_PENDING_OP *p_pending_op = (tGAP_BLE_PENDING_OP *)GKI_dequeue(&p_clcb->pending_op_q);
260 GAP_BleUpdateReconnectAddr( p_clcb->bda,
578 void gap_ble_cl_op_cmpl(tGAP_CLCB *p_clcb, BOOLEAN status, UINT16 len, UINT8 *p_name)
580 tGAP_BLE_DEV_NAME_CBACK *p_dev_name_cback = (tGAP_BLE_DEV_NAME_CBACK *)(p_clcb->p_cback);
581 UINT16 op = p_clcb->cl_op_uuid;
585 p_clcb->cl_op_uuid = 0;
586 p_clcb->p_cback=NULL;
588 if (!gap_ble_process_pending_op(p_clcb) && op != 0)
589 GATT_Disconnect(p_clcb->conn_id);
596 (* p_dev_name_cback)(status, p_clcb->bda, len, (char *)p_name);
613 tGAP_CLCB *p_clcb = gap_find_clcb_by_bd_addr (bda);
623 if (p_clcb == NULL)
625 if ((p_clcb = gap_clcb_alloc(conn_id, bda))== NULL)
631 p_clcb->conn_id = conn_id;
632 p_clcb->connected = TRUE;
640 if (p_clcb != NULL)
641 p_clcb->connected = FALSE;
644 if (p_clcb)
646 cl_op_uuid = p_clcb->cl_op_uuid;
650 if (p_clcb->connected)
652 p_clcb->cl_op_uuid = 0;
655 GAP_BleReadPeerDevName (bda, (tGAP_BLE_DEV_NAME_CBACK *)p_clcb->p_cback);
661 gap_ble_cl_op_cmpl(p_clcb, FALSE, 0, NULL);
662 memset(p_clcb, 0, sizeof(tGAP_CLCB));
680 tGAP_CLCB *p_clcb = gap_ble_find_clcb_by_conn_id(conn_id);
686 if (p_clcb == NULL)
689 op_type = p_clcb->cl_op_uuid;
698 gap_ble_cl_op_cmpl(p_clcb, FALSE, 0, NULL);
715 BTM_BleSetPrefConnParams (p_clcb->bda, min, max, latency, tout);
717 gap_ble_cl_op_cmpl(p_clcb, TRUE, 0, NULL);
725 gap_ble_cl_op_cmpl(p_clcb, TRUE, len, pp);
742 BOOLEAN gap_ble_cl_read_request(tGAP_CLCB *p_clcb, UINT16 uuid, void * p_cback)
754 if (GATTC_Read(p_clcb->conn_id, GATT_READ_BY_TYPE, ¶m) != GATT_SUCCESS)
758 GATT_Disconnect(p_clcb->conn_id);
763 p_clcb->p_cback = p_cback;
764 p_clcb->cl_op_uuid = uuid;
782 tGAP_CLCB *p_clcb;
787 if ((p_clcb = gap_find_clcb_by_bd_addr (peer_bda)) == NULL ||
788 !p_clcb->connected)
796 (peer_bda[4]<<8)+peer_bda[5], p_clcb->cl_op_uuid);
799 if (p_clcb->cl_op_uuid != 0)
802 return gap_ble_cl_read_request(p_clcb, GATT_UUID_GAP_PREF_CONN_PARAM, NULL);
817 tGAP_CLCB *p_clcb = gap_find_clcb_by_bd_addr (peer_bda);
822 if (p_clcb == NULL)
824 p_clcb = gap_clcb_alloc(0, peer_bda);
825 p_clcb->connected = FALSE;
828 if (p_clcb == NULL)
836 (peer_bda[4]<<8)+peer_bda[5], p_clcb->cl_op_uuid);
839 if (p_clcb->cl_op_uuid != 0)
843 GATT_Connect(gap_cb.gatt_if, p_clcb->bda, TRUE);
845 if (p_clcb->connected)
847 return gap_ble_cl_read_request(p_clcb, GATT_UUID_GAP_DEVICE_NAME, (void *)p_cback);
850 p_clcb->p_cback = (void *)p_cback;
852 p_clcb->cl_op_uuid = GATT_UUID_GAP_DEVICE_NAME;
869 tGAP_CLCB *p_clcb = gap_find_clcb_by_bd_addr (peer_bda);
873 (peer_bda[4]<<8)+peer_bda[5], (p_clcb == NULL)? 0 : p_clcb->cl_op_uuid);
875 if (p_clcb == NULL || p_clcb->cl_op_uuid != GATT_UUID_GAP_DEVICE_NAME)
881 if (!p_clcb->connected)
890 gap_ble_cl_op_cmpl(p_clcb, FALSE, 0, NULL);
908 tGAP_CLCB *p_clcb;
916 if ((p_clcb = gap_find_clcb_by_bd_addr (peer_bda)) == NULL ||
917 !p_clcb->connected)
925 (peer_bda[4]<<8)+peer_bda[5], p_clcb->cl_op_uuid);
928 if (p_clcb->cl_op_uuid != 0)
930 gap_ble_enqueue_op(p_clcb, GATT_UPDATE_RECONN_ADDR, reconn_addr, 0, (void *)p_cback);
935 GATT_Connect(gap_cb.gatt_if, p_clcb->bda, TRUE);
944 if (GATTC_Discover(p_clcb->conn_id, GATT_DISC_CHAR, ¶m) != GATT_SUCCESS)
948 GATT_Disconnect(p_clcb->conn_id);
953 p_clcb->p_cback = (void *)p_cback;
954 memcpy(p_clcb->reconn_addr, reconn_addr, BD_ADDR_LEN);
955 p_clcb->cl_op_uuid = GATT_UUID_GAP_RECONN_ADDR;