summaryrefslogtreecommitdiffstats
path: root/stack/include/port_api.h
blob: 2f649328522cc2cbc0df4b1dedb9a5fc5eef1bc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
/******************************************************************************
 *
 *  Copyright (C) 1999-2012 Broadcom Corporation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at:
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 ******************************************************************************/

/******************************************************************************
 *
 *  this file contains the PORT API definitions
 *
 ******************************************************************************/
#ifndef PORT_API_H
#define PORT_API_H

#include "bt_target.h"

/*****************************************************************************
**  Constants and Types
*****************************************************************************/

/*
** Define port settings structure send from the application in the
** 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  baud_rate;

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

    UINT8  byte_size;

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

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

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

    UINT8   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 fc_type;

    UINT8 rx_char1;

#define PORT_XON_DC1              0x11
    UINT8 xon_char;

#define PORT_XOFF_DC3             0x13
    UINT8 xoff_char;

} tPORT_STATE;


/*
** Define the callback function prototypes.  Parameters are specific
** to each event and are described bellow
*/
typedef int  (tPORT_DATA_CALLBACK) (UINT16 port_handle, void *p_data, UINT16 len);

#define DATA_CO_CALLBACK_TYPE_INCOMING          1
#define DATA_CO_CALLBACK_TYPE_OUTGOING_SIZE     2
#define DATA_CO_CALLBACK_TYPE_OUTGOING          3
typedef int  (tPORT_DATA_CO_CALLBACK) (UINT16 port_handle, UINT8* p_buf, UINT16 len, int type);

typedef void (tPORT_CALLBACK) (UINT32 code, UINT16 port_handle);

/*
** Define events that registered application can receive in the callback
*/

#define PORT_EV_RXCHAR  0x00000001   /* Any Character received */
#define PORT_EV_RXFLAG  0x00000002   /* Received certain character */
#define PORT_EV_TXEMPTY 0x00000004   /* Transmitt Queue Empty */
#define PORT_EV_CTS     0x00000008   /* CTS changed state */
#define PORT_EV_DSR     0x00000010   /* DSR changed state */
#define PORT_EV_RLSD    0x00000020   /* RLSD changed state */
#define PORT_EV_BREAK   0x00000040   /* BREAK received */
#define PORT_EV_ERR     0x00000080   /* Line status error occurred */
#define PORT_EV_RING    0x00000100   /* Ring signal detected */
#define PORT_EV_CTSS    0x00000400   /* CTS state */
#define PORT_EV_DSRS    0x00000800   /* DSR state */
#define PORT_EV_RLSDS   0x00001000   /* RLSD state */
#define PORT_EV_OVERRUN 0x00002000   /* receiver buffer overrun */
#define PORT_EV_TXCHAR  0x00004000   /* Any character transmitted */

#define PORT_EV_CONNECTED    0x00000200  /* RFCOMM connection established */
#define PORT_EV_CONNECT_ERR  0x00008000  /* Was not able to establish connection */
                                     /* or disconnected */
#define PORT_EV_FC      0x00010000   /* data flow enabled flag changed by remote */
#define PORT_EV_FCS     0x00020000   /* data flow enable status true = enabled */

/*
** 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
*/
#define PORT_SUCCESS                0

#define PORT_ERR_BASE               0

#define PORT_UNKNOWN_ERROR          (PORT_ERR_BASE + 1)
#define PORT_ALREADY_OPENED         (PORT_ERR_BASE + 2)
#define PORT_CMD_PENDING            (PORT_ERR_BASE + 3)
#define PORT_APP_NOT_REGISTERED     (PORT_ERR_BASE + 4)
#define PORT_NO_MEM                 (PORT_ERR_BASE + 5)
#define PORT_NO_RESOURCES           (PORT_ERR_BASE + 6)
#define PORT_BAD_BD_ADDR            (PORT_ERR_BASE + 7)
#define PORT_BAD_HANDLE             (PORT_ERR_BASE + 9)
#define PORT_NOT_OPENED             (PORT_ERR_BASE + 10)
#define PORT_LINE_ERR               (PORT_ERR_BASE + 11)
#define PORT_START_FAILED           (PORT_ERR_BASE + 12)
#define PORT_PAR_NEG_FAILED         (PORT_ERR_BASE + 13)
#define PORT_PORT_NEG_FAILED        (PORT_ERR_BASE + 14)
#define PORT_SEC_FAILED             (PORT_ERR_BASE + 15)
#define PORT_PEER_CONNECTION_FAILED (PORT_ERR_BASE + 16)
#define PORT_PEER_FAILED            (PORT_ERR_BASE + 17)
#define PORT_PEER_TIMEOUT           (PORT_ERR_BASE + 18)
#define PORT_CLOSED                 (PORT_ERR_BASE + 19)
#define PORT_TX_FULL                (PORT_ERR_BASE + 20)
#define PORT_LOCAL_CLOSED           (PORT_ERR_BASE + 21)
#define PORT_LOCAL_TIMEOUT          (PORT_ERR_BASE + 22)
#define PORT_TX_QUEUE_DISABLED      (PORT_ERR_BASE + 23)
#define PORT_PAGE_TIMEOUT           (PORT_ERR_BASE + 24)
#define PORT_INVALID_SCN            (PORT_ERR_BASE + 25)


