summaryrefslogtreecommitdiffstats
path: root/stack/rfcomm
diff options
context:
space:
mode:
Diffstat (limited to 'stack/rfcomm')
-rw-r--r--stack/rfcomm/port_rfc.c58
-rw-r--r--stack/rfcomm/port_utils.c36
-rw-r--r--stack/rfcomm/rfc_int.h32
-rw-r--r--stack/rfcomm/rfc_l2cap_if.c22
-rw-r--r--stack/rfcomm/rfc_mx_fsm.c28
-rw-r--r--stack/rfcomm/rfc_port_fsm.c80
-rw-r--r--stack/rfcomm/rfc_port_if.c48
-rw-r--r--stack/rfcomm/rfc_ts_frames.c42
-rw-r--r--stack/rfcomm/rfc_utils.c28
9 files changed, 187 insertions, 187 deletions
diff --git a/stack/rfcomm/port_rfc.c b/stack/rfcomm/port_rfc.c
index d5ad359..ef84fef 100644
--- a/stack/rfcomm/port_rfc.c
+++ b/stack/rfcomm/port_rfc.c
@@ -20,7 +20,7 @@
#include "port_int.h"
#include "rfc_int.h"
-/*
+/*
** Local function definitions
*/
UINT32 port_rfc_send_tx_data (tPORT *p_port);
@@ -85,7 +85,7 @@ int port_open_continue (tPORT *p_port)
**
** Function port_start_control
**
-** Description This function is called in the BTU_TASK context to
+** Description This function is called in the BTU_TASK context to
** send control information
**
** Returns void
@@ -106,7 +106,7 @@ void port_start_control (tPORT *p_port)
**
** Function port_start_par_neg
**
-** Description This function is called in the BTU_TASK context to
+** Description This function is called in the BTU_TASK context to
** send configuration information
**
** Returns void
@@ -127,7 +127,7 @@ void port_start_par_neg (tPORT *p_port)
**
** Function port_start_close
**
-** Description This function is called in the BTU_TASK context to
+** Description This function is called in the BTU_TASK context to
** release DLC
**
** Returns void
@@ -240,7 +240,7 @@ void PORT_StartCnf (tRFC_MCB *p_mcb, UINT16 result)
** Function PORT_StartInd
**
** Description This function is called from the RFCOMM layer when
-** some peer device wants to establish a multiplexer
+** some peer device wants to establish a multiplexer
** connection. Check if there are any ports open with this
** or not assigned multiplexer.
**
@@ -292,9 +292,9 @@ void PORT_ParNegInd (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT8 cl, UINT8 k)
{
/* If the port cannot be opened, send a DM. Per Errata 1205 */
rfc_send_dm(p_mcb, dlci, FALSE);
- /* check if this is the last port open, some headsets have
+ /* check if this is the last port open, some headsets have
problem, they don't disconnect if we send DM */
- rfc_check_mcb_active( p_mcb );
+ rfc_check_mcb_active( p_mcb );
RFCOMM_TRACE_EVENT0( "PORT_ParNegInd: port not found" );
return;
}
@@ -315,7 +315,7 @@ void PORT_ParNegInd (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT8 cl, UINT8 k)
/* use that. Otherwise both must want credit based, so use that. If flow is */
/* already defined for this mux, we respond with that value. */
if (p_mcb->flow == PORT_FC_UNDEFINED)
- {
+ {
if ((PORT_FC_DEFAULT == PORT_FC_TS710) || (cl == RFCOMM_PN_CONV_LAYER_TYPE_1))
{
p_mcb->flow = PORT_FC_TS710;
@@ -376,11 +376,11 @@ void PORT_ParNegCnf (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT8 cl, UINT8 k)
if (!p_port)
return;
- /* Flow control mechanism not set yet. Negotiate flow control mechanism. */
+ /* Flow control mechanism not set yet. Negotiate flow control mechanism. */
if (p_mcb->flow == PORT_FC_UNDEFINED)
{
/* Our stack is configured for TS07.10 and they responded with credit-based. */
- /* This is illegal-- negotiation fails. */
+ /* This is illegal-- negotiation fails. */
if ((PORT_FC_DEFAULT == PORT_FC_TS710) && (cl == RFCOMM_PN_CONV_LAYER_CBFC_R))
{
rfc_send_disc (p_mcb, p_port->dlci);
@@ -420,10 +420,10 @@ void PORT_ParNegCnf (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT8 cl, UINT8 k)
** Function PORT_DlcEstablishInd
**
** Description This function is called from the RFCOMM layer when peer
-** device wants to establish a new DLC. If this is not the
-** first message in the establishment procedure port_handle
+** device wants to establish a new DLC. If this is not the
+** first message in the establishment procedure port_handle
** has a handle to the port control block otherwise the control
-** block should be found based on the muliplexer channel and
+** block should be found based on the muliplexer channel and
** dlci. The block should be allocated allocated before
** meaning that application already made open.
**
@@ -473,7 +473,7 @@ void PORT_DlcEstablishInd (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu)
**
** Description This function is called from the RFCOMM layer when peer
** acknowledges establish procedure (SABME/UA). Send reply
-** to the user and set state to OPENED if result was
+** to the user and set state to OPENED if result was
** successfull.
**
*******************************************************************************/
@@ -509,7 +509,7 @@ void PORT_DlcEstablishCnf (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT16 resul
p_port->state = PORT_STATE_OPENED;
/* RPN is required only if we want to tell DTE how the port should be opened */
- if ((p_port->uuid == UUID_SERVCLASS_DIALUP_NETWORKING)
+ if ((p_port->uuid == UUID_SERVCLASS_DIALUP_NETWORKING)
|| (p_port->uuid == UUID_SERVCLASS_FAX))
RFCOMM_PortNegReq (p_port->rfc.p_mcb, p_port->dlci, NULL);
else
@@ -523,8 +523,8 @@ void PORT_DlcEstablishCnf (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT16 resul
**
** Description This function is called from the RFCOMM layer when peer
** device wants to set parameters of the port. As per the spec
-** this message has to be sent before the first data packet
-** and can be sent before establish. The block should be
+** this message has to be sent before the first data packet
+** and can be sent before establish. The block should be
** allocated before meaning that application already made open.
**
*******************************************************************************/
@@ -763,7 +763,7 @@ void PORT_CloseInd (tRFC_MCB *p_mcb)
p_port = &rfc_cb.port.port[0];
for (i = 0; i < MAX_RFC_PORTS; i++, p_port++)
{
- if (p_port->rfc.p_mcb == p_mcb)
+ if (p_port->rfc.p_mcb == p_mcb)
{
port_rfc_closed (p_port, PORT_PEER_CONNECTION_FAILED);
}
@@ -775,7 +775,7 @@ void PORT_CloseInd (tRFC_MCB *p_mcb)
**
** Function Port_TimeOutCloseMux
**
-** Description This function is called when RFCOMM timesout on a command
+** Description This function is called when RFCOMM timesout on a command
** as a result multiplexer connection is closed.
**
*******************************************************************************/
@@ -789,7 +789,7 @@ void Port_TimeOutCloseMux (tRFC_MCB *p_mcb)
p_port = &rfc_cb.port.port[0];
for (i = 0; i < MAX_RFC_PORTS; i++, p_port++)
{
- if (p_port->rfc.p_mcb == p_mcb)
+ if (p_port->rfc.p_mcb == p_mcb)
{
port_rfc_closed (p_port, PORT_PEER_TIMEOUT);
}
@@ -802,7 +802,7 @@ void Port_TimeOutCloseMux (tRFC_MCB *p_mcb)
** Function PORT_DataInd
**
** Description This function is called from the RFCOMM layer when data
-** buffer is received from the peer.
+** buffer is received from the peer.
**
*******************************************************************************/
void PORT_DataInd (tRFC_MCB *p_mcb, UINT8 dlci, BT_HDR *p_buf)
@@ -901,7 +901,7 @@ void PORT_DataInd (tRFC_MCB *p_mcb, UINT8 dlci, BT_HDR *p_buf)
**
** Function PORT_FlowInd
**
-** Description This function is called from the RFCOMM layer on the flow
+** Description This function is called from the RFCOMM layer on the flow
** control signal change. Propagate change to the user.
**
*******************************************************************************/
@@ -931,13 +931,13 @@ void PORT_FlowInd (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN enable_data)
if (dlci == 0)
{
p_port = &rfc_cb.port.port[i];
- if (!p_port->in_use
+ if (!p_port->in_use
|| (p_port->rfc.p_mcb != p_mcb)
|| (p_port->rfc.state != RFC_STATE_OPENED))
continue;
}
events = 0;
-
+
/* Check if flow of data is still enabled */
events |= port_flow_control_user (p_port);
@@ -988,14 +988,14 @@ UINT32 port_rfc_send_tx_data (tPORT *p_port)
RFCOMM_TRACE_DEBUG1 ("Sending RFCOMM_DataReq tx.queue_size=%d", p_port->tx.queue_size);
RFCOMM_DataReq (p_port->rfc.p_mcb, p_port->dlci, p_buf);
-
+
events |= PORT_EV_TXCHAR;
if (p_port->tx.queue_size == 0)
{
events |= PORT_EV_TXEMPTY;
break;
- }
+ }
}
/* queue is empty-- all data sent */
else
@@ -1083,9 +1083,9 @@ void port_rfc_closed (tPORT *p_port, UINT8 res)
** Function port_get_credits
**
** Description Set initial values for credits.
-** Adjust max number of rx credits based on negotiated MTU.
-** Check max allowed num of bytes, max allowed num buffers,
-** should be less then 255
+** Adjust max number of rx credits based on negotiated MTU.
+** Check max allowed num of bytes, max allowed num buffers,
+** should be less then 255
**
*******************************************************************************/
void port_get_credits (tPORT *p_port, UINT8 k)
diff --git a/stack/rfcomm/port_utils.c b/stack/rfcomm/port_utils.c
index b764798..3de9ec0 100644
--- a/stack/rfcomm/port_utils.c
+++ b/stack/rfcomm/port_utils.c
@@ -27,7 +27,7 @@
#define asrt(s) if(!(s)) ALOGE ("## %s assert %s failed at line:%d ##",__FUNCTION__, #s, __LINE__)
-static const tPORT_STATE default_port_pars =
+static const tPORT_STATE default_port_pars =
{
PORT_BAUD_RATE_9600,
PORT_8_BITS,
@@ -48,7 +48,7 @@ static const tPORT_STATE default_port_pars =
**
** Description Look through the Port Control Blocks for a free one. Note
** that one server can open several ports with the same SCN
-** if it can support simulteneous requests from different
+** if it can support simulteneous requests from different
** clients.
**
** Returns Pointer to the PORT or NULL if not found
@@ -126,7 +126,7 @@ void port_set_defaults (tPORT *p_port)
** Function port_select_mtu
**
** Description Select MTU which will best serve connection from our
-** point of view.
+** point of view.
** If our device is 1.2 or lower we calculate how many DH5s
** fit into 1 RFCOMM buffer.
**
@@ -152,7 +152,7 @@ void port_select_mtu (tPORT *p_port)
/* We try to negotiate MTU that each packet can be split into whole
number of max packets. For example if link is 1.2 max packet size is 339 bytes.
At first calculate how many whole packets it is. MAX L2CAP is 1691 + 4 overhead.
- 1695, that will be 5 Dh5 packets. Now maximum RFCOMM packet is
+ 1695, that will be 5 Dh5 packets. Now maximum RFCOMM packet is
5 * 339 = 1695. Minus 4 bytes L2CAP header 1691. Minus RFCOMM 6 bytes header overhead 1685
For EDR 2.0 packet size is 1027. So we better send RFCOMM packet as 1 3DH5 packet
@@ -182,7 +182,7 @@ void port_select_mtu (tPORT *p_port)
p_port->rx_buf_critical = (PORT_RX_CRITICAL_WM / p_port->mtu);
if( p_port->rx_buf_critical > PORT_RX_BUF_CRITICAL_WM )
p_port->rx_buf_critical = PORT_RX_BUF_CRITICAL_WM;
- RFCOMM_TRACE_DEBUG3 ("port_select_mtu credit_rx_max %d, credit_rx_low %d, rx_buf_critical %d",
+ RFCOMM_TRACE_DEBUG3 ("port_select_mtu credit_rx_max %d, credit_rx_low %d, rx_buf_critical %d",
p_port->credit_rx_max, p_port->credit_rx_low, p_port->rx_buf_critical);
}
@@ -191,7 +191,7 @@ void port_select_mtu (tPORT *p_port)
**
** Function port_release_port
**
-** Description Release port infor control block.
+** Description Release port infor control block.
**
** Returns Pointer to the PORT or NULL if not found
**
@@ -238,7 +238,7 @@ void port_release_port (tPORT *p_port)
mask = p_port->ev_mask;
p_port_cb = p_port->p_callback;
user_port_pars = p_port->user_port_pars;
-
+
port_set_defaults(p_port);
/* restore */
p_port->ev_mask = mask;
@@ -292,7 +292,7 @@ tRFC_MCB *port_find_mcb (BD_ADDR bd_addr)
**
** Function port_find_mcb_dlci_port
**
-** Description Find port on the multiplexer channel based on DLCI. If
+** Description Find port on the multiplexer channel based on DLCI. If
** this port with DLCI not found try to use even DLCI. This
** is for the case when client is establishing connection on
** none-initiator MCB.
@@ -303,7 +303,7 @@ tRFC_MCB *port_find_mcb (BD_ADDR bd_addr)
tPORT *port_find_mcb_dlci_port (tRFC_MCB *p_mcb, UINT8 dlci)
{
UINT8 inx;
-
+
if (!p_mcb)
return (NULL);
@@ -369,7 +369,7 @@ tPORT *port_find_port (UINT8 dlci, BD_ADDR bd_addr)
for (i = 0; i < MAX_RFC_PORTS; i++)
{
p_port = &rfc_cb.port.port[i];
- if (p_port->in_use
+ if (p_port->in_use
&& (p_port->dlci == dlci)
&& !memcmp (p_port->bd_addr, bd_addr, BD_ADDR_LEN))
{
@@ -385,7 +385,7 @@ tPORT *port_find_port (UINT8 dlci, BD_ADDR bd_addr)
** Function port_flow_control_user
**
** Description Check the current user flow control and if necessary return
-** events to be send to the user based on the user's specified
+** events to be send to the user based on the user's specified
** flow control type.
**
** Returns event mask to be returned to the application
@@ -398,7 +398,7 @@ UINT32 port_flow_control_user (tPORT *p_port)
/* Flow control to the user can be caused by flow controlling by the peer */
/* (FlowInd, or flow control by the peer RFCOMM (Fcon) or internally if */
/* tx_queue is full */
- BOOLEAN fc = p_port->tx.peer_fc
+ BOOLEAN fc = p_port->tx.peer_fc
|| !p_port->rfc.p_mcb
|| !p_port->rfc.p_mcb->peer_ready
|| (p_port->tx.queue_size > PORT_TX_HIGH_WM)
@@ -497,7 +497,7 @@ void port_flow_control_peer(tPORT *p_port, BOOLEAN enable, UINT16 count)
/* If credit count is less than low credit watermark, and user */
/* did not force flow control, send a credit update */
/* There might be a special case when we just adjusted rx_max */
- if ((p_port->credit_rx <= p_port->credit_rx_low)
+ if ((p_port->credit_rx <= p_port->credit_rx_low)
&& !p_port->rx.user_fc
&& (p_port->credit_rx_max > p_port->credit_rx))
{
@@ -505,7 +505,7 @@ void port_flow_control_peer(tPORT *p_port, BOOLEAN enable, UINT16 count)
(UINT8) (p_port->credit_rx_max - p_port->credit_rx));
p_port->credit_rx = p_port->credit_rx_max;
-
+
p_port->rx.peer_fc = FALSE;
}
}
@@ -525,14 +525,14 @@ void port_flow_control_peer(tPORT *p_port, BOOLEAN enable, UINT16 count)
}
}
/* else using TS 07.10 flow control */
- else
+ else
{
/* if want to enable flow from peer */
if (enable)
{
/* If rfcomm suspended traffic from the peer based on the rx_queue_size */
/* check if it can be resumed now */
- if (p_port->rx.peer_fc
+ if (p_port->rx.peer_fc
&& (p_port->rx.queue_size < PORT_RX_LOW_WM)
&& (p_port->rx.queue.count < PORT_RX_BUF_LOW_WM))
{
@@ -554,7 +554,7 @@ void port_flow_control_peer(tPORT *p_port, BOOLEAN enable, UINT16 count)
}
/* Check the size of the rx queue. If it exceeds certain */
/* level and flow control has not been sent to the peer do it now */
- else if ( ((p_port->rx.queue_size > PORT_RX_HIGH_WM)
+ else if ( ((p_port->rx.queue_size > PORT_RX_HIGH_WM)
|| (p_port->rx.queue.count > PORT_RX_BUF_HIGH_WM))
&& !p_port->rx.peer_fc)
{
@@ -562,7 +562,7 @@ void port_flow_control_peer(tPORT *p_port, BOOLEAN enable, UINT16 count)
p_port->rx.peer_fc = TRUE;
RFCOMM_FlowReq (p_port->rfc.p_mcb, p_port->dlci, FALSE);
- }
+ }
}
}
}
diff --git a/stack/rfcomm/rfc_int.h b/stack/rfcomm/rfc_int.h
index 23c72ce..fcafdf0 100644
--- a/stack/rfcomm/rfc_int.h
+++ b/stack/rfcomm/rfc_int.h
@@ -14,7 +14,7 @@
#include "l2c_api.h"
#include "port_int.h"
-/*
+/*
** Define RFCOMM result codes
*/
#define RFCOMM_SUCCESS 0
@@ -26,9 +26,9 @@
#define RFCOMM_SECURITY_ERR 112
/*
-** Define max and min RFCOMM MTU (N1)
+** Define max and min RFCOMM MTU (N1)
*/
-#define RFCOMM_MIN_MTU 23
+#define RFCOMM_MIN_MTU 23
#define RFCOMM_MAX_MTU 32767
extern void RFCOMM_StartReq (tRFC_MCB *p_mcb);
@@ -59,7 +59,7 @@ extern void RFCOMM_ControlRsp (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_CTRL *p_pars);
extern void RFCOMM_LineStatusReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT8 line_status);
/*
-** Define logical struct used for sending and decoding MX frames
+** Define logical struct used for sending and decoding MX frames
*/
typedef struct
{
@@ -88,14 +88,14 @@ typedef struct
UINT8 *p_data;
UINT16 data_len;
} test;
- struct
+ struct
{
UINT8 dlci;
UINT8 signals;
UINT8 break_present;
UINT8 break_duration;
} msc;
- struct
+ struct
{
UINT8 ea;
UINT8 cr;
@@ -141,7 +141,7 @@ typedef struct
#define RFC_MX_STATE_DISC_WAIT_UA 6
/*
-** Define port states
+** Define port states
*/
#define RFC_STATE_CLOSED 0
#define RFC_STATE_SABME_WAIT_UA 1
@@ -150,8 +150,8 @@ typedef struct
#define RFC_STATE_OPENED 4
#define RFC_STATE_DISC_WAIT_UA 5
-/*
-** Events that can be received by multiplexer as well as port state machines
+/*
+** Events that can be received by multiplexer as well as port state machines
*/
#define RFC_EVENT_SABME 0
#define RFC_EVENT_UA 1
@@ -195,7 +195,7 @@ typedef struct
#define RFC_T2_TIMEOUT 20 /* timeout to wait for Mx UIH */
// btla-specific --
#define RFC_DISC_TIMEOUT 3 /* If something goes wrong and we send DISC we should not wait for min */
-#define RFC_CLOSE_TIMEOUT 10
+#define RFC_CLOSE_TIMEOUT 10
#define RFCOMM_CONN_TIMEOUT 120 /* first connection to be established on Mx */
@@ -269,7 +269,7 @@ extern "C" {
extern void rfc_mx_sm_execute (tRFC_MCB *p_mcb, UINT16 event, void *p_data);
-/*
+/*
** Functions provided by the rfc_port_fsm.c
*/
extern void rfc_port_sm_execute (tPORT *p_port, UINT16 event, void *p_data);
@@ -285,7 +285,7 @@ extern void rfc_process_fcon (tRFC_MCB *p_rfc_mcb, BOOLEAN is_command);
extern void rfc_process_fcoff (tRFC_MCB *p_rfc_mcb, BOOLEAN is_command);
extern void rfc_process_l2cap_congestion (tRFC_MCB *p_mcb, BOOLEAN is_congested);
-/*
+/*
** Functions provided by the rfc_utils.c
*/
tRFC_MCB *rfc_alloc_multiplexer_channel (BD_ADDR bd_addr, BOOLEAN is_initiator);
@@ -306,7 +306,7 @@ extern void rfc_inc_credit (tPORT *p_port, UINT8 credit);
extern void rfc_dec_credit (tPORT *p_port);
extern void rfc_check_send_cmd(tRFC_MCB *p_mcb, BT_HDR *p_buf);
-/*
+/*
** Functions provided by the rfc_ts_frames.c
*/
extern void rfc_send_sabme (tRFC_MCB *p_rfc_mcb, UINT8 dlci);
@@ -316,10 +316,10 @@ extern void rfc_send_disc (tRFC_MCB *p_rfc_mcb, UINT8 dlci);
extern void rfc_send_pn (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command, UINT16 mtu,
UINT8 cl, UINT8 k);
extern void rfc_send_test (tRFC_MCB *p_rfc_mcb, BOOLEAN is_command, BT_HDR *p_buf);
-extern void rfc_send_msc (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
+extern void rfc_send_msc (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
tPORT_CTRL *p_pars);
extern void rfc_send_rls (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command, UINT8 status);
-extern void rfc_send_rpn (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
+extern void rfc_send_rpn (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
tPORT_STATE *p_pars, UINT16 mask);
extern void rfc_send_fcon (tRFC_MCB *p_mcb, BOOLEAN is_command);
extern void rfc_send_fcoff (tRFC_MCB *p_mcb, BOOLEAN is_command);
@@ -328,7 +328,7 @@ extern void rfc_send_credit(tRFC_MCB *p_mcb, UINT8 dlci, UINT8 credit);
extern void rfc_process_mx_message (tRFC_MCB *p_rfc_mcb, BT_HDR *p_buf);
extern UINT8 rfc_parse_data (tRFC_MCB *p_rfc_mcb, MX_FRAME *p_frame, BT_HDR *p_buf);
-/*
+/*
** Functions provided by the rfc_disp.c
*/
diff --git a/stack/rfcomm/rfc_l2cap_if.c b/stack/rfcomm/rfc_l2cap_if.c
index ec888e0..fb10d07 100644
--- a/stack/rfcomm/rfc_l2cap_if.c
+++ b/stack/rfcomm/rfc_l2cap_if.c
@@ -20,7 +20,7 @@
#include "rfc_int.h"
-/*
+/*
** Define Callback functions to be called by L2CAP
*/
static void RFCOMM_ConnectInd (BD_ADDR bd_addr, UINT16 lcid, UINT16 psm, UINT8 id);
@@ -66,7 +66,7 @@ void rfcomm_l2cap_if_init (void)
**
** Function RFCOMM_ConnectInd
**
-** Description This is a callback function called by L2CAP when
+** Description This is a callback function called by L2CAP when
** L2CA_ConnectInd received. Allocate multiplexer control block
** and dispatch the event to it.
**
@@ -120,7 +120,7 @@ void RFCOMM_ConnectInd (BD_ADDR bd_addr, UINT16 lcid, UINT16 psm, UINT8 id)
**
** Function RFCOMM_ConnectCnf
**
-** Description This is a callback function called by L2CAP when
+** Description This is a callback function called by L2CAP when
** L2CA_ConnectCnf received. Save L2CAP handle and dispatch
** event to the FSM.
**
@@ -192,7 +192,7 @@ void RFCOMM_ConnectCnf (UINT16 lcid, UINT16 result)
**
** Function RFCOMM_ConfigInd
**
-** Description This is a callback function called by L2CAP when
+** Description This is a callback function called by L2CAP when
** L2CA_ConfigInd received. Save parameters in the control
** block and dispatch event to the FSM.
**
@@ -215,7 +215,7 @@ void RFCOMM_ConfigInd (UINT16 lcid, tL2CAP_CFG_INFO *p_cfg)
**
** Function RFCOMM_ConfigCnf
**
-** Description This is a callback function called by L2CAP when
+** Description This is a callback function called by L2CAP when
** L2CA_ConfigCnf received. Save L2CAP handle and dispatch
** event to the FSM.
**
@@ -238,7 +238,7 @@ void RFCOMM_ConfigCnf (UINT16 lcid, tL2CAP_CFG_INFO *p_cfg)
**
** Function RFCOMM_QoSViolationInd
**
-** Description This is a callback function called by L2CAP when
+** Description This is a callback function called by L2CAP when
** L2CA_QoSViolationIndInd received. Dispatch event to the FSM.
**
*******************************************************************************/
@@ -251,7 +251,7 @@ void RFCOMM_QoSViolationInd (BD_ADDR bd_addr)
**
** Function RFCOMM_DisconnectInd
**
-** Description This is a callback function called by L2CAP when
+** Description This is a callback function called by L2CAP when
** L2CA_DisconnectInd received. Dispatch event to the FSM.
**
*******************************************************************************/
@@ -278,8 +278,8 @@ void RFCOMM_DisconnectInd (UINT16 lcid, BOOLEAN is_conf_needed)
**
** Function RFCOMM_BufDataInd
**
-** Description This is a callback function called by L2CAP when
-** data RFCOMM frame is received. Parse the frames, check
+** Description This is a callback function called by L2CAP when
+** data RFCOMM frame is received. Parse the frames, check
** the checksum and dispatch event to multiplexer or port
** state machine depending on the frame destination.
**
@@ -352,7 +352,7 @@ void RFCOMM_BufDataInd (UINT16 lcid, BT_HDR *p_buf)
rfc_port_sm_execute (p_port, event, p_buf);
else
GKI_freebuf (p_buf);
-
+
if (rfc_cb.rfc.rx_frame.credit != 0)
rfc_inc_credit (p_port, rfc_cb.rfc.rx_frame.credit);
@@ -366,7 +366,7 @@ void RFCOMM_BufDataInd (UINT16 lcid, BT_HDR *p_buf)
**
** Function RFCOMM_CongestionStatusInd
**
-** Description This is a callback function called by L2CAP when
+** Description This is a callback function called by L2CAP when
** data RFCOMM L2CAP congestion status changes
**
*******************************************************************************/
diff --git a/stack/rfcomm/rfc_mx_fsm.c b/stack/rfcomm/rfc_mx_fsm.c
index 6a9b49d..2f267a7 100644
--- a/stack/rfcomm/rfc_mx_fsm.c
+++ b/stack/rfcomm/rfc_mx_fsm.c
@@ -158,8 +158,8 @@ void rfc_mx_sm_state_idle (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
**
** Function rfc_mx_sm_state_wait_conn_cnf
**
-** Description This function handles events when the multiplexer is
-** waiting for Connection Confirm from L2CAP.
+** Description This function handles events when the multiplexer is
+** waiting for Connection Confirm from L2CAP.
**
** Returns void
**
@@ -276,7 +276,7 @@ void rfc_mx_sm_state_configure (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
p_mcb->state = RFC_MX_STATE_IDLE;
L2CA_DisconnectReq (p_mcb->lcid);
- PORT_StartCnf (p_mcb, RFCOMM_ERROR);
+ PORT_StartCnf (p_mcb, RFCOMM_ERROR);
return;
}
RFCOMM_TRACE_EVENT2 ("RFCOMM MX ignored - evt:%d in state:%d", event, p_mcb->state);
@@ -287,7 +287,7 @@ void rfc_mx_sm_state_configure (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
**
** Function rfc_mx_sm_sabme_wait_ua
**
-** Description This function handles events when the multiplexer sent
+** Description This function handles events when the multiplexer sent
** SABME and is waiting for UA reply.
**
** Returns void
@@ -338,7 +338,7 @@ void rfc_mx_sm_sabme_wait_ua (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
p_mcb->state = RFC_MX_STATE_IDLE;
L2CA_DisconnectReq (p_mcb->lcid);
- PORT_StartCnf (p_mcb, RFCOMM_ERROR);
+ PORT_StartCnf (p_mcb, RFCOMM_ERROR);
return;
}
RFCOMM_TRACE_EVENT2 ("RFCOMM MX ignored - evt:%d in state:%d", event, p_mcb->state);
@@ -348,7 +348,7 @@ void rfc_mx_sm_sabme_wait_ua (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
**
** Function rfc_mx_sm_state_wait_sabme
**
-** Description This function handles events when the multiplexer is
+** Description This function handles events when the multiplexer is
** waiting for SABME on the acceptor side after configuration
**
** Returns void
@@ -382,7 +382,7 @@ void rfc_mx_sm_state_wait_sabme (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
else
{
rfc_timer_stop (p_mcb);
- PORT_StartInd (p_mcb);
+ PORT_StartInd (p_mcb);
}
return;
@@ -415,7 +415,7 @@ void rfc_mx_sm_state_wait_sabme (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
**
** Function rfc_mx_sm_state_connected
**
-** Description This function handles events when the multiplexer is
+** Description This function handles events when the multiplexer is
** in the CONNECTED state
**
** Returns void
@@ -459,7 +459,7 @@ void rfc_mx_sm_state_connected (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
**
** Function rfc_mx_sm_state_disc_wait_ua
**
-** Description This function handles events when the multiplexer sent
+** Description This function handles events when the multiplexer sent
** DISC and is waiting for UA reply.
**
** Returns void
@@ -537,8 +537,8 @@ void rfc_mx_sm_state_disc_wait_ua (tRFC_MCB *p_mcb, UINT16 event, void *p_data)
**
** Function rfc_mx_send_config_req
**
-** Description This function handles L2CA_ConnectInd message from the
-** L2CAP. Accept connection.
+** Description This function handles L2CA_ConnectInd message from the
+** L2CAP. Accept connection.
**
*******************************************************************************/
static void rfc_mx_send_config_req (tRFC_MCB *p_mcb)
@@ -568,8 +568,8 @@ static void rfc_mx_send_config_req (tRFC_MCB *p_mcb)
**
** Function rfc_mx_conf_cnf
**
-** Description This function handles L2CA_ConfigCnf message from the
-** L2CAP. If result is not success tell upper layer that
+** Description This function handles L2CA_ConfigCnf message from the
+** L2CAP. If result is not success tell upper layer that
** start has not been accepted. If initiator send SABME
** on DLCI 0. T1 is still running.
**
@@ -611,7 +611,7 @@ static void rfc_mx_conf_cnf (tRFC_MCB *p_mcb, tL2CAP_CFG_INFO *p_cfg)
**
** Function rfc_mx_conf_ind
**
-** Description This function handles L2CA_ConfigInd message from the
+** Description This function handles L2CA_ConfigInd message from the
** L2CAP. Send the L2CA_ConfigRsp message.
**
*******************************************************************************/
diff --git a/stack/rfcomm/rfc_port_fsm.c b/stack/rfcomm/rfc_port_fsm.c
index d0c6b12..2d34edb 100644
--- a/stack/rfcomm/rfc_port_fsm.c
+++ b/stack/rfcomm/rfc_port_fsm.c
@@ -86,7 +86,7 @@ void rfc_port_sm_execute (tPORT *p_port, UINT16 event, void *p_data)
** Function rfc_port_sm_state_closed
**
** Description This function handles events when the port is in
-** CLOSED state. This state exists when port is
+** CLOSED state. This state exists when port is
** being initially established.
**
** Returns void
@@ -98,7 +98,7 @@ void rfc_port_sm_state_closed (tPORT *p_port, UINT16 event, void *p_data)
{
case RFC_EVENT_OPEN:
p_port->rfc.state = RFC_STATE_ORIG_WAIT_SEC_CHECK;
- btm_sec_mx_access_request (p_port->rfc.p_mcb->bd_addr, BT_PSM_RFCOMM, TRUE,
+ btm_sec_mx_access_request (p_port->rfc.p_mcb->bd_addr, BT_PSM_RFCOMM, TRUE,
BTM_SEC_PROTO_RFCOMM, (UINT32)(p_port->dlci / 2),
&rfc_sec_check_complete, p_port);
return;
@@ -119,7 +119,7 @@ void rfc_port_sm_state_closed (tPORT *p_port, UINT16 event, void *p_data)
/* Open will be continued after security checks are passed */
p_port->rfc.state = RFC_STATE_TERM_WAIT_SEC_CHECK;
- btm_sec_mx_access_request (p_port->rfc.p_mcb->bd_addr, BT_PSM_RFCOMM, FALSE,
+ btm_sec_mx_access_request (p_port->rfc.p_mcb->bd_addr, BT_PSM_RFCOMM, FALSE,
BTM_SEC_PROTO_RFCOMM, (UINT32)(p_port->dlci / 2),
&rfc_sec_check_complete, p_port);
return;
@@ -187,18 +187,18 @@ void rfc_port_sm_sabme_wait_ua (tPORT *p_port, UINT16 event, void *p_data)
case RFC_EVENT_UA:
rfc_port_timer_stop (p_port);
p_port->rfc.state = RFC_STATE_OPENED;
- PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_SUCCESS);
+ PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_SUCCESS);
return;
case RFC_EVENT_DM:
p_port->rfc.p_mcb->is_disc_initiator = TRUE;
- PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_ERROR);
+ PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_ERROR);
rfc_port_closed (p_port);
return;
case RFC_EVENT_DISC:
rfc_send_ua (p_port->rfc.p_mcb, p_port->dlci);
- PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_ERROR);
+ PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_ERROR);
rfc_port_closed (p_port);
return;
@@ -213,7 +213,7 @@ void rfc_port_sm_sabme_wait_ua (tPORT *p_port, UINT16 event, void *p_data)
case RFC_EVENT_TIMEOUT:
p_port->rfc.state = RFC_STATE_CLOSED;
- PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_ERROR);
+ PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu, RFCOMM_ERROR);
return;
}
RFCOMM_TRACE_WARNING1 ("Port state sabme_wait_ua Event ignored %d", event);
@@ -224,7 +224,7 @@ void rfc_port_sm_sabme_wait_ua (tPORT *p_port, UINT16 event, void *p_data)
**
** Function rfc_port_sm_term_wait_sec_check
**
-** Description This function handles events for the port in the
+** Description This function handles events for the port in the
** WAIT_SEC_CHECK state. SABME has been received from the
** peer and Security Manager verifes BD_ADDR, before we can
** send ESTABLISH_IND to the Port entity
@@ -250,7 +250,7 @@ void rfc_port_sm_term_wait_sec_check (tPORT *p_port, UINT16 event, void *p_data)
}
else
{
- PORT_DlcEstablishInd (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu);
+ PORT_DlcEstablishInd (p_port->rfc.p_mcb, p_port->dlci, p_port->rfc.p_mcb->peer_l2cap_mtu);
}
return;
@@ -278,7 +278,7 @@ void rfc_port_sm_term_wait_sec_check (tPORT *p_port, UINT16 event, void *p_data)
p_port->rfc.state = RFC_STATE_CLOSED;
rfc_send_ua (p_port->rfc.p_mcb, p_port->dlci);
- PORT_DlcReleaseInd (p_port->rfc.p_mcb, p_port->dlci);
+ PORT_DlcReleaseInd (p_port->rfc.p_mcb, p_port->dlci);
return;
case RFC_EVENT_UIH:
@@ -306,7 +306,7 @@ void rfc_port_sm_term_wait_sec_check (tPORT *p_port, UINT16 event, void *p_data)
**
** Function rfc_port_sm_orig_wait_sec_check
**
-** Description This function handles events for the port in the
+** Description This function handles events for the port in the
** ORIG_WAIT_SEC_CHECK state. RFCOMM is waiting for Security
** manager to finish before sending SABME to the peer
**
@@ -321,7 +321,7 @@ void rfc_port_sm_orig_wait_sec_check (tPORT *p_port, UINT16 event, void *p_data)
if (*((UINT8 *)p_data) != BTM_SUCCESS)
{
p_port->rfc.p_mcb->is_disc_initiator = TRUE;
- PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, 0, RFCOMM_SECURITY_ERR);
+ PORT_DlcEstablishCnf (p_port->rfc.p_mcb, p_port->dlci, 0, RFCOMM_SECURITY_ERR);
rfc_port_closed (p_port);
return;
}
@@ -410,7 +410,7 @@ void rfc_port_sm_opened (tPORT *p_port, UINT16 event, void *p_data)
return;
case RFC_EVENT_DM:
- PORT_DlcReleaseInd (p_port->rfc.p_mcb, p_port->dlci);
+ PORT_DlcReleaseInd (p_port->rfc.p_mcb, p_port->dlci);
rfc_port_closed (p_port);
return;
@@ -424,7 +424,7 @@ void rfc_port_sm_opened (tPORT *p_port, UINT16 event, void *p_data)
rfc_port_timer_start (p_port, RFC_DISC_TIMEOUT);
}
else
- PORT_DlcReleaseInd (p_port->rfc.p_mcb, p_port->dlci);
+ PORT_DlcReleaseInd (p_port->rfc.p_mcb, p_port->dlci);
return;
case RFC_EVENT_UIH:
@@ -463,10 +463,10 @@ void rfc_port_sm_disc_wait_ua (tPORT *p_port, UINT16 event, void *p_data)
rfc_port_closed (p_port);
return;
- case RFC_EVENT_DATA:
- GKI_freebuf (p_data);
- return;
-
+ case RFC_EVENT_DATA:
+ GKI_freebuf (p_data);
+ return;
+
case RFC_EVENT_UA:
p_port->rfc.p_mcb->is_disc_initiator = TRUE;
/* Case falls through */
@@ -549,7 +549,7 @@ void rfc_process_pn (tRFC_MCB *p_mcb, BOOLEAN is_command, MX_FRAME *p_frame)
rfc_port_timer_stop (p_port);
PORT_ParNegCnf (p_mcb, dlci, p_frame->u.pn.mtu,
- p_frame->u.pn.conv_layer, p_frame->u.pn.k);
+ p_frame->u.pn.conv_layer, p_frame->u.pn.k);
}
@@ -557,17 +557,17 @@ void rfc_process_pn (tRFC_MCB *p_mcb, BOOLEAN is_command, MX_FRAME *p_frame)
**
** Function rfc_process_rpn
**
-** Description This function handles Remote DLC parameter negotiation
-** command/response. Pass command to the user.
+** Description This function handles Remote DLC parameter negotiation
+** command/response. Pass command to the user.
**
*******************************************************************************/
-void rfc_process_rpn (tRFC_MCB *p_mcb, BOOLEAN is_command,
+void rfc_process_rpn (tRFC_MCB *p_mcb, BOOLEAN is_command,
BOOLEAN is_request, MX_FRAME *p_frame)
{
tPORT_STATE port_pars;
tPORT *p_port;
- if ((p_port = port_find_mcb_dlci_port (p_mcb, p_frame->dlci)) == NULL)
+ if ((p_port = port_find_mcb_dlci_port (p_mcb, p_frame->dlci)) == NULL)
{
/* This is the first command on the port */
if (is_command)
@@ -575,7 +575,7 @@ void rfc_process_rpn (tRFC_MCB *p_mcb, BOOLEAN is_command,
memset(&port_pars, 0, sizeof(tPORT_STATE));
rfc_set_port_state(&port_pars, p_frame);
-
+
PORT_PortNegInd(p_mcb, p_frame->dlci, &port_pars, p_frame->u.rpn.param_mask);
}
return;
@@ -626,7 +626,7 @@ void rfc_process_rpn (tRFC_MCB *p_mcb, BOOLEAN is_command,
p_port->peer_port_pars.fc_type = (RFCOMM_FC_RTR_ON_INPUT | RFCOMM_FC_RTR_ON_OUTPUT);
p_port->rfc.expected_rsp |= RFC_RSP_RPN;
- rfc_send_rpn (p_mcb, p_frame->dlci, TRUE, &p_port->peer_port_pars,
+ rfc_send_rpn (p_mcb, p_frame->dlci, TRUE, &p_port->peer_port_pars,
RFCOMM_RPN_PM_RTR_ON_INPUT | RFCOMM_RPN_PM_RTR_ON_OUTPUT);
rfc_port_timer_start (p_port, RFC_T2_TIMEOUT) ;
return;
@@ -636,9 +636,9 @@ void rfc_process_rpn (tRFC_MCB *p_mcb, BOOLEAN is_command,
p_port->rfc.expected_rsp &= ~RFC_RSP_RPN;
/* Check if all suggested parameters were accepted */
- if (((p_frame->u.rpn.param_mask & (RFCOMM_RPN_PM_RTR_ON_INPUT | RFCOMM_RPN_PM_RTR_ON_OUTPUT)) ==
+ if (((p_frame->u.rpn.param_mask & (RFCOMM_RPN_PM_RTR_ON_INPUT | RFCOMM_RPN_PM_RTR_ON_OUTPUT)) ==
(RFCOMM_RPN_PM_RTR_ON_INPUT | RFCOMM_RPN_PM_RTR_ON_OUTPUT))
- || ((p_frame->u.rpn.param_mask & (RFCOMM_RPN_PM_RTC_ON_INPUT | RFCOMM_RPN_PM_RTC_ON_OUTPUT)) ==
+ || ((p_frame->u.rpn.param_mask & (RFCOMM_RPN_PM_RTC_ON_INPUT | RFCOMM_RPN_PM_RTC_ON_OUTPUT)) ==
(RFCOMM_RPN_PM_RTC_ON_INPUT | RFCOMM_RPN_PM_RTC_ON_OUTPUT)))
{
PORT_PortNegCnf (p_mcb, p_port->dlci, &port_pars, RFCOMM_SUCCESS);
@@ -655,7 +655,7 @@ void rfc_process_rpn (tRFC_MCB *p_mcb, BOOLEAN is_command,
p_port->rfc.expected_rsp |= RFC_RSP_RPN;
- rfc_send_rpn (p_mcb, p_frame->dlci, TRUE, &p_port->peer_port_pars,
+ rfc_send_rpn (p_mcb, p_frame->dlci, TRUE, &p_port->peer_port_pars,
RFCOMM_RPN_PM_RTC_ON_INPUT | RFCOMM_RPN_PM_RTC_ON_OUTPUT);
rfc_port_timer_start (p_port, RFC_T2_TIMEOUT) ;
return;
@@ -674,8 +674,8 @@ void rfc_process_rpn (tRFC_MCB *p_mcb, BOOLEAN is_command,
**
** Function rfc_process_msc
**
-** Description This function handles Modem Status Command.
-** Pass command to the user.
+** Description This function handles Modem Status Command.
+** Pass command to the user.
**
*******************************************************************************/
void rfc_process_msc (tRFC_MCB *p_mcb, BOOLEAN is_command, MX_FRAME *p_frame)
@@ -686,7 +686,7 @@ void rfc_process_msc (tRFC_MCB *p_mcb, BOOLEAN is_command, MX_FRAME *p_frame)
BOOLEAN new_peer_fc = FALSE;
p_port = port_find_mcb_dlci_port (p_mcb, p_frame->dlci);
- if (p_port == NULL)
+ if (p_port == NULL)
return;
pars.modem_signal = 0;
@@ -704,8 +704,8 @@ void rfc_process_msc (tRFC_MCB *p_mcb, BOOLEAN is_command, MX_FRAME *p_frame)
pars.modem_signal |= MODEM_SIGNAL_DCD;
pars.fc = ((modem_signals & RFCOMM_MSC_FC) == RFCOMM_MSC_FC);
-
- pars.break_signal = (p_frame->u.msc.break_present) ?
+
+ pars.break_signal = (p_frame->u.msc.break_present) ?
p_frame->u.msc.break_duration : 0;
pars.discard_buffers = 0;
pars.break_signal_seq = RFCOMM_CTRL_BREAK_IN_SEQ; /* this is default */
@@ -745,8 +745,8 @@ void rfc_process_msc (tRFC_MCB *p_mcb, BOOLEAN is_command, MX_FRAME *p_frame)
**
** Function rfc_process_rls
**
-** Description This function handles Remote Line Status command.
-** Pass command to the user.
+** Description This function handles Remote Line Status command.
+** Pass command to the user.
**
*******************************************************************************/
void rfc_process_rls (tRFC_MCB *p_mcb, BOOLEAN is_command, MX_FRAME *p_frame)
@@ -790,7 +790,7 @@ void rfc_process_nsc (tRFC_MCB *p_mcb, MX_FRAME *p_frame)
** Function rfc_process_test
**
** Description This function handles Test frame. If this is a command
-** reply to it. Otherwise pass response to the user.
+** reply to it. Otherwise pass response to the user.
**
*******************************************************************************/
void rfc_process_test_rsp (tRFC_MCB *p_mcb, BT_HDR *p_buf)
@@ -803,8 +803,8 @@ void rfc_process_test_rsp (tRFC_MCB *p_mcb, BT_HDR *p_buf)
**
** Function rfc_process_fcon
**
-** Description This function handles FCON frame. The peer entity is able
-** to receive new information
+** Description This function handles FCON frame. The peer entity is able
+** to receive new information
**
*******************************************************************************/
void rfc_process_fcon (tRFC_MCB *p_mcb, BOOLEAN is_command)
@@ -824,8 +824,8 @@ void rfc_process_fcon (tRFC_MCB *p_mcb, BOOLEAN is_command)
**
** Function rfc_process_fcoff
**
-** Description This function handles FCOFF frame. The peer entity is unable
-** to receive new information
+** Description This function handles FCOFF frame. The peer entity is unable
+** to receive new information
**
*******************************************************************************/
void rfc_process_fcoff (tRFC_MCB *p_mcb, BOOLEAN is_command)
diff --git a/stack/rfcomm/rfc_port_if.c b/stack/rfcomm/rfc_port_if.c
index c9159f5..03fb339 100644
--- a/stack/rfcomm/rfc_port_if.c
+++ b/stack/rfcomm/rfc_port_if.c
@@ -44,7 +44,7 @@ void RFCOMM_StartReq (tRFC_MCB *p_mcb)
** Function RFCOMM_StartRsp
**
** Description This function handles Start Response from the upper layer.
-** Save upper layer handle and result of the Start Indication
+** Save upper layer handle and result of the Start Indication
** in the control block and dispatch event to the FSM.
**
*******************************************************************************/
@@ -58,18 +58,18 @@ void RFCOMM_StartRsp (tRFC_MCB *p_mcb, UINT16 result)
**
** Function RFCOMM_DlcEstablishReq
**
-** Description This function is called by the user app to establish
+** Description This function is called by the user app to establish
** connection with the specific dlci on a specific bd device.
-** It will allocate RFCOMM connection control block if not
-** allocated before and dispatch open event to the state
+** It will allocate RFCOMM connection control block if not
+** allocated before and dispatch open event to the state
** machine.
**
*******************************************************************************/
void RFCOMM_DlcEstablishReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu)
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
-
- if (p_mcb->state != RFC_MX_STATE_CONNECTED)
+
+ if (p_mcb->state != RFC_MX_STATE_CONNECTED)
{
PORT_DlcEstablishCnf (p_mcb, dlci, 0, RFCOMM_ERROR);
return;
@@ -90,7 +90,7 @@ void RFCOMM_DlcEstablishReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu)
void RFCOMM_DlcEstablishRsp (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT16 result)
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
-
+
if ((p_mcb->state != RFC_MX_STATE_CONNECTED) && (result == RFCOMM_SUCCESS))
{
PORT_DlcReleaseInd (p_mcb, dlci);
@@ -108,7 +108,7 @@ void RFCOMM_DlcEstablishRsp (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT16 res
** Description This function is called by the user app to start
** DLC parameter negotiation. Port emulation can send this
** request before actually establishing the DLC. In this
-** case the function will allocate RFCOMM connection control
+** case the function will allocate RFCOMM connection control
** block.
**
*******************************************************************************/
@@ -119,7 +119,7 @@ void RFCOMM_ParNegReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu)
UINT8 cl;
UINT8 k;
- if (p_mcb->state != RFC_MX_STATE_CONNECTED)
+ if (p_mcb->state != RFC_MX_STATE_CONNECTED)
{
p_port->error = PORT_PAR_NEG_FAILED;
return;
@@ -157,7 +157,7 @@ void RFCOMM_ParNegReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu)
** Function RFCOMM_ParNegRsp
**
** Description This function is called by the user app to acknowledge
-** DLC parameter negotiation.
+** DLC parameter negotiation.
**
*******************************************************************************/
void RFCOMM_ParNegRsp (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT8 cl, UINT8 k)
@@ -175,17 +175,17 @@ void RFCOMM_ParNegRsp (tRFC_MCB *p_mcb, UINT8 dlci, UINT16 mtu, UINT8 cl, UINT8
** Function RFCOMM_PortNegReq
**
** Description This function is called by the user app to start
-** Remote Port parameter negotiation. Port emulation can
-** send this request before actually establishing the DLC.
-** In this case the function will allocate RFCOMM connection
+** Remote Port parameter negotiation. Port emulation can
+** send this request before actually establishing the DLC.
+** In this case the function will allocate RFCOMM connection
** control block.
**
*******************************************************************************/
void RFCOMM_PortNegReq (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_STATE *p_pars)
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
-
- if (p_mcb->state != RFC_MX_STATE_CONNECTED)
+
+ if (p_mcb->state != RFC_MX_STATE_CONNECTED)
{
PORT_PortNegCnf (p_mcb, dlci, NULL, RFCOMM_ERROR);
return;
@@ -208,13 +208,13 @@ void RFCOMM_PortNegReq (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_STATE *p_pars)
** Function RFCOMM_PortNegRsp
**
** Description This function is called by the user app to acknowledge
-** Port parameters negotiation.
+** Port parameters negotiation.
**
*******************************************************************************/
-void RFCOMM_PortNegRsp (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_STATE *p_pars,
+void RFCOMM_PortNegRsp (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_STATE *p_pars,
UINT16 param_mask)
{
- if (p_mcb->state != RFC_MX_STATE_CONNECTED)
+ if (p_mcb->state != RFC_MX_STATE_CONNECTED)
return;
rfc_send_rpn (p_mcb, dlci, FALSE, p_pars, param_mask);
@@ -233,7 +233,7 @@ void RFCOMM_ControlReq (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_CTRL *p_pars)
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
- if ((p_port->state != PORT_STATE_OPENED)
+ if ((p_port->state != PORT_STATE_OPENED)
|| (p_port->rfc.state != RFC_STATE_OPENED))
return;
@@ -251,7 +251,7 @@ void RFCOMM_ControlReq (tRFC_MCB *p_mcb, UINT8 dlci, tPORT_CTRL *p_pars)
**
** Function RFCOMM_FlowReq
**
-** Description This function is called by the port entity when flow
+** Description This function is called by the port entity when flow
** control state has changed. Enable flag passed shows if
** port can accept more data.
**
@@ -260,14 +260,14 @@ void RFCOMM_FlowReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT8 enable)
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
- if ((p_port->state != PORT_STATE_OPENED)
+ if ((p_port->state != PORT_STATE_OPENED)
|| (p_port->rfc.state != RFC_STATE_OPENED))
return;
p_port->local_ctrl.fc = !enable;
p_port->rfc.expected_rsp |= RFC_RSP_MSC;
-
+
rfc_send_msc (p_mcb, dlci, TRUE, &p_port->local_ctrl);
rfc_port_timer_start (p_port, RFC_T2_TIMEOUT) ;
@@ -286,7 +286,7 @@ void RFCOMM_LineStatusReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT8 status)
{
tPORT *p_port = port_find_mcb_dlci_port (p_mcb, dlci);
- if ((p_port->state != PORT_STATE_OPENED)
+ if ((p_port->state != PORT_STATE_OPENED)
|| (p_port->rfc.state != RFC_STATE_OPENED))
return;
@@ -301,7 +301,7 @@ void RFCOMM_LineStatusReq (tRFC_MCB *p_mcb, UINT8 dlci, UINT8 status)
**
** Function RFCOMM_DlcReleaseReq
**
-** Description This function is called by the PORT unit to close DLC
+** Description This function is called by the PORT unit to close DLC
**
*******************************************************************************/
void RFCOMM_DlcReleaseReq (tRFC_MCB *p_mcb, UINT8 dlci)
diff --git a/stack/rfcomm/rfc_ts_frames.c b/stack/rfcomm/rfc_ts_frames.c
index ec5385d..ad9aaef 100644
--- a/stack/rfcomm/rfc_ts_frames.c
+++ b/stack/rfcomm/rfc_ts_frames.c
@@ -168,7 +168,7 @@ void rfc_send_buf_uih (tRFC_MCB *p_mcb, UINT8 dlci, BT_HDR *p_buf)
if (credits)
p_buf->offset--;
-
+
p_data = (UINT8 *)(p_buf + 1) + p_buf->offset;
/* UIH frame, command, PF = 0, dlci */
@@ -316,7 +316,7 @@ void rfc_send_fcoff (tRFC_MCB *p_mcb, BOOLEAN is_command)
** Description This function sends Modem Status Command Frame.
**
*******************************************************************************/
-void rfc_send_msc (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
+void rfc_send_msc (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
tPORT_CTRL *p_pars)
{
BT_HDR *p_buf;
@@ -343,13 +343,13 @@ void rfc_send_msc (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
*p_data++ = RFCOMM_EA | (len << 1);
*p_data++ = RFCOMM_EA | RFCOMM_CR_MASK | (dlci << RFCOMM_SHIFT_DLCI);
- *p_data++ = RFCOMM_EA |
+ *p_data++ = RFCOMM_EA |
((p_pars->fc) ? RFCOMM_MSC_FC : 0) |
((signals & MODEM_SIGNAL_DTRDSR) ? RFCOMM_MSC_RTC : 0) |
((signals & MODEM_SIGNAL_RTSCTS) ? RFCOMM_MSC_RTR : 0) |
((signals & MODEM_SIGNAL_RI) ? RFCOMM_MSC_IC : 0) |
((signals & MODEM_SIGNAL_DCD) ? RFCOMM_MSC_DV : 0);
-
+
if (break_duration)
{
*p_data++ = RFCOMM_EA | RFCOMM_MSC_BREAK_PRESENT_MASK |
@@ -415,8 +415,8 @@ void rfc_send_nsc (tRFC_MCB *p_mcb)
*p_data++ = RFCOMM_EA | RFCOMM_I_CR(FALSE) | RFCOMM_MX_NSC;
*p_data++ = RFCOMM_EA | (RFCOMM_MX_NSC_LEN << 1);
- *p_data++ = rfc_cb.rfc.rx_frame.ea |
- (rfc_cb.rfc.rx_frame.cr << RFCOMM_SHIFT_CR) |
+ *p_data++ = rfc_cb.rfc.rx_frame.ea |
+ (rfc_cb.rfc.rx_frame.cr << RFCOMM_SHIFT_CR) |
rfc_cb.rfc.rx_frame.type;
/* Total length is sizeof NSC data + mx header 2 */
@@ -433,7 +433,7 @@ void rfc_send_nsc (tRFC_MCB *p_mcb)
** Description This function sends Remote Port Negotiation Command
**
*******************************************************************************/
-void rfc_send_rpn (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
+void rfc_send_rpn (tRFC_MCB *p_mcb, UINT8 dlci, BOOLEAN is_command,
tPORT_STATE *p_pars, UINT16 mask)
{
BT_HDR *p_buf;
@@ -605,8 +605,8 @@ UINT8 rfc_parse_data (tRFC_MCB *p_mcb, MX_FRAME *p_frame, BT_HDR *p_buf)
switch (p_frame->type)
{
case RFCOMM_SABME:
- if (RFCOMM_FRAME_IS_RSP(p_mcb->is_initiator, p_frame->cr)
- || !p_frame->pf || len || !RFCOMM_VALID_DLCI (p_frame->dlci)
+ if (RFCOMM_FRAME_IS_RSP(p_mcb->is_initiator, p_frame->cr)
+ || !p_frame->pf || len || !RFCOMM_VALID_DLCI (p_frame->dlci)
|| !rfc_check_fcs (RFCOMM_CTRL_FRAME_LEN, p_start, fcs))
{
RFCOMM_TRACE_ERROR0 ("Bad SABME");
@@ -616,7 +616,7 @@ UINT8 rfc_parse_data (tRFC_MCB *p_mcb, MX_FRAME *p_frame, BT_HDR *p_buf)
return (RFC_EVENT_SABME);
case RFCOMM_UA:
- if (RFCOMM_FRAME_IS_CMD(p_mcb->is_initiator, p_frame->cr)
+ if (RFCOMM_FRAME_IS_CMD(p_mcb->is_initiator, p_frame->cr)
|| !p_frame->pf || len || !RFCOMM_VALID_DLCI (p_frame->dlci)
|| !rfc_check_fcs (RFCOMM_CTRL_FRAME_LEN, p_start, fcs))
{
@@ -627,8 +627,8 @@ UINT8 rfc_parse_data (tRFC_MCB *p_mcb, MX_FRAME *p_frame, BT_HDR *p_buf)
return (RFC_EVENT_UA);
case RFCOMM_DM:
- if (RFCOMM_FRAME_IS_CMD(p_mcb->is_initiator, p_frame->cr)
- || len || !RFCOMM_VALID_DLCI(p_frame->dlci)
+ if (RFCOMM_FRAME_IS_CMD(p_mcb->is_initiator, p_frame->cr)
+ || len || !RFCOMM_VALID_DLCI(p_frame->dlci)
|| !rfc_check_fcs (RFCOMM_CTRL_FRAME_LEN, p_start, fcs))
{
RFCOMM_TRACE_ERROR0 ("Bad DM");
@@ -638,8 +638,8 @@ UINT8 rfc_parse_data (tRFC_MCB *p_mcb, MX_FRAME *p_frame, BT_HDR *p_buf)
return (RFC_EVENT_DM);
case RFCOMM_DISC:
- if (RFCOMM_FRAME_IS_RSP(p_mcb->is_initiator, p_frame->cr)
- || !p_frame->pf || len || !RFCOMM_VALID_DLCI(p_frame->dlci)
+ if (RFCOMM_FRAME_IS_RSP(p_mcb->is_initiator, p_frame->cr)
+ || !p_frame->pf || len || !RFCOMM_VALID_DLCI(p_frame->dlci)
|| !rfc_check_fcs (RFCOMM_CTRL_FRAME_LEN, p_start, fcs))
{
RFCOMM_TRACE_ERROR0 ("Bad DISC");
@@ -649,11 +649,11 @@ UINT8 rfc_parse_data (tRFC_MCB *p_mcb, MX_FRAME *p_frame, BT_HDR *p_buf)
return (RFC_EVENT_DISC);
case RFCOMM_UIH:
- if (!RFCOMM_VALID_DLCI(p_frame->dlci))
+ if (!RFCOMM_VALID_DLCI(p_frame->dlci))
{
RFCOMM_TRACE_ERROR0 ("Bad UIH - invalid DLCI");
return (RFC_EVENT_BAD_FRAME);
- }
+ }
else if (!rfc_check_fcs (2, p_start, fcs))
{
RFCOMM_TRACE_ERROR0 ("Bad UIH - FCS");
@@ -665,7 +665,7 @@ UINT8 rfc_parse_data (tRFC_MCB *p_mcb, MX_FRAME *p_frame, BT_HDR *p_buf)
RFCOMM_TRACE_ERROR0 ("Bad UIH - response");
return (RFC_EVENT_UIH);
}
- else
+ else
return (RFC_EVENT_UIH);
}
@@ -677,7 +677,7 @@ UINT8 rfc_parse_data (tRFC_MCB *p_mcb, MX_FRAME *p_frame, BT_HDR *p_buf)
**
** Function rfc_process_mx_message
**
-** Description This function processes UIH frames received on the
+** Description This function processes UIH frames received on the
** multiplexer control channel.
**
*******************************************************************************/
@@ -708,7 +708,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
mx_len = *p_data++ >> RFCOMM_SHIFT_LENGTH1;
length--;
-
+
if (!ea)
{
mx_len += *p_data++ << RFCOMM_SHIFT_LENGTH2;
@@ -833,7 +833,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
if ((length != RFCOMM_MX_RPN_REQ_LEN) && (length != RFCOMM_MX_RPN_LEN))
break;
- ea = *p_data & RFCOMM_EA;
+ ea = *p_data & RFCOMM_EA;
cr = (*p_data & RFCOMM_CR_MASK) >> RFCOMM_SHIFT_CR;
p_rx_frame->dlci = *p_data++ >> RFCOMM_SHIFT_DLCI;
@@ -868,7 +868,7 @@ void rfc_process_mx_message (tRFC_MCB *p_mcb, BT_HDR *p_buf)
if (length != RFCOMM_MX_RLS_LEN)
break;
- ea = *p_data & RFCOMM_EA;
+ ea = *p_data & RFCOMM_EA;
cr = (*p_data & RFCOMM_CR_MASK) >> RFCOMM_SHIFT_CR;
p_rx_frame->dlci = *p_data++ >> RFCOMM_SHIFT_DLCI;
diff --git a/stack/rfcomm/rfc_utils.c b/stack/rfcomm/rfc_utils.c
index e3f194d..9395891 100644
--- a/stack/rfcomm/rfc_utils.c
+++ b/stack/rfcomm/rfc_utils.c
@@ -29,7 +29,7 @@
** Description Reversed CRC Table , 8-bit, poly=0x07
** (GSM 07.10 TS 101 369 V6.3.0)
*******************************************************************************/
-static const UINT8 rfc_crctable[] =
+static const UINT8 rfc_crctable[] =
{
0x00, 0x91, 0xE3, 0x72, 0x07, 0x96, 0xE4, 0x75, 0x0E, 0x9F, 0xED, 0x7C, 0x09, 0x98, 0xEA, 0x7B,
0x1C, 0x8D, 0xFF, 0x6E, 0x1B, 0x8A, 0xF8, 0x69, 0x12, 0x83, 0xF1, 0x60, 0x15, 0x84, 0xF6, 0x67,
@@ -57,7 +57,7 @@ static const UINT8 rfc_crctable[] =
**
** Function rfc_calc_fcs
**
-** Description This function calculate FCS for the RFCOMM frame
+** Description This function calculate FCS for the RFCOMM frame
** (GSM 07.10 TS 101 369 V6.3.0)
**
** Input len - number of bytes in the message
@@ -82,7 +82,7 @@ UINT8 rfc_calc_fcs (UINT16 len, UINT8 *p)
**
** Function rfc_check_fcs
**
-** Description This function checks FCS for the RFCOMM frame
+** Description This function checks FCS for the RFCOMM frame
** (GSM 07.10 TS 101 369 V6.3.0)
**
** Input len - number of bytes in the message
@@ -192,7 +192,7 @@ void rfc_release_multiplexer_channel (tRFC_MCB *p_mcb)
void rfc_timer_start (tRFC_MCB *p_mcb, UINT16 timeout)
{
TIMER_LIST_ENT *p_tle = &p_mcb->tle;
-
+
RFCOMM_TRACE_EVENT1 ("rfc_timer_start - timeout:%d", timeout);
p_tle->param = (UINT32)p_mcb;
@@ -205,7 +205,7 @@ void rfc_timer_start (tRFC_MCB *p_mcb, UINT16 timeout)
**
** Function rfc_timer_stop
**
-** Description Stop RFC Timer
+** Description Stop RFC Timer
**
*******************************************************************************/
void rfc_timer_stop (tRFC_MCB *p_mcb)
@@ -239,7 +239,7 @@ void rfc_port_timer_start (tPORT *p_port, UINT16 timeout)
**
** Function rfc_port_timer_stop
**
-** Description Stop RFC Timer
+** Description Stop RFC Timer
**
*******************************************************************************/
void rfc_port_timer_stop (tPORT *p_port)
@@ -315,8 +315,8 @@ void rfcomm_process_timeout (TIMER_LIST_ENT *p_tle)
**
** Function rfc_sec_check_complete
**
-** Description The function called when Security Manager finishes
-** verification of the service side connection
+** Description The function called when Security Manager finishes
+** verification of the service side connection
**
** Returns void
**
@@ -326,7 +326,7 @@ void rfc_sec_check_complete (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
tPORT *p_port = (tPORT *)p_ref_data;
/* Verify that PORT is still waiting for Security to complete */
- if (!p_port->in_use
+ if (!p_port->in_use
|| ((p_port->rfc.state != RFC_STATE_ORIG_WAIT_SEC_CHECK)
&& (p_port->rfc.state != RFC_STATE_TERM_WAIT_SEC_CHECK)))
return;
@@ -340,18 +340,18 @@ void rfc_sec_check_complete (BD_ADDR bd_addr, void *p_ref_data, UINT8 res)
** Function rfc_port_closed
**
** Description The function is called when port is released based on the
-** event received from the lower layer, typically L2CAP
+** event received from the lower layer, typically L2CAP
** connection down, DISC, or DM frame.
**
** Returns void
**
*******************************************************************************/
void rfc_port_closed (tPORT *p_port)
-{
+{
tRFC_MCB *p_mcb = p_port->rfc.p_mcb;
RFCOMM_TRACE_DEBUG0 ("rfc_port_closed");
-
+
rfc_port_timer_stop (p_port);
p_port->rfc.state = RFC_STATE_CLOSED;
@@ -385,7 +385,7 @@ void rfc_inc_credit (tPORT *p_port, UINT8 credit)
if (p_port->rfc.p_mcb->flow == PORT_FC_CREDIT)
{
p_port->credit_tx += credit;
-
+
RFCOMM_TRACE_EVENT1 ("rfc_inc_credit:%d", p_port->credit_tx);
if (p_port->tx.peer_fc == TRUE)
@@ -410,7 +410,7 @@ void rfc_dec_credit (tPORT *p_port)
{
if (p_port->credit_tx > 0)
p_port->credit_tx--;
-
+
if (p_port->credit_tx == 0)
p_port->tx.peer_fc = TRUE;
}