bta_jv_pm_conn_idle(p_cb->p_pm_cb);
break;
+ case GAP_EVT_TX_EMPTY:
+ bta_jv_pm_conn_idle(p_cb->p_pm_cb);
+ break;
+
case GAP_EVT_CONN_CONGESTED:
case GAP_EVT_CONN_UNCONGESTED:
p_cb->cong = (event == GAP_EVT_CONN_CONGESTED) ? TRUE : FALSE;
bta_jv_pm_conn_idle(p_cb->p_pm_cb);
break;
+ case GAP_EVT_TX_EMPTY:
+ bta_jv_pm_conn_idle(p_cb->p_pm_cb);
+ break;
+
case GAP_EVT_CONN_CONGESTED:
case GAP_EVT_CONN_UNCONGESTED:
p_cb->cong = (event == GAP_EVT_CONN_CONGESTED) ? TRUE : FALSE;
evt_data.status = BTA_JV_SUCCESS;
}
ls->p_cb->p_cback(BTA_JV_L2CAP_WRITE_EVT, (tBTA_JV *)&evt_data, ls->user_data);
- bta_jv_set_pm_conn_state(ls->p_cb->p_pm_cb, BTA_JV_CONN_IDLE);
} else {
/* As this pointer is checked in the API function, this occurs only when the channel is
* disconnected after the API function is called, but before the message is handled. */
static void gap_disconnect_ind (UINT16 l2cap_cid, BOOLEAN ack_needed);
static void gap_data_ind (UINT16 l2cap_cid, BT_HDR *p_msg);
static void gap_congestion_ind (UINT16 lcid, BOOLEAN is_congested);
+static void gap_tx_complete_ind (UINT16 l2cap_cid, UINT16 sdu_sent);
static tGAP_CCB *gap_find_ccb_by_cid (UINT16 cid);
static tGAP_CCB *gap_find_ccb_by_handle (UINT16 handle);
gap_cb.conn.reg_info.pL2CA_QoSViolationInd_Cb = NULL;
gap_cb.conn.reg_info.pL2CA_DataInd_Cb = gap_data_ind;
gap_cb.conn.reg_info.pL2CA_CongestionStatus_Cb = gap_congestion_ind;
- gap_cb.conn.reg_info.pL2CA_TxComplete_Cb = NULL;
+ gap_cb.conn.reg_info.pL2CA_TxComplete_Cb = gap_tx_complete_ind;
#endif
}
return (p_ccb->connection_id);
}
+/*******************************************************************************
+**
+** Function gap_tx_connect_ind
+**
+** Description Sends out GAP_EVT_TX_EMPTY when transmission has been
+** completed.
+**
+** Returns void
+**
+*******************************************************************************/
+void gap_tx_complete_ind (UINT16 l2cap_cid, UINT16 sdu_sent)
+{
+ tGAP_CCB *p_ccb = gap_find_ccb_by_cid (l2cap_cid);
+ if (p_ccb == NULL)
+ return;
+
+ if ((p_ccb->con_state == GAP_CCB_STATE_CONNECTED) && (sdu_sent == 0xFFFF))
+ {
+ GAP_TRACE_EVENT("%s: GAP_EVT_TX_EMPTY", __func__);
+ p_ccb->p_callback (p_ccb->gap_handle, GAP_EVT_TX_EMPTY);
+ }
+}
/*******************************************************************************
**
#define GAP_EVT_CONN_DATA_AVAIL 0x0102
#define GAP_EVT_CONN_CONGESTED 0x0103
#define GAP_EVT_CONN_UNCONGESTED 0x0104
+#define GAP_EVT_TX_EMPTY 0x0105
+
/* Values for 'chan_mode_mask' field */
/* GAP_ConnOpen() - optional channels to negotiate */
#define GAP_FCR_CHAN_OPT_BASIC L2CAP_FCR_CHAN_OPT_BASIC