#define BTA_JV_L2CAP_DATA_IND_EVT 20 /* L2CAP connection received data */
#define BTA_JV_L2CAP_CONG_EVT 21 /* L2CAP connection congestion status changed */
#define BTA_JV_L2CAP_READ_EVT 22 /* the result for BTA_JvL2capRead */
-#define BTA_JV_L2CAP_RECEIVE_EVT 23 /* the result for BTA_JvL2capReceive*/
#define BTA_JV_L2CAP_WRITE_EVT 24 /* the result for BTA_JvL2capWrite*/
#define BTA_JV_L2CAP_WRITE_FIXED_EVT 25 /* the result for BTA_JvL2capWriteFixed */
#define BTA_JV_RFCOMM_CL_INIT_EVT 29 /* RFCOMM client initiated a connection */
#define BTA_JV_RFCOMM_DATA_IND_EVT 30 /* RFCOMM connection received data */
#define BTA_JV_RFCOMM_CONG_EVT 31 /* RFCOMM connection congestion status changed */
-#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_SRV_OPEN_EVT 34 /* open status of Server RFCOMM connection */
#define BTA_JV_MAX_EVT 35 /* max number of JV events */
UINT16 len; /* The length of the data read. */
} tBTA_JV_L2CAP_READ;
-/* data associated with BTA_JV_L2CAP_RECEIVE_EVT */
-typedef struct
-{
- tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT32 req_id; /* The req_id in the associated BTA_JvL2capReceive() */
- UINT8 *p_data; /* This points the same location as the p_data
- * parameter in BTA_JvL2capReceive () */
- UINT16 len; /* The length of the data read. */
-} tBTA_JV_L2CAP_RECEIVE;
-
/* data associated with BTA_JV_L2CAP_WRITE_EVT */
typedef struct
{
BOOLEAN cong; /* TRUE, congested. FALSE, uncongested */
} tBTA_JV_RFCOMM_CONG;
-/* data associated with BTA_JV_RFCOMM_READ_EVT */
-typedef struct
-{
- tBTA_JV_STATUS status; /* Whether the operation succeeded or failed. */
- UINT32 handle; /* The connection handle */
- UINT32 req_id; /* The req_id in the associated BTA_JvRfcommRead() */
- UINT8 *p_data; /* This points the same location as the p_data
- * parameter in BTA_JvRfcommRead () */
- UINT16 len; /* The length of the data read. */
-} tBTA_JV_RFCOMM_READ;
-
/* data associated with BTA_JV_RFCOMM_WRITE_EVT */
typedef struct
{
tBTA_JV_RFCOMM_START rfc_start; /* BTA_JV_RFCOMM_START_EVT */
tBTA_JV_RFCOMM_CL_INIT rfc_cl_init; /* BTA_JV_RFCOMM_CL_INIT_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_WRITE rfc_write; /* BTA_JV_RFCOMM_WRITE_EVT */
tBTA_JV_DATA_IND data_ind; /* BTA_JV_L2CAP_DATA_IND_EVT
BTA_JV_RFCOMM_DATA_IND_EVT */
** BTA_JV_FAIL if internal failure.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvEnable(tBTA_JV_DM_CBACK *p_cback);
+tBTA_JV_STATUS BTA_JvEnable(tBTA_JV_DM_CBACK *p_cback);
/*******************************************************************************
**
** Returns void
**
*******************************************************************************/
-extern void BTA_JvDisable(void);
-
-/*******************************************************************************
-**
-** Function BTA_JvIsEnable
-**
-** Description Get the JV registration status.
-**
-** Returns TRUE, if registered
-**
-*******************************************************************************/
-extern BOOLEAN BTA_JvIsEnable(void);
+void BTA_JvDisable(void);
/*******************************************************************************
**
** FALSE if not.
**
*******************************************************************************/
-extern BOOLEAN BTA_JvIsEncrypted(BD_ADDR bd_addr);
+BOOLEAN BTA_JvIsEncrypted(BD_ADDR bd_addr);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvGetChannelId(int conn_type, void* user_data,
+tBTA_JV_STATUS BTA_JvGetChannelId(int conn_type, void* user_data,
INT32 channel);
/*******************************************************************************
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvFreeChannel(UINT16 channel, int conn_type);
+tBTA_JV_STATUS BTA_JvFreeChannel(UINT16 channel, int conn_type);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvStartDiscovery(BD_ADDR bd_addr, UINT16 num_uuid,
+tBTA_JV_STATUS BTA_JvStartDiscovery(BD_ADDR bd_addr, UINT16 num_uuid,
tSDP_UUID *p_uuid_list, void* user_data);
/*******************************************************************************
**
-** Function BTA_JvCreateRecord
+** Function BTA_JvCreateRecordByUser
**
** Description Create a service record in the local SDP database by user in
** tBTA_JV_DM_CBACK callback with a BTA_JV_CREATE_RECORD_EVT.
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvCreateRecordByUser(void* user_data);
+tBTA_JV_STATUS BTA_JvCreateRecordByUser(void* user_data);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvDeleteRecord(UINT32 handle);
+tBTA_JV_STATUS BTA_JvDeleteRecord(UINT32 handle);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capConnectLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
+tBTA_JV_STATUS BTA_JvL2capConnectLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
const tL2CAP_ERTM_INFO *ertm_info, UINT16 remote_chan,
UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
BD_ADDR peer_bd_addr, tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
+tBTA_JV_STATUS BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
const tL2CAP_ERTM_INFO *ertm_info, UINT16 remote_psm,
UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
BD_ADDR peer_bd_addr, tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capClose(UINT32 handle);
+tBTA_JV_STATUS BTA_JvL2capClose(UINT32 handle);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capCloseLE(UINT32 handle);
+tBTA_JV_STATUS BTA_JvL2capCloseLE(UINT32 handle);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
+tBTA_JV_STATUS BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, tBTA_JV_ROLE role,
const tL2CAP_ERTM_INFO *ertm_info,
UINT16 local_psm, UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capStartServerLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
+tBTA_JV_STATUS BTA_JvL2capStartServerLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
const tL2CAP_ERTM_INFO *ertm_info,
UINT16 local_chan, UINT16 rx_mtu, tL2CAP_CFG_INFO *cfg,
tBTA_JV_L2CAP_CBACK *p_cback, void *user_data);
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capStopServerLE(UINT16 local_chan, void *user_data);
+tBTA_JV_STATUS BTA_JvL2capStopServerLE(UINT16 local_chan, void *user_data);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capStopServer(UINT16 local_psm, void *user_data);
+tBTA_JV_STATUS BTA_JvL2capStopServer(UINT16 local_psm, void *user_data);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capRead(UINT32 handle, UINT32 req_id,
- UINT8 *p_data, UINT16 len);
-
-/*******************************************************************************
-**
-** Function BTA_JvL2capReceive
-**
-** Description This function reads data from an L2CAP connection
-** When the operation is complete, tBTA_JV_L2CAP_CBACK is
-** called with BTA_JV_L2CAP_RECEIVE_EVT.
-** If there are more data queued in L2CAP than len, the extra data will be discarded.
-**
-** Returns BTA_JV_SUCCESS, if the request is being processed.
-** BTA_JV_FAILURE, otherwise.
-**
-*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capReceive(UINT32 handle, UINT32 req_id,
+tBTA_JV_STATUS BTA_JvL2capRead(UINT32 handle, UINT32 req_id,
UINT8 *p_data, UINT16 len);
/*******************************************************************************
** BTA_JV_FAILURE, if error.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capReady(UINT32 handle, UINT32 *p_data_size);
+tBTA_JV_STATUS BTA_JvL2capReady(UINT32 handle, UINT32 *p_data_size);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capWrite(UINT32 handle, UINT32 req_id,
+tBTA_JV_STATUS BTA_JvL2capWrite(UINT32 handle, UINT32 req_id,
UINT8 *p_data, UINT16 len, void *user_data);
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvL2capWriteFixed(UINT16 channel, BD_ADDR *addr, UINT32 req_id,
+tBTA_JV_STATUS BTA_JvL2capWriteFixed(UINT16 channel, BD_ADDR *addr, UINT32 req_id,
tBTA_JV_L2CAP_CBACK *p_cback,
UINT8 *p_data, UINT16 len, void *user_data);
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
+tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
tBTA_JV_ROLE role, UINT8 remote_scn, BD_ADDR peer_bd_addr,
tBTA_JV_RFCOMM_CBACK *p_cback, void *user_data);
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, void* user_data);
+tBTA_JV_STATUS BTA_JvRfcommClose(UINT32 handle, void* user_data);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask,
+tBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask,
tBTA_JV_ROLE role, UINT8 local_scn, UINT8 max_session,
tBTA_JV_RFCOMM_CBACK *p_cback, void *user_data);
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle, void* user_data);
-
-/*******************************************************************************
-**
-** Function BTA_JvRfcommRead
-**
-** Description This function reads data from an RFCOMM connection
-** When the operation is complete, tBTA_JV_RFCOMM_CBACK is
-** called with BTA_JV_RFCOMM_READ_EVT.
-**
-** Returns BTA_JV_SUCCESS, if the request is being processed.
-** BTA_JV_FAILURE, otherwise.
-**
-*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvRfcommRead(UINT32 handle, UINT32 req_id,
- UINT8 *p_data, UINT16 len);
-
-/*******************************************************************************
-**
-** Function BTA_JvRfcommReady
-**
-** Description This function determined if there is data to read from
-** an RFCOMM connection
-**
-** Returns BTA_JV_SUCCESS, if data queue size is in *p_data_size.
-** BTA_JV_FAILURE, if error.
-**
-*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvRfcommReady(UINT32 handle, UINT32 *p_data_size);
+tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle, void* user_data);
/*******************************************************************************
**
** BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvRfcommWrite(UINT32 handle, UINT32 req_id);
+tBTA_JV_STATUS BTA_JvRfcommWrite(UINT32 handle, UINT32 req_id);
/*******************************************************************************
**
** BTA_JV_CONN_CLOSE to remove in case of connection close!
**
*******************************************************************************/
-extern tBTA_JV_STATUS BTA_JvSetPmProfile(UINT32 handle, tBTA_JV_PM_ID app_id,
+tBTA_JV_STATUS BTA_JvSetPmProfile(UINT32 handle, tBTA_JV_PM_ID app_id,
tBTA_JV_CONN_STATE init_st);
/*******************************************************************************
/*******************************************************************************
**
-** Function BTA_JvIsEnable
-**
-** Description Get the JV registration status.
-**
-** Returns TRUE, if registered
-**
-*******************************************************************************/
-BOOLEAN BTA_JvIsEnable(void)
-{
- return bta_sys_is_register(BTA_ID_JV);
-}
-
-/*******************************************************************************
-**
** Function BTA_JvIsEncrypted
**
** Description This function checks if the link to peer device is encrypted
/*******************************************************************************
**
-** Function BTA_JvL2capReceive
-**
-** Description This function reads data from an L2CAP connection
-** When the operation is complete, tBTA_JV_L2CAP_CBACK is
-** called with BTA_JV_L2CAP_RECEIVE_EVT.
-** If there are more data queued in L2CAP than len, the extra data will be discarded.
-**
-** Returns BTA_JV_SUCCESS, if the request is being processed.
-** BTA_JV_FAILURE, otherwise.
-**
-*******************************************************************************/
-tBTA_JV_STATUS BTA_JvL2capReceive(UINT32 handle, UINT32 req_id, UINT8 *p_data, UINT16 len)
-{
- tBTA_JV_STATUS status = BTA_JV_FAILURE;
- tBTA_JV_L2CAP_RECEIVE evt_data;
- UINT32 left_over = 0;
- UINT16 max_len, read_len;
-
- APPL_TRACE_API( "%s", __func__);
-
-
- if (handle < BTA_JV_MAX_L2C_CONN && bta_jv_cb.l2c_cb[handle].p_cback)
- {
- status = BTA_JV_SUCCESS;
- evt_data.status = BTA_JV_FAILURE;
- evt_data.handle = handle;
- evt_data.req_id = req_id;
- evt_data.p_data = p_data;
- evt_data.len = 0;
-
- if (BT_PASS == GAP_ConnReadData((UINT16)handle, p_data, len, &evt_data.len))
- {
- evt_data.status = BTA_JV_SUCCESS;
- GAP_GetRxQueueCnt ((UINT16)handle, &left_over);
- while (left_over)
- {
- max_len = (left_over > 0xFFFF)?0xFFFF:left_over;
- GAP_ConnReadData ((UINT16)handle, NULL, max_len, &read_len);
- left_over -= read_len;
- }
- }
- bta_jv_cb.l2c_cb[handle].p_cback(
- BTA_JV_L2CAP_RECEIVE_EVT, (tBTA_JV *)&evt_data, bta_jv_cb.l2c_cb[handle].user_data);
- }
-
- return(status);
-}
-/*******************************************************************************
-**
** Function BTA_JvL2capReady
**
** Description This function determined if there is data to read from
/*******************************************************************************
**
-** Function BTA_JvRfcommRead
-**
-** Description This function reads data from an RFCOMM connection
-** The actual size of data read is returned in p_len.
-**
-** Returns BTA_JV_SUCCESS, if the request is being processed.
-** BTA_JV_FAILURE, otherwise.
-**
-*******************************************************************************/
-tBTA_JV_STATUS BTA_JvRfcommRead(UINT32 handle, UINT32 req_id, UINT8 *p_data, UINT16 len)
-{
- tBTA_JV_STATUS status = BTA_JV_FAILURE;
- UINT32 hi = ((handle & BTA_JV_RFC_HDL_MASK)&~BTA_JV_RFCOMM_MASK) - 1;
- UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(handle);
-
- APPL_TRACE_API("%s", __func__);
-
- if (hi < BTA_JV_MAX_RFC_CONN && bta_jv_cb.rfc_cb[hi].p_cback &&
- si < BTA_JV_MAX_RFC_SR_SESSION && bta_jv_cb.rfc_cb[hi].rfc_hdl[si]) {
- tBTA_JV_API_RFCOMM_READ *p_msg =
- (tBTA_JV_API_RFCOMM_READ *)osi_malloc(sizeof(tBTA_JV_API_RFCOMM_READ));
- p_msg->hdr.event = BTA_JV_API_RFCOMM_READ_EVT;
- p_msg->handle = handle;
- p_msg->req_id = req_id;
- p_msg->p_data = p_data;
- p_msg->len = len;
- p_msg->p_cb = &bta_jv_cb.rfc_cb[hi];
- p_msg->p_pcb = &bta_jv_cb.port_cb[p_msg->p_cb->rfc_hdl[si] - 1];
-
- bta_sys_sendmsg(p_msg);
- status = BTA_JV_SUCCESS;
- }
-
- return status;
-}
-
-/*******************************************************************************
-**
** Function BTA_JvRfcommGetPortHdl
**
** Description This function fetches the rfcomm port handle
return 0xffff;
}
-
-/*******************************************************************************
-**
-** Function BTA_JvRfcommReady
-**
-** Description This function determined if there is data to read from
-** an RFCOMM connection
-**
-** Returns BTA_JV_SUCCESS, if data queue size is in *p_data_size.
-** BTA_JV_FAILURE, if error.
-**
-*******************************************************************************/
-tBTA_JV_STATUS BTA_JvRfcommReady(UINT32 handle, UINT32 *p_data_size)
-{
- tBTA_JV_STATUS status = BTA_JV_FAILURE;
- UINT16 size = 0;
- UINT32 hi = ((handle & BTA_JV_RFC_HDL_MASK)&~BTA_JV_RFCOMM_MASK) - 1;
- UINT32 si = BTA_JV_RFC_HDL_TO_SIDX(handle);
-
- APPL_TRACE_API( "BTA_JvRfcommReady");
- if (hi < BTA_JV_MAX_RFC_CONN && bta_jv_cb.rfc_cb[hi].p_cback &&
- si < BTA_JV_MAX_RFC_SR_SESSION && bta_jv_cb.rfc_cb[hi].rfc_hdl[si])
- {
- if(PORT_GetRxQueueCnt(bta_jv_cb.rfc_cb[hi].rfc_hdl[si], &size) == PORT_SUCCESS)
- {
- status = BTA_JV_SUCCESS;
- }
- }
- *p_data_size = size;
- return(status);
-}
-
/*******************************************************************************
**
** Function BTA_JvRfcommWrite