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