mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-09 07:34:32 +02:00
Split jv_rfcomm and jv_l2cap
This commit is contained in:
@@ -151,6 +151,7 @@ typedef UINT8 tBTA_JV_CONN_STATE;
|
|||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
|
||||||
/* events received by tBTA_JV_RFCOMM_CBACK */
|
/* events received by tBTA_JV_RFCOMM_CBACK */
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
#define BTA_JV_RFCOMM_OPEN_EVT 26 /* open status of RFCOMM Client connection */
|
#define BTA_JV_RFCOMM_OPEN_EVT 26 /* open status of RFCOMM Client connection */
|
||||||
#define BTA_JV_RFCOMM_CLOSE_EVT 27 /* RFCOMM connection closed */
|
#define BTA_JV_RFCOMM_CLOSE_EVT 27 /* RFCOMM connection closed */
|
||||||
#define BTA_JV_RFCOMM_START_EVT 28 /* RFCOMM server started */
|
#define BTA_JV_RFCOMM_START_EVT 28 /* RFCOMM server started */
|
||||||
@@ -160,6 +161,7 @@ typedef UINT8 tBTA_JV_CONN_STATE;
|
|||||||
#define BTA_JV_RFCOMM_READ_EVT 32 /* the result for BTA_JvRfcommRead */
|
#define BTA_JV_RFCOMM_READ_EVT 32 /* the result for BTA_JvRfcommRead */
|
||||||
#define BTA_JV_RFCOMM_WRITE_EVT 33 /* the result for BTA_JvRfcommWrite*/
|
#define BTA_JV_RFCOMM_WRITE_EVT 33 /* the result for BTA_JvRfcommWrite*/
|
||||||
#define BTA_JV_RFCOMM_SRV_OPEN_EVT 34 /* open status of Server RFCOMM connection */
|
#define BTA_JV_RFCOMM_SRV_OPEN_EVT 34 /* open status of Server RFCOMM connection */
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
#define BTA_JV_FREE_SCN_EVT 35 /* FREE an SCN */
|
#define BTA_JV_FREE_SCN_EVT 35 /* FREE an SCN */
|
||||||
#define BTA_JV_MAX_EVT 36 /* max number of JV events */
|
#define BTA_JV_MAX_EVT 36 /* max number of JV events */
|
||||||
|
|
||||||
@@ -280,6 +282,7 @@ typedef struct {
|
|||||||
} tBTA_JV_L2CAP_WRITE_FIXED;
|
} tBTA_JV_L2CAP_WRITE_FIXED;
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
/* data associated with BTA_JV_RFCOMM_OPEN_EVT */
|
/* data associated with BTA_JV_RFCOMM_OPEN_EVT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
|
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
|
||||||
@@ -321,12 +324,6 @@ typedef struct {
|
|||||||
BOOLEAN use_co; /* TRUE to use co_rfc_data */
|
BOOLEAN use_co; /* TRUE to use co_rfc_data */
|
||||||
} tBTA_JV_RFCOMM_CL_INIT;
|
} tBTA_JV_RFCOMM_CL_INIT;
|
||||||
|
|
||||||
/*data associated with BTA_JV_L2CAP_DATA_IND_EVT & BTA_JV_RFCOMM_DATA_IND_EVT */
|
|
||||||
typedef struct {
|
|
||||||
UINT32 handle; /* The connection handle */
|
|
||||||
BT_HDR *p_buf; /* The incoming data */
|
|
||||||
} tBTA_JV_DATA_IND;
|
|
||||||
|
|
||||||
/* data associated with BTA_JV_RFCOMM_CONG_EVT */
|
/* data associated with BTA_JV_RFCOMM_CONG_EVT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
|
tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
|
||||||
@@ -353,6 +350,13 @@ typedef struct {
|
|||||||
BOOLEAN cong; /* congestion status */
|
BOOLEAN cong; /* congestion status */
|
||||||
BOOLEAN old_cong; /* congestion status */
|
BOOLEAN old_cong; /* congestion status */
|
||||||
} tBTA_JV_RFCOMM_WRITE;
|
} tBTA_JV_RFCOMM_WRITE;
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
|
/*data associated with BTA_JV_L2CAP_DATA_IND_EVT & BTA_JV_RFCOMM_DATA_IND_EVT */
|
||||||
|
typedef struct {
|
||||||
|
UINT32 handle; /* The connection handle */
|
||||||
|
BT_HDR *p_buf; /* The incoming data */
|
||||||
|
} tBTA_JV_DATA_IND;
|
||||||
|
|
||||||
/* data associated with BTA_JV_API_SET_PM_PROFILE_EVT */
|
/* data associated with BTA_JV_API_SET_PM_PROFILE_EVT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -404,6 +408,7 @@ typedef union {
|
|||||||
tBTA_JV_L2CAP_READ l2c_read; /* BTA_JV_L2CAP_READ_EVT */
|
tBTA_JV_L2CAP_READ l2c_read; /* BTA_JV_L2CAP_READ_EVT */
|
||||||
tBTA_JV_L2CAP_WRITE l2c_write; /* BTA_JV_L2CAP_WRITE_EVT */
|
tBTA_JV_L2CAP_WRITE l2c_write; /* BTA_JV_L2CAP_WRITE_EVT */
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
tBTA_JV_RFCOMM_OPEN rfc_open; /* BTA_JV_RFCOMM_OPEN_EVT */
|
tBTA_JV_RFCOMM_OPEN rfc_open; /* BTA_JV_RFCOMM_OPEN_EVT */
|
||||||
tBTA_JV_RFCOMM_SRV_OPEN rfc_srv_open; /* BTA_JV_RFCOMM_SRV_OPEN_EVT */
|
tBTA_JV_RFCOMM_SRV_OPEN rfc_srv_open; /* BTA_JV_RFCOMM_SRV_OPEN_EVT */
|
||||||
tBTA_JV_RFCOMM_CLOSE rfc_close; /* BTA_JV_RFCOMM_CLOSE_EVT */
|
tBTA_JV_RFCOMM_CLOSE rfc_close; /* BTA_JV_RFCOMM_CLOSE_EVT */
|
||||||
@@ -412,6 +417,7 @@ typedef union {
|
|||||||
tBTA_JV_RFCOMM_CONG rfc_cong; /* BTA_JV_RFCOMM_CONG_EVT */
|
tBTA_JV_RFCOMM_CONG rfc_cong; /* BTA_JV_RFCOMM_CONG_EVT */
|
||||||
tBTA_JV_RFCOMM_READ rfc_read; /* BTA_JV_RFCOMM_READ_EVT */
|
tBTA_JV_RFCOMM_READ rfc_read; /* BTA_JV_RFCOMM_READ_EVT */
|
||||||
tBTA_JV_RFCOMM_WRITE rfc_write; /* BTA_JV_RFCOMM_WRITE_EVT */
|
tBTA_JV_RFCOMM_WRITE rfc_write; /* BTA_JV_RFCOMM_WRITE_EVT */
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
tBTA_JV_DATA_IND data_ind; /* BTA_JV_L2CAP_DATA_IND_EVT
|
tBTA_JV_DATA_IND data_ind; /* BTA_JV_L2CAP_DATA_IND_EVT
|
||||||
BTA_JV_RFCOMM_DATA_IND_EVT */
|
BTA_JV_RFCOMM_DATA_IND_EVT */
|
||||||
tBTA_JV_FREE_SCN free_scn; /* BTA_JV_FREE_SCN_EVT */
|
tBTA_JV_FREE_SCN free_scn; /* BTA_JV_FREE_SCN_EVT */
|
||||||
@@ -795,6 +801,7 @@ extern tBTA_JV_STATUS BTA_JvL2capWriteFixed(UINT16 channel, BD_ADDR *addr, UINT3
|
|||||||
UINT8 *p_data, UINT16 len, void *user_data);
|
UINT8 *p_data, UINT16 len, void *user_data);
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function BTA_JvRfcommConnect
|
** Function BTA_JvRfcommConnect
|
||||||
@@ -911,6 +918,19 @@ extern tBTA_JV_STATUS BTA_JvRfcommWrite(UINT32 handle, UINT32 req_id, int len, U
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
extern tBTA_JV_STATUS BTA_JvRfcommFlowControl(UINT32 handle, UINT16 credits_given);
|
extern tBTA_JV_STATUS BTA_JvRfcommFlowControl(UINT32 handle, UINT16 credits_given);
|
||||||
|
|
||||||
|
/*******************************************************************************
|
||||||
|
**
|
||||||
|
** Function BTA_JvRfcommGetPortHdl
|
||||||
|
**
|
||||||
|
** Description This function fetches the rfcomm port handle
|
||||||
|
**
|
||||||
|
** Returns BTA_JV_SUCCESS, if the request is being processed.
|
||||||
|
** BTA_JV_FAILURE, otherwise.
|
||||||
|
**
|
||||||
|
*******************************************************************************/
|
||||||
|
UINT16 BTA_JvRfcommGetPortHdl(UINT32 handle);
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function BTA_JVSetPmProfile
|
** Function BTA_JVSetPmProfile
|
||||||
@@ -932,17 +952,5 @@ extern tBTA_JV_STATUS BTA_JvRfcommFlowControl(UINT32 handle, UINT16 credits_give
|
|||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
extern tBTA_JV_STATUS BTA_JvSetPmProfile(UINT32 handle, tBTA_JV_PM_ID app_id, tBTA_JV_CONN_STATE init_st);
|
extern tBTA_JV_STATUS BTA_JvSetPmProfile(UINT32 handle, tBTA_JV_PM_ID app_id, tBTA_JV_CONN_STATE init_st);
|
||||||
|
|
||||||
/*******************************************************************************
|
|
||||||
**
|
|
||||||
** Function BTA_JvRfcommGetPortHdl
|
|
||||||
**
|
|
||||||
** Description This function fetches the rfcomm port handle
|
|
||||||
**
|
|
||||||
** Returns BTA_JV_SUCCESS, if the request is being processed.
|
|
||||||
** BTA_JV_FAILURE, otherwise.
|
|
||||||
**
|
|
||||||
*******************************************************************************/
|
|
||||||
UINT16 BTA_JvRfcommGetPortHdl(UINT32 handle);
|
|
||||||
|
|
||||||
#endif ///defined BTA_JV_INCLUDED && BTA_JV_INCLUDED == TRUE
|
#endif ///defined BTA_JV_INCLUDED && BTA_JV_INCLUDED == TRUE
|
||||||
#endif /* BTA_JV_API_H */
|
#endif /* BTA_JV_API_H */
|
||||||
|
@@ -107,17 +107,19 @@ static inline void logu(const char *title, const uint8_t *p_uuid)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static tBTA_JV_PCB *bta_jv_add_rfc_port(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pcb_open);
|
|
||||||
static tBTA_JV_STATUS bta_jv_free_set_pm_profile_cb(UINT32 jv_handle);
|
static tBTA_JV_STATUS bta_jv_free_set_pm_profile_cb(UINT32 jv_handle);
|
||||||
static void bta_jv_pm_conn_busy(tBTA_JV_PM_CB *p_cb);
|
static void bta_jv_pm_conn_busy(tBTA_JV_PM_CB *p_cb);
|
||||||
static void bta_jv_pm_conn_idle(tBTA_JV_PM_CB *p_cb);
|
static void bta_jv_pm_conn_idle(tBTA_JV_PM_CB *p_cb);
|
||||||
static void bta_jv_pm_state_change(tBTA_JV_PM_CB *p_cb, const tBTA_JV_CONN_STATE state);
|
static void bta_jv_pm_state_change(tBTA_JV_PM_CB *p_cb, const tBTA_JV_CONN_STATE state);
|
||||||
tBTA_JV_STATUS bta_jv_set_pm_conn_state(tBTA_JV_PM_CB *p_cb, const tBTA_JV_CONN_STATE new_st);
|
tBTA_JV_STATUS bta_jv_set_pm_conn_state(tBTA_JV_PM_CB *p_cb, const tBTA_JV_CONN_STATE new_st);
|
||||||
|
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
|
static tBTA_JV_PCB *bta_jv_add_rfc_port(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pcb_open);
|
||||||
static int find_rfc_pcb(void *user_data, tBTA_JV_RFC_CB **cb, tBTA_JV_PCB **pcb);
|
static int find_rfc_pcb(void *user_data, tBTA_JV_RFC_CB **cb, tBTA_JV_PCB **pcb);
|
||||||
static void bta_jv_port_mgmt_sr_cback(UINT32 code, UINT16 port_handle, void* data);
|
static void bta_jv_port_mgmt_sr_cback(UINT32 code, UINT16 port_handle, void* data);
|
||||||
static void bta_jv_port_event_sr_cback(UINT32 code, UINT16 port_handle);
|
static void bta_jv_port_event_sr_cback(UINT32 code, UINT16 port_handle);
|
||||||
static int bta_jv_port_data_co_cback(UINT16 port_handle, UINT8 *buf, UINT16 len, int type);
|
static int bta_jv_port_data_co_cback(UINT16 port_handle, UINT8 *buf, UINT16 len, int type);
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function bta_jv_alloc_sec_id
|
** Function bta_jv_alloc_sec_id
|
||||||
@@ -156,6 +158,7 @@ UNUSED_ATTR static int get_sec_id_used(void)
|
|||||||
}
|
}
|
||||||
return used;
|
return used;
|
||||||
}
|
}
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
UNUSED_ATTR static int get_rfc_cb_used(void)
|
UNUSED_ATTR static int get_rfc_cb_used(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@@ -171,6 +174,7 @@ UNUSED_ATTR static int get_rfc_cb_used(void)
|
|||||||
}
|
}
|
||||||
return used;
|
return used;
|
||||||
}
|
}
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
@@ -191,6 +195,7 @@ static void bta_jv_free_sec_id(UINT8 *p_sec_id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function bta_jv_alloc_rfc_cb
|
** Function bta_jv_alloc_rfc_cb
|
||||||
@@ -431,6 +436,8 @@ static tBTA_JV_STATUS bta_jv_free_rfc_cb(tBTA_JV_RFC_CB *p_cb, tBTA_JV_PCB *p_pc
|
|||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
#if BTA_JV_L2CAP_INCLUDED
|
#if BTA_JV_L2CAP_INCLUDED
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
@@ -525,6 +532,7 @@ static tBTA_JV_STATUS bta_jv_free_set_pm_profile_cb(UINT32 jv_handle)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (BTA_JV_RFCOMM_MASK & jv_handle) {
|
if (BTA_JV_RFCOMM_MASK & jv_handle) {
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
UINT32 hi = ((jv_handle & BTA_JV_RFC_HDL_MASK) & ~BTA_JV_RFCOMM_MASK) - 1;
|
UINT32 hi = ((jv_handle & BTA_JV_RFC_HDL_MASK) & ~BTA_JV_RFCOMM_MASK) - 1;
|
||||||
UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(jv_handle);
|
UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(jv_handle);
|
||||||
if (hi < BTA_JV_MAX_RFC_CONN && bta_jv_cb.rfc_cb[hi].p_cback && si
|
if (hi < BTA_JV_MAX_RFC_CONN && bta_jv_cb.rfc_cb[hi].p_cback && si
|
||||||
@@ -538,6 +546,7 @@ static tBTA_JV_STATUS bta_jv_free_set_pm_profile_cb(UINT32 jv_handle)
|
|||||||
p_cb = &p_pcb->p_pm_cb;
|
p_cb = &p_pcb->p_pm_cb;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
}
|
}
|
||||||
#if BTA_JV_L2CAP_INCLUDED
|
#if BTA_JV_L2CAP_INCLUDED
|
||||||
else {
|
else {
|
||||||
@@ -582,6 +591,7 @@ static tBTA_JV_PM_CB *bta_jv_alloc_set_pm_profile_cb(UINT32 jv_handle, tBTA_JV_P
|
|||||||
if (bta_jv_cb.pm_cb[i].state == BTA_JV_PM_FREE_ST) {
|
if (bta_jv_cb.pm_cb[i].state == BTA_JV_PM_FREE_ST) {
|
||||||
/* rfc handle bd addr retrieval requires core stack handle */
|
/* rfc handle bd addr retrieval requires core stack handle */
|
||||||
if (bRfcHandle) {
|
if (bRfcHandle) {
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
// UINT32 hi = ((jv_handle & BTA_JV_RFC_HDL_MASK) & ~BTA_JV_RFCOMM_MASK) - 1;
|
// UINT32 hi = ((jv_handle & BTA_JV_RFC_HDL_MASK) & ~BTA_JV_RFCOMM_MASK) - 1;
|
||||||
// UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(jv_handle);
|
// UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(jv_handle);
|
||||||
for (j = 0; j < BTA_JV_MAX_RFC_CONN; j++) {
|
for (j = 0; j < BTA_JV_MAX_RFC_CONN; j++) {
|
||||||
@@ -594,6 +604,7 @@ static tBTA_JV_PM_CB *bta_jv_alloc_set_pm_profile_cb(UINT32 jv_handle, tBTA_JV_P
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
}
|
}
|
||||||
#if BTA_JV_L2CAP_INCLUDED
|
#if BTA_JV_L2CAP_INCLUDED
|
||||||
else {
|
else {
|
||||||
@@ -855,11 +866,14 @@ void bta_jv_free_scn(tBTA_JV_MSG *p_data)
|
|||||||
};
|
};
|
||||||
|
|
||||||
tBTA_JV_FREE_SCN_USER_DATA *user_data = NULL;
|
tBTA_JV_FREE_SCN_USER_DATA *user_data = NULL;
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
tBTA_JV_RFC_CB *p_cb = NULL;
|
tBTA_JV_RFC_CB *p_cb = NULL;
|
||||||
tBTA_JV_PCB *p_pcb = NULL;
|
tBTA_JV_PCB *p_pcb = NULL;
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
switch (p_data->free_channel.type) {
|
switch (p_data->free_channel.type) {
|
||||||
case BTA_JV_CONN_TYPE_RFCOMM: {
|
case BTA_JV_CONN_TYPE_RFCOMM: {
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
if (scn > 0 && scn <= BTA_JV_MAX_SCN && bta_jv_cb.scn[scn - 1]) {
|
if (scn > 0 && scn <= BTA_JV_MAX_SCN && bta_jv_cb.scn[scn - 1]) {
|
||||||
/* this scn is used by JV */
|
/* this scn is used by JV */
|
||||||
bta_jv_cb.scn[scn - 1] = FALSE;
|
bta_jv_cb.scn[scn - 1] = FALSE;
|
||||||
@@ -877,6 +891,7 @@ void bta_jv_free_scn(tBTA_JV_MSG *p_data)
|
|||||||
fc->p_cback(BTA_JV_FREE_SCN_EVT, (tBTA_JV *)&evt_data, (void *)user_data);
|
fc->p_cback(BTA_JV_FREE_SCN_EVT, (tBTA_JV *)&evt_data, (void *)user_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case BTA_JV_CONN_TYPE_L2CAP:
|
case BTA_JV_CONN_TYPE_L2CAP:
|
||||||
@@ -1615,6 +1630,7 @@ void bta_jv_l2cap_write_fixed(tBTA_JV_MSG *p_data)
|
|||||||
}
|
}
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function bta_jv_port_data_co_cback
|
** Function bta_jv_port_data_co_cback
|
||||||
@@ -2345,6 +2361,7 @@ void bta_jv_rfcomm_flow_control(tBTA_JV_MSG *p_data)
|
|||||||
tBTA_JV_PCB *p_pcb = fc->p_pcb;
|
tBTA_JV_PCB *p_pcb = fc->p_pcb;
|
||||||
PORT_FlowControl_GiveCredit(p_pcb->port_handle, TRUE, fc->credits_given);
|
PORT_FlowControl_GiveCredit(p_pcb->port_handle, TRUE, fc->credits_given);
|
||||||
}
|
}
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
|
@@ -861,6 +861,7 @@ tBTA_JV_STATUS BTA_JvL2capWriteFixed(UINT16 channel, BD_ADDR *addr, UINT32 req_i
|
|||||||
}
|
}
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
** Function BTA_JvRfcommConnect
|
** Function BTA_JvRfcommConnect
|
||||||
@@ -1166,6 +1167,7 @@ tBTA_JV_STATUS BTA_JvRfcommFlowControl(UINT32 handle, UINT16 credits_given)
|
|||||||
}
|
}
|
||||||
return (status);
|
return (status);
|
||||||
}
|
}
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
**
|
**
|
||||||
|
@@ -62,6 +62,7 @@ const tBTA_JV_ACTION bta_jv_action[] = {
|
|||||||
bta_jv_l2cap_read, /* BTA_JV_API_L2CAP_READ_EVT */
|
bta_jv_l2cap_read, /* BTA_JV_API_L2CAP_READ_EVT */
|
||||||
bta_jv_l2cap_write, /* BTA_JV_API_L2CAP_WRITE_EVT */
|
bta_jv_l2cap_write, /* BTA_JV_API_L2CAP_WRITE_EVT */
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
bta_jv_rfcomm_connect, /* BTA_JV_API_RFCOMM_CONNECT_EVT */
|
bta_jv_rfcomm_connect, /* BTA_JV_API_RFCOMM_CONNECT_EVT */
|
||||||
bta_jv_rfcomm_close, /* BTA_JV_API_RFCOMM_CLOSE_EVT */
|
bta_jv_rfcomm_close, /* BTA_JV_API_RFCOMM_CLOSE_EVT */
|
||||||
bta_jv_rfcomm_start_server, /* BTA_JV_API_RFCOMM_START_SERVER_EVT */
|
bta_jv_rfcomm_start_server, /* BTA_JV_API_RFCOMM_START_SERVER_EVT */
|
||||||
@@ -69,6 +70,7 @@ const tBTA_JV_ACTION bta_jv_action[] = {
|
|||||||
bta_jv_rfcomm_read, /* BTA_JV_API_RFCOMM_READ_EVT */
|
bta_jv_rfcomm_read, /* BTA_JV_API_RFCOMM_READ_EVT */
|
||||||
bta_jv_rfcomm_write, /* BTA_JV_API_RFCOMM_WRITE_EVT */
|
bta_jv_rfcomm_write, /* BTA_JV_API_RFCOMM_WRITE_EVT */
|
||||||
bta_jv_rfcomm_flow_control, /* BTA_JV_API_RFCOMM_FLOW_CONTROL_EVT */
|
bta_jv_rfcomm_flow_control, /* BTA_JV_API_RFCOMM_FLOW_CONTROL_EVT */
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
bta_jv_set_pm_profile, /* BTA_JV_API_SET_PM_PROFILE_EVT */
|
bta_jv_set_pm_profile, /* BTA_JV_API_SET_PM_PROFILE_EVT */
|
||||||
bta_jv_change_pm_state, /* BTA_JV_API_PM_STATE_CHANGE_EVT */
|
bta_jv_change_pm_state, /* BTA_JV_API_PM_STATE_CHANGE_EVT */
|
||||||
#if BTA_JV_L2CAP_INCLUDED
|
#if BTA_JV_L2CAP_INCLUDED
|
||||||
|
@@ -56,6 +56,7 @@ enum {
|
|||||||
BTA_JV_API_L2CAP_READ_EVT,
|
BTA_JV_API_L2CAP_READ_EVT,
|
||||||
BTA_JV_API_L2CAP_WRITE_EVT,
|
BTA_JV_API_L2CAP_WRITE_EVT,
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
BTA_JV_API_RFCOMM_CONNECT_EVT,
|
BTA_JV_API_RFCOMM_CONNECT_EVT,
|
||||||
BTA_JV_API_RFCOMM_CLOSE_EVT,
|
BTA_JV_API_RFCOMM_CLOSE_EVT,
|
||||||
BTA_JV_API_RFCOMM_START_SERVER_EVT,
|
BTA_JV_API_RFCOMM_START_SERVER_EVT,
|
||||||
@@ -63,6 +64,7 @@ enum {
|
|||||||
BTA_JV_API_RFCOMM_READ_EVT,
|
BTA_JV_API_RFCOMM_READ_EVT,
|
||||||
BTA_JV_API_RFCOMM_WRITE_EVT,
|
BTA_JV_API_RFCOMM_WRITE_EVT,
|
||||||
BTA_JV_API_RFCOMM_FLOW_CONTROL_EVT,
|
BTA_JV_API_RFCOMM_FLOW_CONTROL_EVT,
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
BTA_JV_API_SET_PM_PROFILE_EVT,
|
BTA_JV_API_SET_PM_PROFILE_EVT,
|
||||||
BTA_JV_API_PM_STATE_CHANGE_EVT,
|
BTA_JV_API_PM_STATE_CHANGE_EVT,
|
||||||
#if BTA_JV_L2CAP_INCLUDED
|
#if BTA_JV_L2CAP_INCLUDED
|
||||||
@@ -159,6 +161,7 @@ typedef struct {
|
|||||||
tBTA_JV_PM_CB *p_pm_cb; /* ptr to pm control block, NULL: unused */
|
tBTA_JV_PM_CB *p_pm_cb; /* ptr to pm control block, NULL: unused */
|
||||||
} tBTA_JV_PCB;
|
} tBTA_JV_PCB;
|
||||||
|
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
/* JV RFCOMM control block */
|
/* JV RFCOMM control block */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
tBTA_JV_RFCOMM_CBACK *p_cback; /* the callback function */
|
tBTA_JV_RFCOMM_CBACK *p_cback; /* the callback function */
|
||||||
@@ -169,6 +172,7 @@ typedef struct {
|
|||||||
UINT8 max_sess; /* max sessions */
|
UINT8 max_sess; /* max sessions */
|
||||||
int curr_sess; /* current sessions count*/
|
int curr_sess; /* current sessions count*/
|
||||||
} tBTA_JV_RFC_CB;
|
} tBTA_JV_RFC_CB;
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
#if BTA_JV_L2CAP_INCLUDED
|
#if BTA_JV_L2CAP_INCLUDED
|
||||||
/* data type for BTA_JV_API_L2CAP_CONNECT_EVT & BTA_JV_API_L2CAP_CONNECT_LE_EVT */
|
/* data type for BTA_JV_API_L2CAP_CONNECT_EVT & BTA_JV_API_L2CAP_CONNECT_LE_EVT */
|
||||||
@@ -252,6 +256,7 @@ typedef struct {
|
|||||||
} tBTA_JV_API_L2CAP_WRITE_FIXED;
|
} tBTA_JV_API_L2CAP_WRITE_FIXED;
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
/* data type for BTA_JV_API_RFCOMM_CONNECT_EVT */
|
/* data type for BTA_JV_API_RFCOMM_CONNECT_EVT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BT_HDR hdr;
|
BT_HDR hdr;
|
||||||
@@ -285,6 +290,7 @@ typedef struct {
|
|||||||
tBTA_JV_RFC_CB *p_cb;
|
tBTA_JV_RFC_CB *p_cb;
|
||||||
tBTA_JV_PCB *p_pcb;
|
tBTA_JV_PCB *p_pcb;
|
||||||
} tBTA_JV_API_RFCOMM_READ;
|
} tBTA_JV_API_RFCOMM_READ;
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
/* data type for BTA_JV_API_SET_PM_PROFILE_EVT */
|
/* data type for BTA_JV_API_SET_PM_PROFILE_EVT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -301,6 +307,7 @@ typedef struct {
|
|||||||
tBTA_JV_CONN_STATE state;
|
tBTA_JV_CONN_STATE state;
|
||||||
} tBTA_JV_API_PM_STATE_CHANGE;
|
} tBTA_JV_API_PM_STATE_CHANGE;
|
||||||
|
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
/* data type for BTA_JV_API_RFCOMM_WRITE_EVT */
|
/* data type for BTA_JV_API_RFCOMM_WRITE_EVT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
BT_HDR hdr;
|
BT_HDR hdr;
|
||||||
@@ -329,6 +336,7 @@ typedef struct {
|
|||||||
tBTA_JV_RFCOMM_CBACK *p_cback;
|
tBTA_JV_RFCOMM_CBACK *p_cback;
|
||||||
void *user_data;
|
void *user_data;
|
||||||
} tBTA_JV_API_RFCOMM_CLOSE;
|
} tBTA_JV_API_RFCOMM_CLOSE;
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
|
||||||
/* data type for BTA_JV_API_CREATE_RECORD_EVT */
|
/* data type for BTA_JV_API_CREATE_RECORD_EVT */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -383,14 +391,16 @@ typedef union {
|
|||||||
tBTA_JV_API_L2CAP_SERVER l2cap_server;
|
tBTA_JV_API_L2CAP_SERVER l2cap_server;
|
||||||
tBTA_JV_API_L2CAP_WRITE_FIXED l2cap_write_fixed;
|
tBTA_JV_API_L2CAP_WRITE_FIXED l2cap_write_fixed;
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
tBTA_JV_API_RFCOMM_CONNECT rfcomm_connect;
|
tBTA_JV_API_RFCOMM_CONNECT rfcomm_connect;
|
||||||
tBTA_JV_API_RFCOMM_READ rfcomm_read;
|
tBTA_JV_API_RFCOMM_READ rfcomm_read;
|
||||||
tBTA_JV_API_RFCOMM_WRITE rfcomm_write;
|
tBTA_JV_API_RFCOMM_WRITE rfcomm_write;
|
||||||
tBTA_JV_API_RFCOMM_FLOW_CONTROL rfcomm_fc;
|
tBTA_JV_API_RFCOMM_FLOW_CONTROL rfcomm_fc;
|
||||||
tBTA_JV_API_SET_PM_PROFILE set_pm;
|
|
||||||
tBTA_JV_API_PM_STATE_CHANGE change_pm_state;
|
|
||||||
tBTA_JV_API_RFCOMM_CLOSE rfcomm_close;
|
tBTA_JV_API_RFCOMM_CLOSE rfcomm_close;
|
||||||
tBTA_JV_API_RFCOMM_SERVER rfcomm_server;
|
tBTA_JV_API_RFCOMM_SERVER rfcomm_server;
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
|
tBTA_JV_API_SET_PM_PROFILE set_pm;
|
||||||
|
tBTA_JV_API_PM_STATE_CHANGE change_pm_state;
|
||||||
} tBTA_JV_MSG;
|
} tBTA_JV_MSG;
|
||||||
|
|
||||||
/* JV control block */
|
/* JV control block */
|
||||||
@@ -404,7 +414,9 @@ typedef struct {
|
|||||||
#if BTA_JV_L2CAP_INCLUDED
|
#if BTA_JV_L2CAP_INCLUDED
|
||||||
tBTA_JV_L2C_CB l2c_cb[BTA_JV_MAX_L2C_CONN]; /* index is GAP handle (index) */
|
tBTA_JV_L2C_CB l2c_cb[BTA_JV_MAX_L2C_CONN]; /* index is GAP handle (index) */
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
tBTA_JV_RFC_CB rfc_cb[BTA_JV_MAX_RFC_CONN];
|
tBTA_JV_RFC_CB rfc_cb[BTA_JV_MAX_RFC_CONN];
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
tBTA_JV_PCB port_cb[MAX_RFC_PORTS]; /* index of this array is
|
tBTA_JV_PCB port_cb[MAX_RFC_PORTS]; /* index of this array is
|
||||||
the port_handle, */
|
the port_handle, */
|
||||||
UINT8 sec_id[BTA_JV_NUM_SERVICE_ID]; /* service ID */
|
UINT8 sec_id[BTA_JV_NUM_SERVICE_ID]; /* service ID */
|
||||||
@@ -450,6 +462,7 @@ extern void bta_jv_l2cap_stop_server (tBTA_JV_MSG *p_data);
|
|||||||
extern void bta_jv_l2cap_read (tBTA_JV_MSG *p_data);
|
extern void bta_jv_l2cap_read (tBTA_JV_MSG *p_data);
|
||||||
extern void bta_jv_l2cap_write (tBTA_JV_MSG *p_data);
|
extern void bta_jv_l2cap_write (tBTA_JV_MSG *p_data);
|
||||||
#endif /* BTA_JV_L2CAP_INCLUDED */
|
#endif /* BTA_JV_L2CAP_INCLUDED */
|
||||||
|
#if BTA_JV_RFCOMM_INCLUDED
|
||||||
extern void bta_jv_rfcomm_connect (tBTA_JV_MSG *p_data);
|
extern void bta_jv_rfcomm_connect (tBTA_JV_MSG *p_data);
|
||||||
extern void bta_jv_rfcomm_close (tBTA_JV_MSG *p_data);
|
extern void bta_jv_rfcomm_close (tBTA_JV_MSG *p_data);
|
||||||
extern void bta_jv_rfcomm_start_server (tBTA_JV_MSG *p_data);
|
extern void bta_jv_rfcomm_start_server (tBTA_JV_MSG *p_data);
|
||||||
@@ -457,6 +470,7 @@ extern void bta_jv_rfcomm_stop_server (tBTA_JV_MSG *p_data);
|
|||||||
extern void bta_jv_rfcomm_read (tBTA_JV_MSG *p_data);
|
extern void bta_jv_rfcomm_read (tBTA_JV_MSG *p_data);
|
||||||
extern void bta_jv_rfcomm_write (tBTA_JV_MSG *p_data);
|
extern void bta_jv_rfcomm_write (tBTA_JV_MSG *p_data);
|
||||||
extern void bta_jv_rfcomm_flow_control(tBTA_JV_MSG *p_data);
|
extern void bta_jv_rfcomm_flow_control(tBTA_JV_MSG *p_data);
|
||||||
|
#endif /* BTA_JV_RFCOMM_INCLUDED */
|
||||||
extern void bta_jv_set_pm_profile (tBTA_JV_MSG *p_data);
|
extern void bta_jv_set_pm_profile (tBTA_JV_MSG *p_data);
|
||||||
extern void bta_jv_change_pm_state(tBTA_JV_MSG *p_data);
|
extern void bta_jv_change_pm_state(tBTA_JV_MSG *p_data);
|
||||||
#if BTA_JV_L2CAP_INCLUDED
|
#if BTA_JV_L2CAP_INCLUDED
|
||||||
|
@@ -80,12 +80,12 @@
|
|||||||
#if (UC_BT_SPP_ENABLED == TRUE)
|
#if (UC_BT_SPP_ENABLED == TRUE)
|
||||||
#define RFCOMM_INCLUDED TRUE
|
#define RFCOMM_INCLUDED TRUE
|
||||||
#define BTA_JV_INCLUDED TRUE
|
#define BTA_JV_INCLUDED TRUE
|
||||||
|
#define BTA_JV_RFCOMM_INCLUDED TRUE
|
||||||
#define BTC_SPP_INCLUDED TRUE
|
#define BTC_SPP_INCLUDED TRUE
|
||||||
#endif /* UC_BT_SPP_ENABLED */
|
#endif /* UC_BT_SPP_ENABLED */
|
||||||
|
|
||||||
#if (UC_BT_L2CAP_ENABLED == TRUE)
|
#if (UC_BT_L2CAP_ENABLED == TRUE)
|
||||||
#define BTA_JV_INCLUDED TRUE
|
#define BTA_JV_INCLUDED TRUE
|
||||||
#define RFCOMM_INCLUDED TRUE
|
|
||||||
#define BTC_L2CAP_INCLUDED TRUE
|
#define BTC_L2CAP_INCLUDED TRUE
|
||||||
#define BTC_SDP_INCLUDED TRUE
|
#define BTC_SDP_INCLUDED TRUE
|
||||||
#define VND_BT_JV_BTA_L2CAP TRUE
|
#define VND_BT_JV_BTA_L2CAP TRUE
|
||||||
@@ -95,6 +95,7 @@
|
|||||||
#define BTC_HF_INCLUDED TRUE
|
#define BTC_HF_INCLUDED TRUE
|
||||||
#define BTA_AG_INCLUDED TRUE
|
#define BTA_AG_INCLUDED TRUE
|
||||||
#define PLC_INCLUDED TRUE
|
#define PLC_INCLUDED TRUE
|
||||||
|
#define BTA_JV_RFCOMM_INCLUDED TRUE
|
||||||
#ifndef RFCOMM_INCLUDED
|
#ifndef RFCOMM_INCLUDED
|
||||||
#define RFCOMM_INCLUDED TRUE
|
#define RFCOMM_INCLUDED TRUE
|
||||||
#endif
|
#endif
|
||||||
@@ -1488,6 +1489,10 @@
|
|||||||
#define RFCOMM_INCLUDED FALSE
|
#define RFCOMM_INCLUDED FALSE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef BTA_JV_RFCOMM_INCLUDED
|
||||||
|
#define BTA_JV_RFCOMM_INCLUDED FALSE
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The maximum number of ports supported. */
|
/* The maximum number of ports supported. */
|
||||||
#ifndef MAX_RFC_PORTS
|
#ifndef MAX_RFC_PORTS
|
||||||
#define MAX_RFC_PORTS 8 /*max is 30*/
|
#define MAX_RFC_PORTS 8 /*max is 30*/
|
||||||
|
Reference in New Issue
Block a user