blob: bcfc234fe91a92647accb022bd13aa5b90f859f6 [file] [log] [blame]
nxpandroidc7611652015-09-23 16:42:05 +05301/******************************************************************************
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
nxpandroidc7611652015-09-23 16:42:05 +053019/******************************************************************************
20 *
21 * This is the public interface file for NFA P2P, Broadcom's NFC
22 * application layer for mobile phones.
23 *
24 ******************************************************************************/
25#ifndef NFA_P2P_API_H
26#define NFA_P2P_API_H
27
28#include "llcp_api.h"
29#include "nfa_api.h"
30
31/*****************************************************************************
32** Constants and data types
33*****************************************************************************/
34
35/* NFA P2P Reason of disconnection */
nxpandroid8f6d0532017-07-12 18:25:30 +053036#define NFA_P2P_DISC_REASON_REMOTE_INITIATE \
37 0x00 /* remote initiated to disconnect */
38#define NFA_P2P_DISC_REASON_LOCAL_INITITATE \
39 0x01 /* local initiated to disconnect */
40#define NFA_P2P_DISC_REASON_NO_SERVICE \
41 0x02 /* no service bound in remote */
42#define NFA_P2P_DISC_REASON_REMOTE_REJECT \
43 0x03 /* remote rejected connection */
nxpandroid8f6d0532017-07-12 18:25:30 +053044#define NFA_P2P_DISC_REASON_LLCP_DEACTIVATED \
45 0x05 /* LLCP link deactivated */
nxpandroid8f6d0532017-07-12 18:25:30 +053046#define NFA_P2P_DISC_REASON_NO_INFORMATION \
47 0x80 /* Without information */
nxpandroidc7611652015-09-23 16:42:05 +053048
49/* NFA P2P callback events */
nxpandroid8f6d0532017-07-12 18:25:30 +053050/* Server is registered */
51#define NFA_P2P_REG_SERVER_EVT 0x00
52/* Client is registered */
53#define NFA_P2P_REG_CLIENT_EVT 0x01
54/* LLCP Link has been activated */
55#define NFA_P2P_ACTIVATED_EVT 0x02
56#define NFA_P2P_DEACTIVATED_EVT \
57 0x03 /* LLCP Link has been deactivated */
58/* Data link connection request from peer */
59#define NFA_P2P_CONN_REQ_EVT 0x04
60/* Data link connection has been established */
61#define NFA_P2P_CONNECTED_EVT 0x05
62/* Data link connection has been disconnected */
63#define NFA_P2P_DISC_EVT 0x06
64/* Data received from peer */
65#define NFA_P2P_DATA_EVT 0x07
66/* Status indication of outgoing data */
67#define NFA_P2P_CONGEST_EVT 0x08
68/* link MIU and Well-Known Service list */
69#define NFA_P2P_LINK_INFO_EVT 0x09
nxf24591c1cbeab2018-02-21 17:32:26 +053070#define NFA_P2P_SDP_EVT 0x0A /* Remote SAP of SDP result */
nxpandroidc7611652015-09-23 16:42:05 +053071
nxpandroid8f6d0532017-07-12 18:25:30 +053072typedef uint8_t tNFA_P2P_EVT;
nxpandroidc7611652015-09-23 16:42:05 +053073
74/* NFA allocates a SAP for server */
nxpandroid8f6d0532017-07-12 18:25:30 +053075#define NFA_P2P_ANY_SAP LLCP_INVALID_SAP
76#define NFA_P2P_INVALID_SAP LLCP_INVALID_SAP
nxpandroidc7611652015-09-23 16:42:05 +053077
nxpandroid8f6d0532017-07-12 18:25:30 +053078#define NFA_P2P_LLINK_TYPE LLCP_LINK_TYPE_LOGICAL_DATA_LINK
79#define NFA_P2P_DLINK_TYPE LLCP_LINK_TYPE_DATA_LINK_CONNECTION
80typedef uint8_t tNFA_P2P_LINK_TYPE;
nxpandroidc7611652015-09-23 16:42:05 +053081
82/* Data for NFA_P2P_REG_SERVER_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +053083typedef struct {
84 tNFA_HANDLE server_handle; /* NFA_HANDLE_INVALID if failed */
85 char service_name[LLCP_MAX_SN_LEN + 1];
86 uint8_t server_sap;
nxpandroidc7611652015-09-23 16:42:05 +053087} tNFA_P2P_REG_SERVER;
88
89/* Data for NFA_P2P_REG_CLIENT_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +053090typedef struct {
91 tNFA_HANDLE client_handle; /* NFA_HANDLE_INVALID if failed */
nxpandroidc7611652015-09-23 16:42:05 +053092} tNFA_P2P_REG_CLIENT;
93
94/* Data for NFA_P2P_ACTIVATED_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +053095typedef struct {
96 tNFA_HANDLE handle;
97 uint16_t local_link_miu;
98 uint16_t remote_link_miu;
nxpandroidc7611652015-09-23 16:42:05 +053099} tNFA_P2P_ACTIVATED;
100
101/* Data for NFA_P2P_DEACTIVATED_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530102typedef struct { tNFA_HANDLE handle; } tNFA_P2P_DEACTIVATED;
nxpandroidc7611652015-09-23 16:42:05 +0530103
104/* Data for NFA_P2P_CONN_REQ_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530105typedef struct {
106 tNFA_HANDLE server_handle;
107 tNFA_HANDLE conn_handle;
108 uint8_t remote_sap;
109 uint16_t remote_miu;
110 uint8_t remote_rw;
nxpandroidc7611652015-09-23 16:42:05 +0530111} tNFA_P2P_CONN_REQ;
112
113/* Data for NFA_P2P_CONNECTED_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530114typedef struct {
115 tNFA_HANDLE client_handle;
116 tNFA_HANDLE conn_handle;
117 uint8_t remote_sap;
118 uint16_t remote_miu;
119 uint8_t remote_rw;
nxpandroidc7611652015-09-23 16:42:05 +0530120} tNFA_P2P_CONN;
121
122/* Data for NFA_P2P_DISC_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530123typedef struct {
124 tNFA_HANDLE handle;
125 uint8_t reason;
nxpandroidc7611652015-09-23 16:42:05 +0530126} tNFA_P2P_DISC;
127
128/* Data for NFA_P2P_DATA_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530129typedef struct {
130 tNFA_HANDLE handle;
131 uint8_t remote_sap;
132 tNFA_P2P_LINK_TYPE link_type;
nxpandroidc7611652015-09-23 16:42:05 +0530133} tNFA_P2P_DATA;
134
135/* Data for NFA_P2P_CONGEST_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530136typedef struct {
137 tNFA_HANDLE handle;
138 bool is_congested;
139 tNFA_P2P_LINK_TYPE link_type;
nxpandroidc7611652015-09-23 16:42:05 +0530140} tNFA_P2P_CONGEST;
141
142/* Data for NFA_P2P_LINK_INFO_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530143typedef struct {
144 tNFA_HANDLE handle;
145 uint16_t wks; /* well-known service */
146 uint16_t local_link_miu;
147 uint16_t remote_link_miu;
nxpandroidc7611652015-09-23 16:42:05 +0530148} tNFA_P2P_LINK_INFO;
149
150/* Data for NFA_P2P_SDP_EVT */
nxpandroid8f6d0532017-07-12 18:25:30 +0530151typedef struct {
152 tNFA_HANDLE handle;
153 uint8_t remote_sap; /* 0x00 if failed */
nxpandroidc7611652015-09-23 16:42:05 +0530154} tNFA_P2P_SDP;
155
156/* Union of all P2P callback structures */
nxpandroid8f6d0532017-07-12 18:25:30 +0530157typedef union {
158 tNFA_P2P_REG_SERVER reg_server; /* NFA_P2P_REG_SERVER_EVT */
159 tNFA_P2P_REG_CLIENT reg_client; /* NFA_P2P_REG_CLIENT_EVT */
160 tNFA_P2P_ACTIVATED activated; /* NFA_P2P_ACTIVATED_EVT */
161 tNFA_P2P_DEACTIVATED deactivated; /* NFA_P2P_DEACTIVATED_EVT */
162 tNFA_P2P_CONN_REQ conn_req; /* NFA_P2P_CONN_REQ_EVT */
163 tNFA_P2P_CONN connected; /* NFA_P2P_CONNECTED_EVT */
164 tNFA_P2P_DISC disc; /* NFA_P2P_DISC_EVT */
165 tNFA_P2P_DATA data; /* NFA_P2P_DATA_EVT */
166 tNFA_P2P_CONGEST congest; /* NFA_P2P_CONGEST_EVT */
167 tNFA_P2P_LINK_INFO link_info; /* NFA_P2P_LINK_INFO_EVT */
168 tNFA_P2P_SDP sdp; /* NFA_P2P_SDP_EVT */
nxpandroidc7611652015-09-23 16:42:05 +0530169} tNFA_P2P_EVT_DATA;
170
171/* NFA P2P callback */
nxpandroid8f6d0532017-07-12 18:25:30 +0530172typedef void(tNFA_P2P_CBACK)(tNFA_P2P_EVT event, tNFA_P2P_EVT_DATA* p_data);
nxpandroidc7611652015-09-23 16:42:05 +0530173
174/*****************************************************************************
175** External Function Declarations
176*****************************************************************************/
nxpandroidc7611652015-09-23 16:42:05 +0530177
178/*******************************************************************************
179**
180** Function NFA_P2pRegisterServer
181**
nxpandroid8f6d0532017-07-12 18:25:30 +0530182** Description This function is called to listen to a SAP as server on
183** LLCP.
nxpandroidc7611652015-09-23 16:42:05 +0530184**
nxpandroid8f6d0532017-07-12 18:25:30 +0530185** NFA_P2P_REG_SERVER_EVT will be returned with status and
186** handle.
nxpandroidc7611652015-09-23 16:42:05 +0530187**
nxpandroid8f6d0532017-07-12 18:25:30 +0530188** If server_sap is set to NFA_P2P_ANY_SAP, then NFA will
189** allocate a SAP between LLCP_LOWER_BOUND_SDP_SAP and
190** LLCP_UPPER_BOUND_SDP_SAP Otherwise, server_sap must be
191** between (LLCP_SDP_SAP + 1) and LLCP_UPPER_BOUND_SDP_SAP
nxpandroidc7611652015-09-23 16:42:05 +0530192**
193** link_type : NFA_P2P_LLINK_TYPE and/or NFA_P2P_DLINK_TYPE
194**
nxpandroid8f6d0532017-07-12 18:25:30 +0530195** Note: If RF discovery is started,
196** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
197** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530198**
199** Returns NFA_STATUS_OK if successfully initiated
200** NFA_STATUS_FAILED otherwise
201**
202*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530203extern tNFA_STATUS NFA_P2pRegisterServer(uint8_t server_sap,
204 tNFA_P2P_LINK_TYPE link_type,
205 char* p_service_name,
206 tNFA_P2P_CBACK* p_cback);
nxpandroidc7611652015-09-23 16:42:05 +0530207
208/*******************************************************************************
209**
210** Function NFA_P2pRegisterClient
211**
nxpandroid8f6d0532017-07-12 18:25:30 +0530212** Description This function is called to register a client service on
213** LLCP.
nxpandroidc7611652015-09-23 16:42:05 +0530214**
nxpandroid8f6d0532017-07-12 18:25:30 +0530215** NFA_P2P_REG_CLIENT_EVT will be returned with status and
216** handle.
nxpandroidc7611652015-09-23 16:42:05 +0530217**
218** link_type : NFA_P2P_LLINK_TYPE and/or NFA_P2P_DLINK_TYPE
219**
220** Returns NFA_STATUS_OK if successfully initiated
221** NFA_STATUS_FAILED otherwise
222**
223*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530224extern tNFA_STATUS NFA_P2pRegisterClient(tNFA_P2P_LINK_TYPE link_type,
225 tNFA_P2P_CBACK* p_cback);
nxpandroidc7611652015-09-23 16:42:05 +0530226
227/*******************************************************************************
228**
229** Function NFA_P2pDeregister
230**
231** Description This function is called to stop listening to a SAP as server
232** or stop client service on LLCP.
233**
nxpandroid8f6d0532017-07-12 18:25:30 +0530234** Note: If this function is called to de-register a server and RF
235** discovery is started,
236** NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT should
237** happen before calling this function
nxpandroidc7611652015-09-23 16:42:05 +0530238**
239** Returns NFA_STATUS_OK if successfully initiated
240** NFA_STATUS_BAD_HANDLE if handle is not valid
241** NFA_STATUS_FAILED otherwise
242**
243*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530244extern tNFA_STATUS NFA_P2pDeregister(tNFA_HANDLE handle);
nxpandroidc7611652015-09-23 16:42:05 +0530245
246/*******************************************************************************
247**
248** Function NFA_P2pAcceptConn
249**
250** Description This function is called to accept a request of data link
251** connection to a listening SAP on LLCP after receiving
252** NFA_P2P_CONN_REQ_EVT.
253**
254** Returns NFA_STATUS_OK if successfully initiated
255** NFA_STATUS_BAD_HANDLE if handle is not valid
256** NFA_STATUS_FAILED otherwise
257**
258*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530259extern tNFA_STATUS NFA_P2pAcceptConn(tNFA_HANDLE conn_handle, uint16_t miu,
260 uint8_t rw);
nxpandroidc7611652015-09-23 16:42:05 +0530261
262/*******************************************************************************
263**
264** Function NFA_P2pRejectConn
265**
266** Description This function is called to reject a request of data link
267** connection to a listening SAP on LLCP after receiving
268** NFA_P2P_CONN_REQ_EVT.
269**
270** Returns NFA_STATUS_OK if successfully initiated
271** NFA_STATUS_BAD_HANDLE if handle is not valid
272** NFA_STATUS_FAILED otherwise
273**
274*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530275extern tNFA_STATUS NFA_P2pRejectConn(tNFA_HANDLE conn_handle);
nxpandroidc7611652015-09-23 16:42:05 +0530276
277/*******************************************************************************
278**
279** Function NFA_P2pDisconnect
280**
281** Description This function is called to disconnect an existing or
282** connecting data link connection.
283**
nxpandroid8f6d0532017-07-12 18:25:30 +0530284** discard any pending data on data link connection if flush is
nxf24591c1cbeab2018-02-21 17:32:26 +0530285** set to TRUE
nxpandroidc7611652015-09-23 16:42:05 +0530286**
nxpandroid8f6d0532017-07-12 18:25:30 +0530287** NFA_P2P_DISC_EVT will be returned after data link connection
288** is disconnected
nxpandroidc7611652015-09-23 16:42:05 +0530289**
290** Returns NFA_STATUS_OK if successfully initiated
291** NFA_STATUS_BAD_HANDLE if handle is not valid
292** NFA_STATUS_FAILED otherwise
293**
294*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530295extern tNFA_STATUS NFA_P2pDisconnect(tNFA_HANDLE conn_handle, bool flush);
nxpandroidc7611652015-09-23 16:42:05 +0530296
297/*******************************************************************************
298**
299** Function NFA_P2pConnectByName
300**
nxpandroid8f6d0532017-07-12 18:25:30 +0530301** Description This function is called to create a connection-oriented
302** transport by a service name.
nxpandroidc7611652015-09-23 16:42:05 +0530303** NFA_P2P_CONNECTED_EVT if success
304** NFA_P2P_DISC_EVT if failed
305**
306** Returns NFA_STATUS_OK if successfully initiated
307** NFA_STATUS_BAD_HANDLE if client is not registered
308** NFA_STATUS_FAILED otherwise
309**
310*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530311extern tNFA_STATUS NFA_P2pConnectByName(tNFA_HANDLE client_handle,
312 char* p_service_name, uint16_t miu,
313 uint8_t rw);
nxpandroidc7611652015-09-23 16:42:05 +0530314
315/*******************************************************************************
316**
317** Function NFA_P2pConnectBySap
318**
nxpandroid8f6d0532017-07-12 18:25:30 +0530319** Description This function is called to create a connection-oriented
320** transport by a SAP.
nxpandroidc7611652015-09-23 16:42:05 +0530321** NFA_P2P_CONNECTED_EVT if success
322** NFA_P2P_DISC_EVT if failed
323**
324** Returns NFA_STATUS_OK if successfully initiated
325** NFA_STATUS_BAD_HANDLE if client is not registered
326** NFA_STATUS_FAILED otherwise
327**
328*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530329extern tNFA_STATUS NFA_P2pConnectBySap(tNFA_HANDLE client_handle, uint8_t dsap,
330 uint16_t miu, uint8_t rw);
nxpandroidc7611652015-09-23 16:42:05 +0530331
332/*******************************************************************************
333**
334** Function NFA_P2pSendUI
335**
336** Description This function is called to send data on connectionless
337** transport.
338**
339** Returns NFA_STATUS_OK if successfully initiated
340** NFA_STATUS_BAD_HANDLE if handle is not valid
nxpandroid8f6d0532017-07-12 18:25:30 +0530341** NFA_STATUS_BAD_LENGTH if data length is more than remote
342** link MIU
nxpandroidc7611652015-09-23 16:42:05 +0530343** NFA_STATUS_CONGESTED if congested
344** NFA_STATUS_FAILED otherwise
345**
346*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530347extern tNFA_STATUS NFA_P2pSendUI(tNFA_HANDLE handle, uint8_t dsap,
348 uint16_t length, uint8_t* p_data);
nxpandroidc7611652015-09-23 16:42:05 +0530349
350/*******************************************************************************
351**
352** Function NFA_P2pReadUI
353**
354** Description This function is called to read data on connectionless
nxpandroid8f6d0532017-07-12 18:25:30 +0530355** transport when receiving NFA_P2P_DATA_EVT with
356** NFA_P2P_LLINK_TYPE.
nxpandroidc7611652015-09-23 16:42:05 +0530357**
358** - Remote SAP who sent UI PDU is returned.
nxpandroid8f6d0532017-07-12 18:25:30 +0530359** - Information of UI PDU up to max_data_len is copied into
360** p_data.
361** - If more information of UI PDU or more UI PDU in queue then
nxf24591c1cbeab2018-02-21 17:32:26 +0530362** more is returned to TRUE.
nxpandroidc7611652015-09-23 16:42:05 +0530363** - Information of next UI PDU is not concatenated.
364**
365** Returns NFA_STATUS_OK if successfully initiated
366** NFA_STATUS_BAD_HANDLE if handle is not valid
367**
368*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530369extern tNFA_STATUS NFA_P2pReadUI(tNFA_HANDLE handle, uint32_t max_data_len,
370 uint8_t* p_remote_sap, uint32_t* p_data_len,
371 uint8_t* p_data, bool* p_more);
nxpandroidc7611652015-09-23 16:42:05 +0530372
373/*******************************************************************************
374**
375** Function NFA_P2pFlushUI
376**
377** Description This function is called to flush data on connectionless
378** transport.
379**
380** Returns NFA_STATUS_OK if successfully initiated
381** NFA_STATUS_BAD_HANDLE if handle is not valid
382**
383*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530384extern tNFA_STATUS NFA_P2pFlushUI(tNFA_HANDLE handle, uint32_t* p_length);
nxpandroidc7611652015-09-23 16:42:05 +0530385
386/*******************************************************************************
387**
388** Function NFA_P2pSendData
389**
390** Description This function is called to send data on connection-oriented
391** transport.
392**
393** Returns NFA_STATUS_OK if successfully initiated
394** NFA_STATUS_BAD_HANDLE if handle is not valid
395** NFA_STATUS_BAD_LENGTH if data length is more than remote MIU
396** NFA_STATUS_CONGESTED if congested
397** NFA_STATUS_FAILED otherwise
398**
399*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530400extern tNFA_STATUS NFA_P2pSendData(tNFA_HANDLE conn_handle, uint16_t length,
401 uint8_t* p_data);
nxpandroidc7611652015-09-23 16:42:05 +0530402
403/*******************************************************************************
404**
405** Function NFA_P2pReadData
406**
407** Description This function is called to read data on connection-oriented
nxpandroid8f6d0532017-07-12 18:25:30 +0530408** transport when receiving NFA_P2P_DATA_EVT with
409** NFA_P2P_DLINK_TYPE.
nxpandroidc7611652015-09-23 16:42:05 +0530410**
nxpandroid8f6d0532017-07-12 18:25:30 +0530411** - Information of I PDU is copied into p_data up to
412** max_data_len.
413** - If more information of I PDU or more I PDU in queue, then
nxf24591c1cbeab2018-02-21 17:32:26 +0530414** more is returned to TRUE.
nxpandroidc7611652015-09-23 16:42:05 +0530415** - Information of next I PDU is not concatenated.
416**
417** Returns NFA_STATUS_OK if successfully initiated
418** NFA_STATUS_BAD_HANDLE if handle is not valid
419**
420*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530421extern tNFA_STATUS NFA_P2pReadData(tNFA_HANDLE handle, uint32_t max_data_len,
422 uint32_t* p_data_len, uint8_t* p_data,
423 bool* p_more);
nxpandroidc7611652015-09-23 16:42:05 +0530424
425/*******************************************************************************
426**
427** Function NFA_P2pFlushData
428**
429** Description This function is called to flush data on connection-oriented
430** transport.
431**
432** Returns NFA_STATUS_OK if successfully initiated
433** NFA_STATUS_BAD_HANDLE if handle is not valid
434**
435*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530436extern tNFA_STATUS NFA_P2pFlushData(tNFA_HANDLE handle, uint32_t* p_length);
nxpandroidc7611652015-09-23 16:42:05 +0530437
438/*******************************************************************************
439**
440** Function NFA_P2pSetLocalBusy
441**
442** Description This function is called to stop or resume incoming data on
443** connection-oriented transport.
444**
445** Returns NFA_STATUS_OK if successfully initiated
446** NFA_STATUS_BAD_HANDLE if handle is not valid
447** NFA_STATUS_FAILED otherwise
448**
449*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530450extern tNFA_STATUS NFA_P2pSetLocalBusy(tNFA_HANDLE conn_handle, bool is_busy);
nxpandroidc7611652015-09-23 16:42:05 +0530451
452/*******************************************************************************
453**
454** Function NFA_P2pGetLinkInfo
455**
456** Description This function is called to get local/remote link MIU and
nxpandroid8f6d0532017-07-12 18:25:30 +0530457** Well-Known Service list encoded as a 16-bit field of
458** connected LLCP. NFA_P2P_LINK_INFO_EVT will be returned.
nxpandroidc7611652015-09-23 16:42:05 +0530459**
460** Returns NFA_STATUS_OK if successfully initiated
461** NFA_STATUS_BAD_HANDLE if server or client is not registered
462** NFA_STATUS_FAILED otherwise
463**
464*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530465extern tNFA_STATUS NFA_P2pGetLinkInfo(tNFA_HANDLE handle);
nxpandroidc7611652015-09-23 16:42:05 +0530466
467/*******************************************************************************
468**
469** Function NFA_P2pGetRemoteSap
470**
nxpandroid8f6d0532017-07-12 18:25:30 +0530471** Description This function is called to get SAP associated by service
472** name on connected remote LLCP.
nxpandroidc7611652015-09-23 16:42:05 +0530473** NFA_P2P_SDP_EVT will be returned.
474**
475** Returns NFA_STATUS_OK if successfully initiated
476** NFA_STATUS_BAD_HANDLE if server or client is not registered
477** NFA_STATUS_FAILED otherwise
478**
479*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530480extern tNFA_STATUS NFA_P2pGetRemoteSap(tNFA_HANDLE handle,
481 char* p_service_name);
nxpandroidc7611652015-09-23 16:42:05 +0530482
483/*******************************************************************************
484**
485** Function NFA_P2pSetLLCPConfig
486**
487** Description This function is called to change LLCP config parameters.
488** Application must call while LLCP is not activated.
489**
490** Parameters descriptions (default value)
491** - Local Link MIU (LLCP_MIU)
492** - Option parameter (LLCP_OPT_VALUE)
493** - Response Waiting Time Index (LLCP_WAITING_TIME)
494** - Local Link Timeout (LLCP_LTO_VALUE)
nxpandroid8f6d0532017-07-12 18:25:30 +0530495** - Inactivity Timeout as initiator role
496** (LLCP_INIT_INACTIVITY_TIMEOUT)
497** - Inactivity Timeout as target role
498** (LLCP_TARGET_INACTIVITY_TIMEOUT)
nxpandroidc7611652015-09-23 16:42:05 +0530499** - Delay SYMM response (LLCP_DELAY_RESP_TIME)
nxpandroid8f6d0532017-07-12 18:25:30 +0530500** - Data link connection timeout
501** (LLCP_DATA_LINK_CONNECTION_TOUT)
502** - Delay timeout to send first PDU as initiator
503** (LLCP_DELAY_TIME_TO_SEND_FIRST_PDU)
nxpandroidc7611652015-09-23 16:42:05 +0530504**
505** Returns NFA_STATUS_OK if successfully initiated
506** NFA_STATUS_FAILED otherwise
507**
508*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530509extern tNFA_STATUS NFA_P2pSetLLCPConfig(uint16_t link_miu, uint8_t opt,
510 uint8_t wt, uint16_t link_timeout,
511 uint16_t inact_timeout_init,
512 uint16_t inact_timeout_target,
513 uint16_t symm_delay,
514 uint16_t data_link_timeout,
515 uint16_t delay_first_pdu_timeout);
nxpandroidc7611652015-09-23 16:42:05 +0530516
517/*******************************************************************************
518**
519** Function NFA_P2pGetLLCPConfig
520**
521** Description This function is called to read LLCP config parameters.
522**
523** Parameters descriptions
524** - Local Link MIU
525** - Option parameter
526** - Response Waiting Time Index
527** - Local Link Timeout
528** - Inactivity Timeout as initiator role
529** - Inactivity Timeout as target role
530** - Delay SYMM response
531** - Data link connection timeout
532** - Delay timeout to send first PDU as initiator
533**
534** Returns None
535**
536*******************************************************************************/
nxpandroid8f6d0532017-07-12 18:25:30 +0530537extern void NFA_P2pGetLLCPConfig(uint16_t* p_link_miu, uint8_t* p_opt,
538 uint8_t* p_wt, uint16_t* p_link_timeout,
539 uint16_t* p_inact_timeout_init,
540 uint16_t* p_inact_timeout_target,
541 uint16_t* p_symm_delay,
542 uint16_t* p_data_link_timeout,
543 uint16_t* p_delay_first_pdu_timeout);
nxpandroidc7611652015-09-23 16:42:05 +0530544
nxpandroidc7611652015-09-23 16:42:05 +0530545#endif /* NFA_P2P_API_H */