Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 642d119c authored by Sharvil Nanavati's avatar Sharvil Nanavati
Browse files

Delete unused JV code

Change-Id: I16d017ef90269a435b8f66a58ed06d2fc89d407f
parent 822208e1
Loading
Loading
Loading
Loading
+27 −107
Original line number Diff line number Diff line
@@ -140,7 +140,6 @@ typedef UINT8 tBTA_JV_CONN_STATE;
#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 */

@@ -151,7 +150,6 @@ typedef UINT8 tBTA_JV_CONN_STATE;
#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 */
@@ -243,17 +241,6 @@ typedef struct
    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
{
@@ -341,17 +328,6 @@ 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
{
@@ -400,7 +376,6 @@ typedef union
    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 */
@@ -441,7 +416,7 @@ typedef struct
**                  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);

/*******************************************************************************
**
@@ -452,18 +427,7 @@ extern 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);

/*******************************************************************************
**
@@ -475,7 +439,7 @@ extern BOOLEAN BTA_JvIsEnable(void);
**                  FALSE if not.
**
*******************************************************************************/
extern BOOLEAN BTA_JvIsEncrypted(BD_ADDR bd_addr);
BOOLEAN BTA_JvIsEncrypted(BD_ADDR bd_addr);

/*******************************************************************************
**
@@ -498,7 +462,7 @@ extern 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);

/*******************************************************************************
@@ -512,7 +476,7 @@ extern tBTA_JV_STATUS BTA_JvGetChannelId(int conn_type, void* user_data,
**                  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);

/*******************************************************************************
**
@@ -527,12 +491,12 @@ extern 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.
@@ -541,7 +505,7 @@ extern tBTA_JV_STATUS BTA_JvStartDiscovery(BD_ADDR bd_addr, UINT16 num_uuid,
**                  BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
extern tBTA_JV_STATUS BTA_JvCreateRecordByUser(void* user_data);
tBTA_JV_STATUS BTA_JvCreateRecordByUser(void* user_data);

/*******************************************************************************
**
@@ -553,7 +517,7 @@ extern 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);

/*******************************************************************************
**
@@ -570,7 +534,7 @@ extern 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);
@@ -590,7 +554,7 @@ extern tBTA_JV_STATUS BTA_JvL2capConnectLE(tBTA_SEC sec_mask, tBTA_JV_ROLE role,
**                  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);
@@ -605,7 +569,7 @@ extern tBTA_JV_STATUS BTA_JvL2capConnect(int conn_type, tBTA_SEC sec_mask, tBTA_
**                  BTA_JV_FAILURE, otherwise.
**
*******************************************************************************/
extern tBTA_JV_STATUS BTA_JvL2capClose(UINT32 handle);
tBTA_JV_STATUS BTA_JvL2capClose(UINT32 handle);

/*******************************************************************************
**
@@ -618,7 +582,7 @@ extern 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);

/*******************************************************************************
**
@@ -634,7 +598,7 @@ extern 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);
@@ -654,7 +618,7 @@ extern tBTA_JV_STATUS BTA_JvL2capStartServer(int conn_type, tBTA_SEC sec_mask, t
**                  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);
@@ -670,7 +634,7 @@ extern tBTA_JV_STATUS BTA_JvL2capStartServerLE(tBTA_SEC sec_mask, tBTA_JV_ROLE r
**                  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);

/*******************************************************************************
**
@@ -683,7 +647,7 @@ extern 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);

/*******************************************************************************
**
@@ -697,23 +661,7 @@ extern 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);

/*******************************************************************************
@@ -727,7 +675,7 @@ extern tBTA_JV_STATUS BTA_JvL2capReceive(UINT32 handle, UINT32 req_id,
**                  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);

/*******************************************************************************
**
@@ -742,7 +690,7 @@ extern 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);


@@ -759,7 +707,7 @@ extern tBTA_JV_STATUS BTA_JvL2capWrite(UINT32 handle, UINT32 req_id,
**                  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);

@@ -778,7 +726,7 @@ extern tBTA_JV_STATUS BTA_JvL2capWriteFixed(UINT16 channel, BD_ADDR *addr, UINT3
**                  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);

@@ -792,7 +740,7 @@ extern tBTA_JV_STATUS BTA_JvRfcommConnect(tBTA_SEC sec_mask,
**                  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);

/*******************************************************************************
**
@@ -809,7 +757,7 @@ extern 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);

@@ -824,35 +772,7 @@ extern tBTA_JV_STATUS BTA_JvRfcommStartServer(tBTA_SEC sec_mask,
**                  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);

/*******************************************************************************
**
@@ -866,7 +786,7 @@ extern tBTA_JV_STATUS BTA_JvRfcommReady(UINT32 handle, UINT32 *p_data_size);
**                  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);

/*******************************************************************************
 **
@@ -887,7 +807,7 @@ extern 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);

/*******************************************************************************
+0 −29
Original line number Diff line number Diff line
@@ -2012,35 +2012,6 @@ void bta_jv_rfcomm_stop_server(tBTA_JV_MSG *p_data)
                get_sec_id_used(), get_rfc_cb_used());
}

/*******************************************************************************
**
** Function     bta_jv_rfcomm_read
**
** Description  Read data from an RFCOMM connection
**
** Returns      void
**
*******************************************************************************/
void bta_jv_rfcomm_read(tBTA_JV_MSG *p_data)
{
    tBTA_JV_API_RFCOMM_READ *rc = &(p_data->rfcomm_read);
    tBTA_JV_RFC_CB  *p_cb = rc->p_cb;
    tBTA_JV_PCB     *p_pcb = rc->p_pcb;
    tBTA_JV_RFCOMM_READ    evt_data;

    evt_data.status = BTA_JV_FAILURE;
    evt_data.handle = p_cb->handle;
    evt_data.req_id = rc->req_id;
    evt_data.p_data = rc->p_data;
    if (PORT_ReadData(rc->p_pcb->port_handle, (char *)rc->p_data, rc->len, &evt_data.len) ==
        PORT_SUCCESS)
    {
        evt_data.status = BTA_JV_SUCCESS;
    }

    p_cb->p_cback(BTA_JV_RFCOMM_READ_EVT, (tBTA_JV *)&evt_data, p_pcb->user_data);
}

/*******************************************************************************
**
** Function     bta_jv_rfcomm_write
+0 −133
Original line number Diff line number Diff line
@@ -112,20 +112,6 @@ void BTA_JvDisable(void)
    bta_sys_sendmsg(p_buf);
}

/*******************************************************************************
**
** 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
@@ -663,55 +649,6 @@ tBTA_JV_STATUS BTA_JvL2capRead(UINT32 handle, UINT32 req_id, UINT8 *p_data, UINT
    return(status);
}

/*******************************************************************************
**
** 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
@@ -962,44 +899,6 @@ tBTA_JV_STATUS BTA_JvRfcommStopServer(UINT32 handle, void * user_data)
    return BTA_JV_SUCCESS;
}

/*******************************************************************************
**
** 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
@@ -1022,38 +921,6 @@ UINT16 BTA_JvRfcommGetPortHdl(UINT32 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
+0 −14
Original line number Diff line number Diff line
@@ -54,7 +54,6 @@ enum
    BTA_JV_API_RFCOMM_CLOSE_EVT,
    BTA_JV_API_RFCOMM_START_SERVER_EVT,
    BTA_JV_API_RFCOMM_STOP_SERVER_EVT,
    BTA_JV_API_RFCOMM_READ_EVT,
    BTA_JV_API_RFCOMM_WRITE_EVT,
    BTA_JV_API_SET_PM_PROFILE_EVT,
    BTA_JV_API_PM_STATE_CHANGE_EVT,
@@ -271,18 +270,6 @@ typedef struct
    void            *user_data;
} tBTA_JV_API_RFCOMM_SERVER;

/* data type for BTA_JV_API_RFCOMM_READ_EVT */
typedef struct
{
    BT_HDR          hdr;
    UINT32          handle;
    UINT32          req_id;
    UINT8           *p_data;
    UINT16          len;
    tBTA_JV_RFC_CB  *p_cb;
    tBTA_JV_PCB     *p_pcb;
} tBTA_JV_API_RFCOMM_READ;

/* data type for BTA_JV_API_SET_PM_PROFILE_EVT */
typedef struct
{
@@ -372,7 +359,6 @@ typedef union
    tBTA_JV_API_L2CAP_CLOSE         l2cap_close;
    tBTA_JV_API_L2CAP_SERVER        l2cap_server;
    tBTA_JV_API_RFCOMM_CONNECT      rfcomm_connect;
    tBTA_JV_API_RFCOMM_READ         rfcomm_read;
    tBTA_JV_API_RFCOMM_WRITE        rfcomm_write;
    tBTA_JV_API_SET_PM_PROFILE      set_pm;
    tBTA_JV_API_PM_STATE_CHANGE     change_pm_state;
+0 −1
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ const tBTA_JV_ACTION bta_jv_action[] =
    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_stop_server,      /* BTA_JV_API_RFCOMM_STOP_SERVER_EVT */
    bta_jv_rfcomm_read,             /* BTA_JV_API_RFCOMM_READ_EVT */
    bta_jv_rfcomm_write,            /* BTA_JV_API_RFCOMM_WRITE_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 */
Loading