Home | History | Annotate | Download | only in include
      1 /******************************************************************************
      2  *
      3  *  Copyright (C) 2010-2014 Broadcom Corporation
      4  *
      5  *  Licensed under the Apache License, Version 2.0 (the "License");
      6  *  you may not use this file except in compliance with the License.
      7  *  You may obtain a copy of the License at:
      8  *
      9  *  http://www.apache.org/licenses/LICENSE-2.0
     10  *
     11  *  Unless required by applicable law or agreed to in writing, software
     12  *  distributed under the License is distributed on an "AS IS" BASIS,
     13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     14  *  See the License for the specific language governing permissions and
     15  *  limitations under the License.
     16  *
     17  ******************************************************************************/
     18 
     19 
     20 /******************************************************************************
     21  *
     22  *  This file contains the LLCP API definitions
     23  *
     24  ******************************************************************************/
     25 #ifndef LLCP_API_H
     26 #define LLCP_API_H
     27 
     28 #include "nfc_target.h"
     29 #include "llcp_defs.h"
     30 
     31 /*****************************************************************************
     32 **  Constants
     33 *****************************************************************************/
     34 #define LLCP_STATUS_SUCCESS         0       /* Successfully done                */
     35 #define LLCP_STATUS_FAIL            1       /* Failed without specific reason   */
     36 #define LLCP_STATUS_CONGESTED       2       /* Data link is congested           */
     37 
     38 typedef UINT8 tLLCP_STATUS;
     39 
     40 #define LLCP_MIN_OFFSET             (NCI_MSG_OFFSET_SIZE + NCI_DATA_HDR_SIZE + LLCP_PDU_HEADER_SIZE + LLCP_SEQUENCE_SIZE)
     41 
     42 #define LLCP_INVALID_SAP            0xFF    /* indication of failure to allocate data link resource */
     43 
     44 /*****************************************************************************
     45 **  Type Definitions
     46 *****************************************************************************/
     47 typedef struct
     48 {
     49     BOOLEAN is_initiator;       /* TRUE if we are POLL mode */
     50     UINT8   max_payload_size;   /* 64, 128, 192 or 254 */
     51     UINT8   waiting_time;
     52     UINT8  *p_gen_bytes;
     53     UINT8   gen_bytes_len;
     54 } tLLCP_ACTIVATE_CONFIG;
     55 
     56 typedef struct
     57 {
     58     UINT16  miu;                        /* Local receiving MIU      */
     59     UINT8   rw;                         /* Local receiving window   */
     60     char    sn[LLCP_MAX_SN_LEN + 1];    /* Service name to connect  */
     61 } tLLCP_CONNECTION_PARAMS;
     62 
     63 /*********************************
     64 **  Callback Functions Prototypes
     65 **********************************/
     66 
     67 /* Link Management Callback Events */
     68 
     69 #define LLCP_LINK_ACTIVATION_FAILED_EVT     0x00    /* Fail to activate link    */
     70 #define LLCP_LINK_ACTIVATION_COMPLETE_EVT   0x01    /* LLCP Link is activated   */
     71 #define LLCP_LINK_DEACTIVATED_EVT           0x02    /* LLCP Link is deactivated */
     72 #define LLCP_LINK_FIRST_PACKET_RECEIVED_EVT 0x03    /* First LLCP packet received from remote */
     73 
     74 /* Link Management Callback Reasons */
     75 
     76 #define LLCP_LINK_SUCCESS                   0x00    /* Success                                  */
     77 #define LLCP_LINK_VERSION_FAILED            0x01    /* Failed to agree version                  */
     78 #define LLCP_LINK_BAD_GEN_BYTES             0x02    /* Failed to parse received general bytes   */
     79 #define LLCP_LINK_INTERNAL_ERROR            0x03    /* internal error                           */
     80 #define LLCP_LINK_LOCAL_INITIATED           0x04    /* Link has been deactivated by local       */
     81 #define LLCP_LINK_REMOTE_INITIATED          0x05    /* Link has been deactivated by remote      */
     82 #define LLCP_LINK_TIMEOUT                   0x06    /* Link has been deactivated by timeout     */
     83 #define LLCP_LINK_FRAME_ERROR               0x07    /* Link has been deactivated by frame error */
     84 #define LLCP_LINK_RF_LINK_LOSS_NO_RX_LLC    0x08    /* RF link loss without any rx LLC PDU      */
     85 #define LLCP_LINK_RF_TRANSMISSION_ERR       NFC_STATUS_RF_TRANSMISSION_ERR
     86 #define LLCP_LINK_RF_PROTOCOL_ERR           NFC_STATUS_RF_PROTOCOL_ERR
     87 #define LLCP_LINK_RF_TIMEOUT                NFC_STATUS_TIMEOUT
     88 #define LLCP_LINK_RF_LINK_LOSS_ERR          NFC_STATUS_LINK_LOSS
     89 
     90 typedef void (tLLCP_LINK_CBACK) (UINT8 event, UINT8 reason);
     91 
     92 /* Minimum length of Gen Bytes for LLCP */
     93 /* In CE4 low power mode, NFCC can store up to 21 bytes */
     94 #define LLCP_MIN_GEN_BYTES                  20
     95 
     96 /* Service Access Point (SAP) Callback Events */
     97 
     98 #define LLCP_SAP_EVT_DATA_IND               0x00    /* Received data on SAP         */
     99 #define LLCP_SAP_EVT_CONNECT_IND            0x01    /* Connection request from peer */
    100 #define LLCP_SAP_EVT_CONNECT_RESP           0x02    /* Connection accepted by peer  */
    101 #define LLCP_SAP_EVT_DISCONNECT_IND         0x03    /* Received disconnect request  */
    102 #define LLCP_SAP_EVT_DISCONNECT_RESP        0x04    /* Received disconnect response */
    103 #define LLCP_SAP_EVT_CONGEST                0x05    /* congested status is changed  */
    104 #define LLCP_SAP_EVT_LINK_STATUS            0x06    /* Change of LLCP Link status   */
    105 #define LLCP_SAP_EVT_TX_COMPLETE            0x07    /* tx queue is empty and all PDU is acked   */
    106 
    107 #define LLCP_LINK_TYPE_LOGICAL_DATA_LINK      0x01
    108 #define LLCP_LINK_TYPE_DATA_LINK_CONNECTION   0x02
    109 
    110 typedef struct
    111 {
    112     UINT8   event;              /* LLCP_SAP_EVT_DATA_IND        */
    113     UINT8   local_sap;          /* SAP of local device          */
    114     UINT8   remote_sap;         /* SAP of remote device         */
    115     UINT8   link_type;          /* link type                    */
    116 } tLLCP_SAP_DATA_IND;
    117 
    118 typedef struct
    119 {
    120     UINT8   event;              /* LLCP_SAP_EVT_CONNECT_IND     */
    121     UINT8   server_sap;         /* SAP of local server          */
    122     UINT8   local_sap;          /* SAP of local device          */
    123     UINT8   remote_sap;         /* SAP of remote device         */
    124     UINT16  miu;                /* MIU of peer device           */
    125     UINT8   rw;                 /* RW of peer device            */
    126     char   *p_service_name;     /* Service name (only for SDP)  */
    127 } tLLCP_SAP_CONNECT_IND;
    128 
    129 typedef struct
    130 {
    131     UINT8   event;              /* LLCP_SAP_EVT_CONNECT_RESP    */
    132     UINT8   local_sap;          /* SAP of local device          */
    133     UINT8   remote_sap;         /* SAP of remote device         */
    134     UINT16  miu;                /* MIU of peer device           */
    135     UINT8   rw;                 /* RW of peer device            */
    136 } tLLCP_SAP_CONNECT_RESP;
    137 
    138 #define LLCP_SAP_DISCONNECT_REASON_TIMEOUT  0x80
    139 typedef struct
    140 {
    141     UINT8   event;              /* LLCP_SAP_EVT_DISCONNECT_IND  */
    142     UINT8   local_sap;          /* SAP of local device          */
    143     UINT8   remote_sap;         /* SAP of remote device         */
    144 } tLLCP_SAP_DISCONNECT_IND;
    145 
    146 typedef struct
    147 {
    148     UINT8   event;              /* LLCP_SAP_EVT_DISCONNECT_RESP */
    149     UINT8   local_sap;          /* SAP of local device          */
    150     UINT8   remote_sap;         /* SAP of remote device         */
    151     UINT8   reason;             /* Reason of DM PDU if not timeout */
    152 } tLLCP_SAP_DISCONNECT_RESP;
    153 
    154 typedef struct
    155 {
    156     UINT8   event;              /* LLCP_SAP_EVT_CONGEST         */
    157     UINT8   local_sap;          /* SAP of local device          */
    158     UINT8   remote_sap;         /* SAP of remote device         */
    159     BOOLEAN is_congested;       /* TRUE if congested            */
    160     UINT8   link_type;          /* congested link type          */
    161 } tLLCP_SAP_CONGEST;
    162 
    163 typedef struct
    164 {
    165     UINT8   event;              /* LLCP_SAP_EVT_LINK_STATUS     */
    166     UINT8   local_sap;          /* SAP of local device          */
    167     BOOLEAN is_activated;       /* TRUE if LLCP link is activated  */
    168     BOOLEAN is_initiator;       /* TRUE if local LLCP is initiator */
    169 } tLLCP_SAP_LINK_STATUS;
    170 
    171 typedef struct
    172 {
    173     UINT8   event;              /* LLCP_SAP_EVT_TX_COMPLETE     */
    174     UINT8   local_sap;          /* SAP of local device          */
    175     UINT8   remote_sap;         /* SAP of remote device         */
    176 } tLLCP_SAP_TX_COMPLETE;
    177 
    178 typedef struct
    179 {
    180     UINT8   event;              /* event                        */
    181     UINT8   local_sap;          /* SAP of local device          */
    182 } tLLCP_SAP_HEADER;
    183 
    184 typedef union
    185 {
    186     tLLCP_SAP_HEADER            hdr;                /* common header                */
    187     tLLCP_SAP_DATA_IND          data_ind;           /* LLCP_SAP_EVT_DATA_IND        */
    188     tLLCP_SAP_CONNECT_IND       connect_ind;        /* LLCP_SAP_EVT_CONNECT_IND     */
    189     tLLCP_SAP_CONNECT_RESP      connect_resp;       /* LLCP_SAP_EVT_CONNECT_RESP    */
    190     tLLCP_SAP_DISCONNECT_IND    disconnect_ind;     /* LLCP_SAP_EVT_DISCONNECT_IND  */
    191     tLLCP_SAP_DISCONNECT_RESP   disconnect_resp;    /* LLCP_SAP_EVT_DISCONNECT_RESP */
    192     tLLCP_SAP_CONGEST           congest;            /* LLCP_SAP_EVT_CONGEST         */
    193     tLLCP_SAP_LINK_STATUS       link_status;        /* LLCP_SAP_EVT_LINK_STATUS     */
    194     tLLCP_SAP_TX_COMPLETE       tx_complete;        /* LLCP_SAP_EVT_TX_COMPLETE     */
    195 } tLLCP_SAP_CBACK_DATA;
    196 
    197 typedef void (tLLCP_APP_CBACK) (tLLCP_SAP_CBACK_DATA *p_data);
    198 
    199 /* Service Discovery Callback */
    200 
    201 typedef void (tLLCP_SDP_CBACK) (UINT8 tid, UINT8 remote_sap);
    202 
    203 /* LLCP DTA Callback - notify DTA responded SNL for connectionless echo service */
    204 
    205 typedef void (tLLCP_DTA_CBACK) (void);
    206 
    207 /*****************************************************************************
    208 **  External Function Declarations
    209 *****************************************************************************/
    210 #ifdef __cplusplus
    211 extern "C"
    212 {
    213 #endif
    214 
    215 /*******************************************************************************
    216 **
    217 ** Function         LLCP_SetConfig
    218 **
    219 ** Description      Set configuration parameters for LLCP
    220 **                  - Local Link MIU
    221 **                  - Option parameter
    222 **                  - Waiting Time Index
    223 **                  - Local Link Timeout
    224 **                  - Inactivity Timeout as initiator role
    225 **                  - Inactivity Timeout as target role
    226 **                  - Delay SYMM response
    227 **                  - Data link connection timeout
    228 **                  - Delay timeout to send first PDU as initiator
    229 **
    230 ** Returns          void
    231 **
    232 *******************************************************************************/
    233 LLCP_API extern void LLCP_SetConfig (UINT16 link_miu,
    234                                      UINT8  opt,
    235                                      UINT8  wt,
    236                                      UINT16 link_timeout,
    237                                      UINT16 inact_timeout_init,
    238                                      UINT16 inact_timeout_target,
    239                                      UINT16 symm_delay,
    240                                      UINT16 data_link_timeout,
    241                                      UINT16 delay_first_pdu_timeout);
    242 
    243 /*******************************************************************************
    244 **
    245 ** Function         LLCP_GetConfig
    246 **
    247 ** Description      Get configuration parameters for LLCP
    248 **                  - Local Link MIU
    249 **                  - Option parameter
    250 **                  - Response Waiting Time Index
    251 **                  - Local Link Timeout
    252 **                  - Inactivity Timeout as initiator role
    253 **                  - Inactivity Timeout as target role
    254 **                  - Delay SYMM response
    255 **                  - Data link connection timeout
    256 **                  - Delay timeout to send first PDU as initiator
    257 **
    258 ** Returns          void
    259 **
    260 *******************************************************************************/
    261 LLCP_API extern void LLCP_GetConfig (UINT16 *p_link_miu,
    262                                      UINT8  *p_opt,
    263                                      UINT8  *p_wt,
    264                                      UINT16 *p_link_timeout,
    265                                      UINT16 *p_inact_timeout_init,
    266                                      UINT16 *p_inact_timeout_target,
    267                                      UINT16 *p_symm_delay,
    268                                      UINT16 *p_data_link_timeout,
    269                                      UINT16 *p_delay_first_pdu_timeout);
    270 
    271 /*******************************************************************************
    272 **
    273 ** Function         LLCP_GetDiscoveryConfig
    274 **
    275 ** Description      Returns discovery config for LLCP MAC link activation
    276 **                  This function is called to get general bytes for NFC_PMID_ATR_REQ_GEN_BYTES
    277 **                  or NFC_PMID_ATR_RES_GEN_BYTES before starting discovery.
    278 **
    279 **                  wt:Waiting time 0 - 8, only for listen
    280 **                  p_gen_bytes: pointer to store LLCP magic number and paramters
    281 **                  p_gen_bytes_len: length of buffer for gen bytes as input
    282 **                                   (NOTE:it must be bigger than LLCP_MIN_GEN_BYTES)
    283 **                                   actual gen bytes size as output
    284 **
    285 **                  Restrictions on the use of ISO 18092
    286 **                  1. The DID features shall not be used.
    287 **                  2. the NAD features shall not be used.
    288 **                  3. Frame waiting time extentions (WTX) shall not be used.
    289 **
    290 ** Returns          None
    291 **
    292 *******************************************************************************/
    293 LLCP_API extern void LLCP_GetDiscoveryConfig (UINT8 *p_wt,
    294                                               UINT8 *p_gen_bytes,
    295                                               UINT8 *p_gen_bytes_len);
    296 
    297 /*******************************************************************************
    298 **
    299 ** Function         LLCP_ActivateLink
    300 **
    301 ** Description      This function will activate LLCP link with LR, WT and Gen Bytes
    302 **                  in activation NTF from NFCC.
    303 **
    304 **                  LLCP_LINK_ACTIVATION_COMPLETE_EVT will be returned through
    305 **                  callback function if successful.
    306 **                  Otherwise, LLCP_LINK_ACTIVATION_FAILED_EVT will be returned.
    307 **
    308 ** Returns          LLCP_STATUS_SUCCESS if success
    309 **
    310 *******************************************************************************/
    311 LLCP_API extern tLLCP_STATUS LLCP_ActivateLink (tLLCP_ACTIVATE_CONFIG config,
    312                                                 tLLCP_LINK_CBACK     *p_link_cback);
    313 
    314 /*******************************************************************************
    315 **
    316 ** Function         LLCP_DeactivateLink
    317 **
    318 ** Description      Deactivate LLCP link
    319 **
    320 **                  LLCP_LINK_DEACTIVATED_EVT will be returned through callback
    321 **                  when LLCP link is deactivated. Then NFC link may be deactivated.
    322 **
    323 ** Returns          LLCP_STATUS_SUCCESS if success
    324 **
    325 *******************************************************************************/
    326 LLCP_API extern tLLCP_STATUS LLCP_DeactivateLink (void);
    327 
    328 /*******************************************************************************
    329 **
    330 ** Function         LLCP_RegisterServer
    331 **
    332 ** Description      Register server and callback function
    333 **
    334 **                  reg_sap : Well-Known SAP except LM and SDP (0x02 - 0x0F)
    335 **                            Advertized by SDP (0x10 - 0x1F)
    336 **                            LLCP_INVALID_SAP, LLCP will allocate between 0x10 and 0x1F
    337 **                  link_type : LLCP_LINK_TYPE_LOGICAL_DATA_LINK
    338 **                              and/or LLCP_LINK_TYPE_DATA_LINK_CONNECTION
    339 **                  p_service_name : Null-terminated string up to LLCP_MAX_SN_LEN
    340 **
    341 ** Returns          SAP between 0x02 and 0x1F, if success
    342 **                  LLCP_INVALID_SAP, otherwise
    343 **
    344 *******************************************************************************/
    345 LLCP_API extern UINT8 LLCP_RegisterServer (UINT8           reg_sap,
    346                                            UINT8           link_type,
    347                                            char            *p_service_name,
    348                                            tLLCP_APP_CBACK *p_sap_cback);
    349 
    350 /*******************************************************************************
    351 **
    352 ** Function         LLCP_RegisterClient
    353 **
    354 ** Description      Register client and callback function
    355 **
    356 **                  link_type : LLCP_LINK_TYPE_LOGICAL_DATA_LINK
    357 **                              and/or LLCP_LINK_TYPE_DATA_LINK_CONNECTION
    358 **
    359 ** Returns          SAP between 0x20 and 0x3F, if success
    360 **                  LLCP_INVALID_SAP, otherwise
    361 **
    362 *******************************************************************************/
    363 LLCP_API extern UINT8 LLCP_RegisterClient (UINT8           link_type,
    364                                            tLLCP_APP_CBACK *p_sap_cback);
    365 
    366 /*******************************************************************************
    367 **
    368 ** Function         LLCP_Deregister
    369 **
    370 ** Description      Deregister server or client
    371 **
    372 **
    373 ** Returns          LLCP_STATUS_SUCCESS if success
    374 **
    375 *******************************************************************************/
    376 LLCP_API extern tLLCP_STATUS LLCP_Deregister (UINT8 sap);
    377 
    378 /*******************************************************************************
    379 **
    380 ** Function         LLCP_IsLogicalLinkCongested
    381 **
    382 ** Description      Check if logical link is congested
    383 **
    384 **
    385 ** Returns          TRUE if congested
    386 **
    387 *******************************************************************************/
    388 LLCP_API extern BOOLEAN LLCP_IsLogicalLinkCongested (UINT8 local_sap,
    389                                                      UINT8 num_pending_ui_pdu,
    390                                                      UINT8 total_pending_ui_pdu,
    391                                                      UINT8 total_pending_i_pdu);
    392 
    393 /*******************************************************************************
    394 **
    395 ** Function         LLCP_SendUI
    396 **
    397 ** Description      Send connnectionless data to DSAP
    398 **
    399 **
    400 ** Returns          LLCP_STATUS_SUCCESS if success
    401 **                  LLCP_STATUS_CONGESTED if logical link is congested
    402 **                  LLCP_STATUS_FAIL, otherwise
    403 **
    404 *******************************************************************************/
    405 LLCP_API extern tLLCP_STATUS LLCP_SendUI (UINT8 ssap, UINT8 dsap, BT_HDR *p_buf);
    406 
    407 /*******************************************************************************
    408 **
    409 ** Function         LLCP_ReadLogicalLinkData
    410 **
    411 ** Description      Read information of UI PDU for local SAP
    412 **
    413 **                  - Remote SAP who sent UI PDU is returned.
    414 **                  - Information of UI PDU up to max_data_len is copied into p_data.
    415 **                  - Information of next UI PDU is not concatenated.
    416 **                  - Recommended max_data_len is link MIU of local device
    417 **
    418 ** Returns          TRUE if more information of UI PDU or more UI PDU in queue
    419 **
    420 *******************************************************************************/
    421 LLCP_API extern BOOLEAN LLCP_ReadLogicalLinkData (UINT8  local_sap,
    422                                                   UINT32 max_data_len,
    423                                                   UINT8  *p_remote_sap,
    424                                                   UINT32 *p_data_len,
    425                                                   UINT8  *p_data);
    426 
    427 /*******************************************************************************
    428 **
    429 ** Function         LLCP_FlushLogicalLinkRxData
    430 **
    431 ** Description      Discard received data in logical data link of local SAP
    432 **
    433 **
    434 ** Returns          length of data flushed
    435 **
    436 *******************************************************************************/
    437 LLCP_API extern UINT32 LLCP_FlushLogicalLinkRxData (UINT8 local_sap);
    438 
    439 /*******************************************************************************
    440 **
    441 ** Function         LLCP_ConnectReq
    442 **
    443 ** Description      Create data link connection between registered SAP and DSAP
    444 **                  in peer LLCP,
    445 **
    446 **
    447 ** Returns          LLCP_STATUS_SUCCESS if success
    448 **                  LLCP_STATUS_FAIL, otherwise
    449 **
    450 *******************************************************************************/
    451 LLCP_API extern tLLCP_STATUS LLCP_ConnectReq (UINT8 reg_sap, UINT8 dsap,
    452                                               tLLCP_CONNECTION_PARAMS *p_params);
    453 
    454 /*******************************************************************************
    455 **
    456 ** Function         LLCP_ConnectCfm
    457 **
    458 ** Description      Accept connection request from peer LLCP
    459 **
    460 **
    461 ** Returns          LLCP_STATUS_SUCCESS if success
    462 **                  LLCP_STATUS_FAIL, otherwise
    463 **
    464 *******************************************************************************/
    465 LLCP_API extern tLLCP_STATUS LLCP_ConnectCfm (UINT8 local_sap,
    466                                               UINT8 remote_sap,
    467                                               tLLCP_CONNECTION_PARAMS *p_params);
    468 
    469 /*******************************************************************************
    470 **
    471 ** Function         LLCP_ConnectReject
    472 **
    473 ** Description      Reject connection request from peer LLCP
    474 **
    475 **                  reason : LLCP_SAP_DM_REASON_APP_REJECTED
    476 **                           LLCP_SAP_DM_REASON_PERM_REJECT_THIS
    477 **                           LLCP_SAP_DM_REASON_PERM_REJECT_ANY
    478 **                           LLCP_SAP_DM_REASON_TEMP_REJECT_THIS
    479 **                           LLCP_SAP_DM_REASON_TEMP_REJECT_ANY
    480 **
    481 ** Returns          LLCP_STATUS_SUCCESS if success
    482 **                  LLCP_STATUS_FAIL, otherwise
    483 **
    484 *******************************************************************************/
    485 LLCP_API extern tLLCP_STATUS LLCP_ConnectReject (UINT8 local_sap,
    486                                                  UINT8 remote_sap,
    487                                                  UINT8 reason);
    488 
    489 /*******************************************************************************
    490 **
    491 ** Function         LLCP_IsDataLinkCongested
    492 **
    493 ** Description      Check if data link is congested
    494 **
    495 **
    496 ** Returns          TRUE if congested
    497 **
    498 *******************************************************************************/
    499 LLCP_API extern BOOLEAN LLCP_IsDataLinkCongested (UINT8 local_sap,
    500                                                   UINT8 remote_sap,
    501                                                   UINT8 num_pending_i_pdu,
    502                                                   UINT8 total_pending_ui_pdu,
    503                                                   UINT8 total_pending_i_pdu);
    504 
    505 /*******************************************************************************
    506 **
    507 ** Function         LLCP_SendData
    508 **
    509 ** Description      Send connection-oriented data
    510 **
    511 **
    512 ** Returns          LLCP_STATUS_SUCCESS if success
    513 **                  LLCP_STATUS_CONGESTED if data link is congested
    514 **
    515 *******************************************************************************/
    516 LLCP_API extern tLLCP_STATUS LLCP_SendData (UINT8  local_sap,
    517                                             UINT8  remote_sap,
    518                                             BT_HDR *p_buf);
    519 
    520 /*******************************************************************************
    521 **
    522 ** Function         LLCP_ReadDataLinkData
    523 **
    524 ** Description      Read information of I PDU for data link connection
    525 **
    526 **                  - Information of I PDU up to max_data_len is copied into p_data.
    527 **                  - Information of next I PDU is not concatenated.
    528 **                  - Recommended max_data_len is data link connection MIU of local
    529 **                    end point
    530 **
    531 ** Returns          TRUE if more data in queue
    532 **
    533 *******************************************************************************/
    534 LLCP_API extern BOOLEAN LLCP_ReadDataLinkData (UINT8  local_sap,
    535                                                UINT8  remote_sap,
    536                                                UINT32 max_data_len,
    537                                                UINT32 *p_data_len,
    538                                                UINT8  *p_data);
    539 
    540 /*******************************************************************************
    541 **
    542 ** Function         LLCP_FlushDataLinkRxData
    543 **
    544 ** Description      Discard received data in data link connection
    545 **
    546 **
    547 ** Returns          length of rx data flushed
    548 **
    549 *******************************************************************************/
    550 LLCP_API extern UINT32 LLCP_FlushDataLinkRxData (UINT8  local_sap,
    551                                                  UINT8  remote_sap);
    552 
    553 /*******************************************************************************
    554 **
    555 ** Function         LLCP_DisconnectReq
    556 **
    557 ** Description      Disconnect data link
    558 **                  discard any pending data if flush is set to TRUE
    559 **
    560 ** Returns          LLCP_STATUS_SUCCESS if success
    561 **
    562 *******************************************************************************/
    563 LLCP_API extern tLLCP_STATUS LLCP_DisconnectReq (UINT8   local_sap,
    564                                                  UINT8   remote_sap,
    565                                                  BOOLEAN flush);
    566 
    567 /*******************************************************************************
    568 **
    569 ** Function         LLCP_SetTxCompleteNtf
    570 **
    571 ** Description      This function is called to get LLCP_SAP_EVT_TX_COMPLETE
    572 **                  when Tx queue is empty and all PDU is acked.
    573 **                  This is one time event, so upper layer shall call this function
    574 **                  again to get next LLCP_SAP_EVT_TX_COMPLETE.
    575 **
    576 ** Returns          LLCP_STATUS_SUCCESS if success
    577 **
    578 *******************************************************************************/
    579 LLCP_API extern tLLCP_STATUS LLCP_SetTxCompleteNtf (UINT8 local_sap,
    580                                                     UINT8 remote_sap);
    581 
    582 /*******************************************************************************
    583 **
    584 ** Function         LLCP_SetLocalBusyStatus
    585 **
    586 ** Description      Set local busy status
    587 **
    588 **
    589 ** Returns          LLCP_STATUS_SUCCESS if success
    590 **
    591 *******************************************************************************/
    592 LLCP_API extern tLLCP_STATUS LLCP_SetLocalBusyStatus (UINT8   local_sap,
    593                                                       UINT8   remote_sap,
    594                                                       BOOLEAN is_busy);
    595 
    596 /*******************************************************************************
    597 **
    598 ** Function         LLCP_GetRemoteWKS
    599 **
    600 ** Description      Return well-known service bitmap of connected device
    601 **
    602 **
    603 ** Returns          WKS bitmap if success
    604 **
    605 *******************************************************************************/
    606 LLCP_API extern UINT16 LLCP_GetRemoteWKS (void);
    607 
    608 /*******************************************************************************
    609 **
    610 ** Function         LLCP_GetRemoteLSC
    611 **
    612 ** Description      Return link service class of connected device
    613 **
    614 **
    615 ** Returns          link service class
    616 **
    617 *******************************************************************************/
    618 LLCP_API extern UINT8 LLCP_GetRemoteLSC (void);
    619 
    620 /*******************************************************************************
    621 **
    622 ** Function         LLCP_GetLinkMIU
    623 **
    624 ** Description      Return local and remote link MIU
    625 **
    626 **
    627 ** Returns          None
    628 **
    629 *******************************************************************************/
    630 LLCP_API extern void LLCP_GetLinkMIU (UINT16 *p_local_link_miu, UINT16 *p_remote_link_miu);
    631 
    632 /*******************************************************************************
    633 **
    634 ** Function         LLCP_DiscoverService
    635 **
    636 ** Description      Return SAP of service name in connected device through callback
    637 **
    638 **
    639 ** Returns          LLCP_STATUS_SUCCESS if success
    640 **
    641 *******************************************************************************/
    642 LLCP_API extern tLLCP_STATUS LLCP_DiscoverService (char            *p_name,
    643                                                    tLLCP_SDP_CBACK *p_cback,
    644                                                    UINT8           *p_tid);
    645 
    646 /*******************************************************************************
    647 **
    648 ** Function         LLCP_SetTraceLevel
    649 **
    650 ** Description      This function sets the trace level for LLCP.  If called with
    651 **                  a value of 0xFF, it simply returns the current trace level.
    652 **
    653 ** Returns          The new or current trace level
    654 **
    655 *******************************************************************************/
    656 LLCP_API extern UINT8 LLCP_SetTraceLevel (UINT8 new_level);
    657 
    658 #if (LLCP_TEST_INCLUDED == TRUE)
    659 /*******************************************************************************
    660 **
    661 ** Function         LLCP_SetTestParams
    662 **
    663 ** Description      Set test parameters for LLCP
    664 **
    665 **
    666 ** Returns          void
    667 **
    668 *******************************************************************************/
    669 LLCP_API extern void LLCP_SetTestParams (UINT8 version, UINT16 wks);
    670 #endif
    671 
    672 #ifdef __cplusplus
    673 }
    674 #endif
    675 
    676 #endif  /* LLCP_API_H */
    677 
    678