/* release all queued indications */
while (!fixed_queue_is_empty(p_tcb->pending_ind_q))
- osi_freebuf(fixed_queue_try_dequeue(p_tcb->pending_ind_q));
+ osi_free(fixed_queue_try_dequeue(p_tcb->pending_ind_q));
fixed_queue_free(p_tcb->pending_ind_q, NULL);
p_tcb->pending_ind_q = NULL;
}
/* release all queued indications */
while (!fixed_queue_is_empty(p_tcb->pending_enc_clcb))
- osi_freebuf(fixed_queue_try_dequeue(p_tcb->pending_enc_clcb));
+ osi_free(fixed_queue_try_dequeue(p_tcb->pending_enc_clcb));
fixed_queue_free(p_tcb->pending_enc_clcb, NULL);
p_tcb->pending_enc_clcb = NULL;
}
memcpy(req.srv_chg.bda, bd_addr, BD_ADDR_LEN);
(*gatt_cb.cb_info.p_srv_chg_callback)(GATTS_SRV_CHG_CMD_REMOVE_CLIENT,&req, NULL);
}
- osi_freebuf(fixed_queue_try_remove_from_queue(gatt_cb.srv_chg_clt_q,
+ osi_free(fixed_queue_try_remove_from_queue(gatt_cb.srv_chg_clt_q,
p_buf));
}
}
*******************************************************************************/
tGATT_VALUE *gatt_add_pending_ind(tGATT_TCB *p_tcb, tGATT_VALUE *p_ind)
{
+ tGATT_VALUE *p_buf = (tGATT_VALUE *)osi_malloc(sizeof(tGATT_VALUE));
+
GATT_TRACE_DEBUG("%s", __func__);
+ GATT_TRACE_DEBUG("enqueue a pending indication");
+
+ memcpy(p_buf, p_ind, sizeof(tGATT_VALUE));
+ fixed_queue_enqueue(p_tcb->pending_ind_q, p_buf);
- tGATT_VALUE *p_buf = (tGATT_VALUE *)osi_getbuf((UINT16)sizeof(tGATT_VALUE));
- if (p_buf != NULL)
- {
- GATT_TRACE_DEBUG("enqueue a pending indication");
- memcpy(p_buf, p_ind, sizeof(tGATT_VALUE));
- fixed_queue_enqueue(p_tcb->pending_ind_q, p_buf);
- }
return p_buf;
}
-
/*******************************************************************************
**
** Function gatt_add_pending_new_srv_start
*******************************************************************************/
tGATTS_PENDING_NEW_SRV_START *gatt_add_pending_new_srv_start(tGATTS_HNDL_RANGE *p_new_srv_start)
{
+ tGATTS_PENDING_NEW_SRV_START *p_buf =
+ (tGATTS_PENDING_NEW_SRV_START *)osi_malloc(sizeof(tGATTS_PENDING_NEW_SRV_START));
+
GATT_TRACE_DEBUG("%s", __func__);
+ GATT_TRACE_DEBUG("enqueue a new pending new srv start");
+
+ p_buf->p_new_srv_start = p_new_srv_start;
+ fixed_queue_enqueue(gatt_cb.pending_new_srv_start_q, p_buf);
- tGATTS_PENDING_NEW_SRV_START *p_buf =
- (tGATTS_PENDING_NEW_SRV_START *)osi_getbuf((UINT16)sizeof(tGATTS_PENDING_NEW_SRV_START));
- if (p_buf != NULL)
- {
- GATT_TRACE_DEBUG("enqueue a new pending new srv start");
- p_buf->p_new_srv_start = p_new_srv_start;
- fixed_queue_enqueue(gatt_cb.pending_new_srv_start_q, p_buf);
- }
return p_buf;
}
*******************************************************************************/
tGATTS_SRV_CHG *gatt_add_srv_chg_clt(tGATTS_SRV_CHG *p_srv_chg)
{
- GATT_TRACE_DEBUG ("%s", __func__);
+ tGATTS_SRV_CHG *p_buf = (tGATTS_SRV_CHG *)osi_malloc(sizeof(tGATTS_SRV_CHG));
- tGATTS_SRV_CHG *p_buf = (tGATTS_SRV_CHG *)osi_getbuf((UINT16)sizeof(tGATTS_SRV_CHG));
- if (p_buf != NULL)
- {
- GATT_TRACE_DEBUG ("enqueue a srv chg client");
- memcpy(p_buf, p_srv_chg, sizeof(tGATTS_SRV_CHG));
- fixed_queue_enqueue(gatt_cb.srv_chg_clt_q, p_buf);
- }
+ GATT_TRACE_DEBUG("%s", __func__);
+ GATT_TRACE_DEBUG("enqueue a srv chg client");
+
+ memcpy(p_buf, p_srv_chg, sizeof(tGATTS_SRV_CHG));
+ fixed_queue_enqueue(gatt_cb.srv_chg_clt_q, p_buf);
return p_buf;
}
-
/*******************************************************************************
**
** Function gatt_alloc_hdl_buffer
if (p)
{
while (!fixed_queue_is_empty(p->svc_db.svc_buffer))
- osi_freebuf(fixed_queue_try_dequeue(p->svc_db.svc_buffer));
+ osi_free(fixed_queue_try_dequeue(p->svc_db.svc_buffer));
fixed_queue_free(p->svc_db.svc_buffer, NULL);
memset(p, 0, sizeof(tGATT_HDL_LIST_ELEM));
}
if (memcmp(p_app_id, &p_elem->asgn_range.app_uuid128, sizeof(tBT_UUID)) == 0)
{
while (!fixed_queue_is_empty(p_elem->svc_db.svc_buffer))
- osi_freebuf(fixed_queue_try_dequeue(p_elem->svc_db.svc_buffer));
+ osi_free(fixed_queue_try_dequeue(p_elem->svc_db.svc_buffer));
fixed_queue_free(p_elem->svc_db.svc_buffer, NULL);
p_elem->svc_db.svc_buffer = NULL;
p_tcb->pending_ind_q = fixed_queue_new(SIZE_MAX);
p_tcb->conf_timer = alarm_new("gatt.conf_timer");
p_tcb->ind_ack_timer = alarm_new("gatt.ind_ack_timer");
- p_tcb->sr_cmd.multi_rsp_q = fixed_queue_new(SIZE_MAX);
p_tcb->in_use = TRUE;
p_tcb->tcb_idx = i;
p_tcb->transport = transport;
}
}
- osi_freebuf_and_reset((void **)&p_clcb->p_attr_buf);
+ osi_free_and_reset((void **)&p_clcb->p_attr_buf);
operation = p_clcb->operation;
conn_id = p_clcb->conn_id;
gatt_free_pending_ind(p_tcb);
gatt_free_pending_enc_queue(p_tcb);
fixed_queue_free(p_tcb->sr_cmd.multi_rsp_q, NULL);
+ p_tcb->sr_cmd.multi_rsp_q = NULL;
for (i = 0; i < GATT_MAX_APPS; i ++)
{
bt_uuid.uu.uuid128[1], bt_uuid.uu.uuid128[0]);
}
else
- BCM_STRNCPY_S(str_buf, sizeof(str_buf), "Unknown UUID 0", 15);
+ strlcpy(str_buf, "Unknown UUID 0", sizeof(str_buf));
GATT_TRACE_DEBUG ("UUID=[%s]", str_buf);
-
}
*******************************************************************************/
tGATT_PENDING_ENC_CLCB* gatt_add_pending_enc_channel_clcb(tGATT_TCB *p_tcb, tGATT_CLCB *p_clcb)
{
- GATT_TRACE_DEBUG ("gatt_add_pending_new_srv_start");
-
tGATT_PENDING_ENC_CLCB *p_buf =
- (tGATT_PENDING_ENC_CLCB *)osi_getbuf((UINT16)sizeof(tGATT_PENDING_ENC_CLCB));
- if (p_buf != NULL)
- {
- GATT_TRACE_DEBUG("enqueue a new pending encryption channel clcb");
- p_buf->p_clcb = p_clcb;
- fixed_queue_enqueue(p_tcb->pending_enc_clcb, p_buf);
- }
+ (tGATT_PENDING_ENC_CLCB *)osi_malloc(sizeof(tGATT_PENDING_ENC_CLCB));
+
+ GATT_TRACE_DEBUG ("%s", __func__);
+ GATT_TRACE_DEBUG("enqueue a new pending encryption channel clcb");
+
+ p_buf->p_clcb = p_clcb;
+ fixed_queue_enqueue(p_tcb->pending_enc_clcb, p_buf);
+
return p_buf;
}
/*******************************************************************************