/*****************************************************************************
**  External Function Declarations
*****************************************************************************/
#ifdef __cplusplus
extern "C"
{
#endif

/*******************************************************************************
**
** Function         RFCOMM_CreateConnection
**
** Description      RFCOMM_CreateConnection function is used from the application
**                  to establish serial port connection to the peer device,
**                  or allow RFCOMM to accept a connection from the peer
**                  application.
**
** Parameters:      scn          - Service Channel Number as registered with
**                                 the SDP (server) or obtained using SDP from
**                                 the peer device (client).
**                  is_server    - TRUE if requesting application is a server
**                  mtu          - Maximum frame size the application can accept
**                  bd_addr      - BD_ADDR of the peer (client)
**                  mask         - specifies events to be enabled.  A value
**                                 of zero disables all events.
**                  p_handle     - OUT pointer to the handle.
**                  p_mgmt_cb    - pointer to callback function to receive
**                                 connection up/down events.
** Notes:
**
** Server can call this function with the same scn parameter multiple times if
** it is ready to accept multiple simulteneous connections.
**
** DLCI for the connection is (scn * 2 + 1) if client originates connection on
** existing none initiator multiplexer channel.  Otherwise it is (scn * 2).
** For the server DLCI can be changed later if client will be calling it using
** (scn * 2 + 1) dlci.
**
*******************************************************************************/
RFC_API extern int RFCOMM_CreateConnection (UINT16 uuid, UINT8 scn,
                                            BOOLEAN is_server, UINT16 mtu,
                                            BD_ADDR bd_addr, UINT16 *p_handle,
                                            tPORT_CALLBACK *p_mgmt_cb);


/*******************************************************************************
**
** Function         RFCOMM_RemoveConnection
**
** Description      This function is called to close the specified connection.
**
** Parameters:      handle     - Handle of the port returned in the Open
**
*******************************************************************************/
RFC_API extern int RFCOMM_RemoveConnection (UINT16 handle);


/*******************************************************************************
**
** Function         RFCOMM_RemoveServer
**
** Description      This function is called to close the server port.
**
** Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
**
*******************************************************************************/
RFC_API extern int RFCOMM_RemoveServer (UINT16 handle);


/*******************************************************************************
**
** Function         PORT_SetEventCallback
**
** Description      Set event 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 an event
**                                 specified in the mask occurs.
**
*******************************************************************************/
RFC_API extern int PORT_SetEventCallback (UINT16 port_handle,
                                          tPORT_CALLBACK *p_port_cb);


/*******************************************************************************
**
** 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.
**
*******************************************************************************/
RFC_API extern int PORT_SetDataCallback (UINT16 port_handle,
                                         tPORT_DATA_CALLBACK *p_cb);

RFC_API extern int PORT_SetDataCOCallback (UINT16 port_handle, tPORT_DATA_CO_CALLBACK *p_port_cb);
/*******************************************************************************
**
** Function         PORT_SetEventMask
**
** Description      This function is called to close the specified connection.
**
** Parameters:      handle - Handle of the port returned in the Open
**                  mask   - specifies events to be enabled.  A value
**                           of zero disables all events.
**
*******************************************************************************/
RFC_API extern int PORT_SetEventMask (UINT16 port_handle, UINT32 mask);


/*******************************************************************************
**
** Function         PORT_CheckConnection
**
** Description      This function returns PORT_SUCCESS if connection referenced
**                  by handle is up and running
**
** Parameters:      handle     - Handle of the port returned in the Open
**                  bd_addr    - OUT bd_addr of the peer
**                  p_lcid     - OUT L2CAP's LCID
**
*******************************************************************************/
RFC_API extern int PORT_CheckConnection (UINT16 handle, BD_ADDR bd_addr,
                                         UINT16 *p_lcid);

/*******************************************************************************
**
** Function         PORT_IsOpening
**
** Description      This function returns TRUE if there is any RFCOMM connection
**                  opening in process.
**
** Parameters:      TRUE if any connection opening is found
**                  bd_addr    - bd_addr of the peer
**
*******************************************************************************/
RFC_API extern BOOLEAN PORT_IsOpening (BD_ADDR bd_addr);

/*******************************************************************************
**
** Function         PORT_SetState
**
** Description      This function configures connection according to the
**                  specifications in the tPORT_STATE structure.
**
** Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
**                  p_settings - Pointer to a tPORT_STATE structure containing
**                               configuration information for the connection.
**
*******************************************************************************/
RFC_API extern int PORT_SetState (UINT16 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.
**
*******************************************************************************/
RFC_API extern int PORT_GetRxQueueCnt (UINT16 handle, UINT16 *p_rx_queue_count);

/*******************************************************************************
**
** Function         PORT_GetState
**
** Description      This function is called to fill tPORT_STATE structure
**                  with the current control settings for the port
**
** Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
**                  p_settings - Pointer to a tPORT_STATE structure in which
**                               configuration information is returned.
**
*******************************************************************************/
RFC_API extern int PORT_GetState (UINT16 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 */

RFC_API extern int PORT_Control (UINT16 handle, UINT8 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
**
*******************************************************************************/
RFC_API extern int PORT_FlowControl (UINT16 handle, BOOLEAN 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
#define PORT_DCD_ON             0x08

/*
** Define default initial local modem signals state set after connection established
*/
#define PORT_OBEX_DEFAULT_SIGNAL_STATE  (PORT_DTRDSR_ON | PORT_CTSRTS_ON | PORT_DCD_ON)
#define PORT_SPP_DEFAULT_SIGNAL_STATE   (PORT_DTRDSR_ON | PORT_CTSRTS_ON | PORT_DCD_ON)
#define PORT_PPP_DEFAULT_SIGNAL_STATE   (PORT_DTRDSR_ON | PORT_CTSRTS_ON | PORT_DCD_ON)
#define PORT_DUN_DEFAULT_SIGNAL_STATE   (PORT_DTRDSR_ON | PORT_CTSRTS_ON)

RFC_API extern int PORT_GetModemStatus (UINT16 handle, UINT8 *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  flags;
    UINT16  in_queue_size;          /* Number of bytes in the input queue */
    UINT16  out_queue_size;         /* Number of bytes in the output queue */
    UINT16  mtu_size;               /* peer MTU size */
} tPORT_STATUS;


RFC_API extern int PORT_ClearError (UINT16 handle, UINT16 *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
**
*******************************************************************************/
RFC_API extern int PORT_SendError (UINT16 handle, UINT8 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
**
*******************************************************************************/
RFC_API extern int PORT_GetQueueStatus (UINT16 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

RFC_API extern int PORT_Purge (UINT16 handle, UINT8 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,
**
*******************************************************************************/
RFC_API extern int PORT_Read (UINT16 handle, BT_HDR **pp_buf);


/*******************************************************************************
**
** Function         PORT_ReadData
**
** Description      Normally application will call this function after receiving
**                  PORT_EVT_RXCHAR event.
**
** Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
**                                callback.
**                  p_data      - Data area
**                  max_len     - Byte count requested
**                  p_len       - Byte count received
**
*******************************************************************************/
RFC_API extern int PORT_ReadData (UINT16 handle, char *p_data, UINT16 max_len,
                                  UINT16 *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,
**
*******************************************************************************/
RFC_API extern int PORT_Write (UINT16 handle, BT_HDR *p_buf);


/*******************************************************************************
**
** Function         PORT_WriteData
**
** Description      This function is called from the legacy application to
**                  send data.
**
** Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
**                  p_data      - Data area
**                  max_len     - Byte count to write
**                  p_len       - Bytes written
**
*******************************************************************************/
RFC_API extern int PORT_WriteData (UINT16 handle, char *p_data, UINT16 max_len,
                                   UINT16 *p_len);

/*******************************************************************************
**
** Function         PORT_WriteDataCO
**
** Description      Normally not GKI aware application will call this function
**                  to send data to the port by callout functions.
**
** Parameters:      handle     - Handle returned in the RFCOMM_CreateConnection
**
*******************************************************************************/
RFC_API extern int PORT_WriteDataCO (UINT16 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
**
*******************************************************************************/
RFC_API extern int PORT_Test (UINT16 handle, UINT8 *p_data, UINT16 len);


/*******************************************************************************
**
** Function         RFCOMM_Init
**
** Description      This function is called to initialize RFCOMM layer
**
*******************************************************************************/
RFC_API extern void RFCOMM_Init (void);


/*******************************************************************************
**
** Function         PORT_SetTraceLevel
**
** Description      This function sets the trace level for RFCOMM. If called with
**                  a value of 0xFF, it simply reads the current trace level.
**
** Returns          the new (current) trace level
**
*******************************************************************************/
RFC_API extern UINT8 PORT_SetTraceLevel (UINT8 new_level);


#ifdef __cplusplus
}
#endif

#endif  /* PORT_API_H */