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

Commit ba6fd96d authored by Hansong Zhang's avatar Hansong Zhang Committed by android-build-merger
Browse files

RFCOMM: Remove dead code

am: be6d259c

Change-Id: I9769490ee094e65fa0835cd2bdee198a3b733286
parents d6da2daa be6d259c
Loading
Loading
Loading
Loading
+0 −227
Original line number Diff line number Diff line
@@ -35,47 +35,27 @@
 * set settings request, or to the application in the set settings indication.
*/
typedef struct {
#define PORT_BAUD_RATE_2400 0x00
#define PORT_BAUD_RATE_4800 0x01
#define PORT_BAUD_RATE_7200 0x02
#define PORT_BAUD_RATE_9600 0x03
#define PORT_BAUD_RATE_19200 0x04
#define PORT_BAUD_RATE_38400 0x05
#define PORT_BAUD_RATE_57600 0x06
#define PORT_BAUD_RATE_115200 0x07
#define PORT_BAUD_RATE_230400 0x08

  uint8_t baud_rate;

#define PORT_5_BITS 0x00
#define PORT_6_BITS 0x01
#define PORT_7_BITS 0x02
#define PORT_8_BITS 0x03

  uint8_t byte_size;

#define PORT_ONESTOPBIT 0x00
#define PORT_ONE5STOPBITS 0x01
  uint8_t stop_bits;

#define PORT_PARITY_NO 0x00
#define PORT_PARITY_YES 0x01
  uint8_t parity;

#define PORT_ODD_PARITY 0x00
#define PORT_EVEN_PARITY 0x01
#define PORT_MARK_PARITY 0x02
#define PORT_SPACE_PARITY 0x03

  uint8_t parity_type;

#define PORT_FC_OFF 0x00
#define PORT_FC_XONXOFF_ON_INPUT 0x01
#define PORT_FC_XONXOFF_ON_OUTPUT 0x02
#define PORT_FC_CTS_ON_INPUT 0x04
#define PORT_FC_CTS_ON_OUTPUT 0x08
#define PORT_FC_DSR_ON_INPUT 0x10
#define PORT_FC_DSR_ON_OUTPUT 0x20

  uint8_t fc_type;

@@ -132,18 +112,6 @@ typedef void(tPORT_CALLBACK)(uint32_t code, uint16_t port_handle);
/* data flow enable status true = enabled */
#define PORT_EV_FCS 0x00020000

/*
 * To register for events application should provide bitmask with
 * corresponding bit set
*/

#define PORT_MASK_ALL                                                  \
  (PORT_EV_RXCHAR | PORT_EV_TXEMPTY | PORT_EV_CTS | PORT_EV_DSR |      \
   PORT_EV_RLSD | PORT_EV_BREAK | PORT_EV_ERR | PORT_EV_RING |         \
   PORT_EV_CONNECT_ERR | PORT_EV_DSRS | PORT_EV_CTSS | PORT_EV_RLSDS | \
   PORT_EV_RXFLAG | PORT_EV_TXCHAR | PORT_EV_OVERRUN | PORT_EV_FC |    \
   PORT_EV_FCS | PORT_EV_CONNECTED)

/*
 * Define port result codes
*/
@@ -267,21 +235,6 @@ extern int PORT_SetEventCallback(uint16_t port_handle,
 ******************************************************************************/
int PORT_ClearKeepHandleFlag(uint16_t port_handle);

/*******************************************************************************
 *
 * Function         PORT_SetEventCallback
 *
 * Description      Set event data callback the specified connection.
 *
 * Parameters:      handle       - Handle of the port returned in the Open
 *                  p_callback   - address of the callback function which should
 *                                 be called from the RFCOMM when a data
 *                                 packet is received.
 *
 ******************************************************************************/
extern int PORT_SetDataCallback(uint16_t port_handle,
                                tPORT_DATA_CALLBACK* p_cb);

extern int PORT_SetDataCOCallback(uint16_t port_handle,
                                  tPORT_DATA_CO_CALLBACK* p_port_cb);
/*******************************************************************************
@@ -339,18 +292,6 @@ extern bool PORT_IsOpening(RawAddress* bd_addr);
 ******************************************************************************/
extern int PORT_SetState(uint16_t handle, tPORT_STATE* p_settings);

/*******************************************************************************
 *
 * Function         PORT_GetRxQueueCnt
 *
 * Description      This function return number of buffers on the rx queue.
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                  p_rx_queue_count - Pointer to return queue count in.
 *
 ******************************************************************************/
extern int PORT_GetRxQueueCnt(uint16_t handle, uint16_t* p_rx_queue_count);

/*******************************************************************************
 *
 * Function         PORT_GetState
@@ -365,43 +306,6 @@ extern int PORT_GetRxQueueCnt(uint16_t handle, uint16_t* p_rx_queue_count);
 ******************************************************************************/
extern int PORT_GetState(uint16_t handle, tPORT_STATE* p_settings);

/*******************************************************************************
 *
 * Function         PORT_Control
 *
 * Description      This function directs a specified connection to pass control
 *                  control information to the peer device.
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                  signal     - specify the function to be passed
 *
 ******************************************************************************/
#define PORT_SET_DTRDSR 0x01
#define PORT_CLR_DTRDSR 0x02
#define PORT_SET_CTSRTS 0x03
#define PORT_CLR_CTSRTS 0x04
#define PORT_SET_RI 0x05  /* DCE only */
#define PORT_CLR_RI 0x06  /* DCE only */
#define PORT_SET_DCD 0x07 /* DCE only */
#define PORT_CLR_DCD 0x08 /* DCE only */
#define PORT_BREAK 0x09   /* Break event */

extern int PORT_Control(uint16_t handle, uint8_t signal);

/*******************************************************************************
 *
 * Function         PORT_FlowControl
 *
 * Description      This function directs a specified connection to pass
 *                  flow control message to the peer device.  Enable flag passed
 *                  shows if port can accept more data.
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                  enable     - enables data flow
 *
 ******************************************************************************/
extern int PORT_FlowControl(uint16_t handle, bool enable);

/*******************************************************************************
 *
 * Function         PORT_FlowControl_MaxCredit
@@ -417,20 +321,6 @@ extern int PORT_FlowControl(uint16_t handle, bool enable);
 ******************************************************************************/
extern int PORT_FlowControl_MaxCredit(uint16_t handle, bool enable);

/*******************************************************************************
 *
 * Function         PORT_GetModemStatus
 *
 * Description      This function retrieves modem control signals.  Normally
 *                  application will call this function after a callback
 *                  function is called with notification that one of signals
 *                  has been changed.
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                               callback.
 *                  p_signal   - specify the pointer to control signals info
 *
 ******************************************************************************/
#define PORT_DTRDSR_ON 0x01
#define PORT_CTSRTS_ON 0x02
#define PORT_RING_ON 0x04
@@ -447,103 +337,12 @@ extern int PORT_FlowControl_MaxCredit(uint16_t handle, bool enable);
  (PORT_DTRDSR_ON | PORT_CTSRTS_ON | PORT_DCD_ON)
#define PORT_DUN_DEFAULT_SIGNAL_STATE (PORT_DTRDSR_ON | PORT_CTSRTS_ON)

extern int PORT_GetModemStatus(uint16_t handle, uint8_t* p_control_signal);

/*******************************************************************************
 *
 * Function         PORT_ClearError
 *
 * Description      This function retreives information about a communications
 *                  error and reports current status of a connection.  The
 *                  function should be called when an error occures to clear
 *                  the connection error flag and to enable additional read
 *                  and write operations.
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                  p_errors   - pointer of the variable to receive error codes
 *                  p_status   - pointer to the tPORT_STATUS structur to receive
 *                               connection status
 *
 ******************************************************************************/

#define PORT_ERR_BREAK 0x01   /* Break condition occured on the peer device */
#define PORT_ERR_OVERRUN 0x02 /* Overrun is reported by peer device */
#define PORT_ERR_FRAME 0x04   /* Framing error reported by peer device */
#define PORT_ERR_RXOVER 0x08  /* Input queue overflow occured */
#define PORT_ERR_TXFULL 0x10  /* Output queue overflow occured */

typedef struct {
#define PORT_FLAG_CTS_HOLD 0x01  /* Tx is waiting for CTS signal */
#define PORT_FLAG_DSR_HOLD 0x02  /* Tx is waiting for DSR signal */
#define PORT_FLAG_RLSD_HOLD 0x04 /* Tx is waiting for RLSD signal */

  uint16_t flags;
  uint16_t in_queue_size;  /* Number of bytes in the input queue */
  uint16_t out_queue_size; /* Number of bytes in the output queue */
  uint16_t mtu_size;       /* peer MTU size */
} tPORT_STATUS;

extern int PORT_ClearError(uint16_t handle, uint16_t* p_errors,
                           tPORT_STATUS* p_status);

/*******************************************************************************
 *
 * Function         PORT_SendError
 *
 * Description      This function send a communications error to the peer device
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                  errors     - receive error codes
 *
 ******************************************************************************/
extern int PORT_SendError(uint16_t handle, uint8_t errors);

/*******************************************************************************
 *
 * Function         PORT_GetQueueStatus
 *
 * Description      This function reports current status of a connection.
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                  p_status   - pointer to the tPORT_STATUS structur to receive
 *                               connection status
 *
 ******************************************************************************/
extern int PORT_GetQueueStatus(uint16_t handle, tPORT_STATUS* p_status);

/*******************************************************************************
 *
 * Function         PORT_Purge
 *
 * Description      This function discards all the data from the output or
 *                  input queues of the specified connection.
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                  purge_flags - specify the action to take.
 *
 ******************************************************************************/
#define PORT_PURGE_TXCLEAR 0x01
#define PORT_PURGE_RXCLEAR 0x02

extern int PORT_Purge(uint16_t handle, uint8_t purge_flags);

/*******************************************************************************
 *
 * Function         PORT_Read
 *
 * Description      This function returns the pointer to the buffer received
 *                  from the peer device.  Normally application will call this
 *                  function after receiving PORT_EVT_RXCHAR event.
 *                  Application calling this function is responsible to free
 *                  buffer returned.
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                                callback.
 *                  pp_buf      - pointer to address of buffer with data,
 *
 ******************************************************************************/
extern int PORT_Read(uint16_t handle, BT_HDR** pp_buf);

/*******************************************************************************
 *
 * Function         PORT_ReadData
@@ -561,19 +360,6 @@ extern int PORT_Read(uint16_t handle, BT_HDR** pp_buf);
extern int PORT_ReadData(uint16_t handle, char* p_data, uint16_t max_len,
                         uint16_t* p_len);

/*******************************************************************************
 *
 * Function         PORT_Write
 *
 * Description      This function to send BT buffer to the peer device.
 *                  Application should not free the buffer.
 *
 * Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
 *                  p_buf       - pointer to the buffer with data,
 *
 ******************************************************************************/
extern int PORT_Write(uint16_t handle, BT_HDR* p_buf);

/*******************************************************************************
 *
 * Function         PORT_WriteData
@@ -602,19 +388,6 @@ extern int PORT_WriteData(uint16_t handle, const char* p_data, uint16_t max_len,
 ******************************************************************************/
extern int PORT_WriteDataCO(uint16_t handle, int* p_len);

/*******************************************************************************
 *
 * Function         PORT_Test
 *
 * Description      Application can call this function to send RFCOMM Test frame
 *
 * Parameters:      handle      - Handle returned in the RFCOMM_CreateConnection
 *                  p_data      - Data area
 *                  max_len     - Byte count requested
 *
 ******************************************************************************/
extern int PORT_Test(uint16_t handle, uint8_t* p_data, uint16_t len);

/*******************************************************************************
 *
 * Function         RFCOMM_Init
+0 −603

File changed.

Preview size limit exceeded, changes collapsed.

+0 −17
Original line number Diff line number Diff line
@@ -32,17 +32,6 @@
#include "port_api.h"
#include "rfcdefs.h"

/* Local events passed when application event is sent from the api to PORT */
/* ???*/
#define PORT_EVENT_OPEN (1 | BT_EVT_TO_BTU_SP_EVT)
#define PORT_EVENT_CONTROL (2 | BT_EVT_TO_BTU_SP_EVT)
#define PORT_EVENT_SET_STATE (3 | BT_EVT_TO_BTU_SP_EVT)
#define PORT_EVENT_SET_CALLBACK (5 | BT_EVT_TO_BTU_SP_EVT)
#define PORT_EVENT_WRITE (6 | BT_EVT_TO_BTU_SP_EVT)
#define PORT_EVENT_PURGE (7 | BT_EVT_TO_BTU_SP_EVT)
#define PORT_EVENT_SEND_ERROR (8 | BT_EVT_TO_BTU_SP_EVT)
#define PORT_EVENT_FLOW_CONTROL (9 | BT_EVT_TO_BTU_SP_EVT)

/*
 * Flow control configuration values for the mux
*/
@@ -114,12 +103,6 @@ typedef struct {
 * RFCOMM Port Connection Control Block
*/
typedef struct {
#define RFC_PORT_STATE_IDLE 0
#define RFC_PORT_STATE_WAIT_START 1
#define RFC_PORT_STATE_OPENING 2
#define RFC_PORT_STATE_OPENED 3
#define RFC_PORT_STATE_CLOSING 4

  uint8_t state; /* Current state of the connection */

#define RFC_RSP_PN 0x01