1e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/******************************************************************************
2e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
35c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen *  Copyright (C) 2010-2013 Broadcom Corporation
4e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
5e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  Licensed under the Apache License, Version 2.0 (the "License");
6e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  you may not use this file except in compliance with the License.
7e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  You may obtain a copy of the License at:
8e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
9e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  http://www.apache.org/licenses/LICENSE-2.0
10e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
11e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  Unless required by applicable law or agreed to in writing, software
12e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  distributed under the License is distributed on an "AS IS" BASIS,
13e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  See the License for the specific language governing permissions and
15e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  limitations under the License.
16e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
17e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project ******************************************************************************/
18e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
195c65c3a0f42e174e47fecd4e569606003217ff4eMartijn Coenen
20e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/******************************************************************************
21e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
22e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  This is the public interface file for NFA SNEP, Broadcom's NFC
23e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *  application layer for mobile phones.
24e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project *
25e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project ******************************************************************************/
26e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#ifndef NFA_SNEP_API_H
27e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_API_H
28e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
29e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#include "nfa_api.h"
30e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
31e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*****************************************************************************
32e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**  Constants and data types
33e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*****************************************************************************/
34e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_VERSION                0x10    /* SNEP Version 1.0          */
35e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
36e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_REQ_CODE_CONTINUE      0x00    /* send remaining fragments         */
37e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_REQ_CODE_GET           0x01    /* return an NDEF message           */
38e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_REQ_CODE_PUT           0x02    /* accept an NDEF message           */
39e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_REQ_CODE_REJECT        0x7F    /* do not send remaining fragments  */
40e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
41e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define tNFA_SNEP_REQ_CODE  UINT8
42e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
43e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_RESP_CODE_CONTINUE     0x80    /* continue send remaining fragments    */
44e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_RESP_CODE_SUCCESS      0x81    /* the operation succeeded              */
45e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_RESP_CODE_NOT_FOUND    0xC0    /* resource not found                   */
46e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_RESP_CODE_EXCESS_DATA  0xC1    /* resource exceeds data size limit     */
47e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_RESP_CODE_BAD_REQ      0xC2    /* malformed request not understood     */
48e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_RESP_CODE_NOT_IMPLM    0xE0    /* unsupported functionality requested  */
49e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_RESP_CODE_UNSUPP_VER   0xE1    /* unsupported protocol version         */
50e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_RESP_CODE_REJECT       0xFF    /* do not send remaining fragments      */
51e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
52e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define tNFA_SNEP_RESP_CODE UINT8
53e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
54e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* NFA SNEP callback events */
55e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_REG_EVT                    0x00    /* Server/client Registeration Status   */
56e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_ACTIVATED_EVT              0x01    /* LLCP link has been activated, client only   */
57e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_DEACTIVATED_EVT            0x02    /* LLCP link has been deactivated, client only */
58e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_CONNECTED_EVT              0x03    /* Data link has been created           */
59e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_GET_REQ_EVT                0x04    /* GET request from client              */
60e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_PUT_REQ_EVT                0x05    /* PUT request from client              */
61e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_GET_RESP_EVT               0x06    /* GET response from server             */
62e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_PUT_RESP_EVT               0x07    /* PUT response from server             */
63e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_DISC_EVT                   0x08    /* Failed to connect or disconnected    */
64e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
65e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_ALLOC_BUFF_EVT	            0x09    /* Request to allocate a buffer for NDEF*/
66e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_GET_RESP_CMPL_EVT          0x0A    /* GET response sent to client          */
67e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
68e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_DEFAULT_SERVER_STARTED_EVT 0x0B    /* SNEP default server is started       */
69e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_DEFAULT_SERVER_STOPPED_EVT 0x0C    /* SNEP default server is stopped       */
70e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
71e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef UINT8 tNFA_SNEP_EVT;
72e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
73e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#define NFA_SNEP_ANY_SAP         LLCP_INVALID_SAP
74e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
75e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_REG_EVT */
76e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
77e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
78e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_STATUS         status;
79e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         reg_handle;         /* handle for registered server/client */
80e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    char                service_name[LLCP_MAX_SN_LEN + 1];      /* only for server */
81e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_REG;
82e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
83e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_ACTIVATED_EVT */
84e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
85e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
86e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         client_handle;      /* handle for registered client    */
87e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_ACTIVATED;
88e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
89e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_DEACTIVATED_EVT */
90e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef tNFA_SNEP_ACTIVATED tNFA_SNEP_DEACTIVATED;
91e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
92e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_CONNECTED_EVT */
93e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*
94e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** for server, new handle will be assigned for conn_handle
95e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** for client, handle used in NFA_SnepConnect () is returned in conn_handle
96e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*/
97e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
98e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
99e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         reg_handle;         /* server/client handle            */
100e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         conn_handle;        /* handle for data link connection */
101e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_CONNECT;
102e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
103e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_GET_REQ_EVT */
104e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
105e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
106e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         conn_handle;        /* handle for data link connection */
107e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT32              acceptable_length;  /* acceptable length from client   */
108e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT32              ndef_length;        /* NDEF message length             */
109e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               *p_ndef;            /* NDEF message                    */
110e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_GET_REQ;
111e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
112e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_PUT_REQ_EVT */
113e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
114e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
115e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         conn_handle;        /* handle for data link connection */
116e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT32              ndef_length;        /* NDEF message length             */
117e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               *p_ndef;            /* NDEF message                    */
118e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_PUT_REQ;
119e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
120e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_GET_RESP_EVT */
121e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
122e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
123e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         conn_handle;        /* handle for data link connection */
124e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_RESP_CODE resp_code;          /* response code from server       */
125e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT32              ndef_length;        /* NDEF message length             */
126e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               *p_ndef;            /* NDEF message                    */
127e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_GET_RESP;
128e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
129e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_PUT_RESP_EVT */
130e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
131e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
132e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         conn_handle;        /* handle for data link connection */
133e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_RESP_CODE resp_code;          /* response code from server       */
134e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_PUT_RESP;
135e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
136e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_DISC_EVT */
137e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
138e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
139e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         conn_handle;        /* handle for data link connection */
140e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                            /* client_handle if connection failed */
141e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_DISC;
142e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
143e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_ALLOC_BUFF_EVT */
144e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
145e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
146e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         conn_handle;        /* handle for data link connection                */
147e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_REQ_CODE  req_code;           /* NFA_SNEP_REQ_CODE_GET or NFA_SNEP_REQ_CODE_PUT */
148e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_RESP_CODE resp_code;          /* Response code if cannot allocate buffer        */
149e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT32              ndef_length;        /* NDEF message length                            */
150e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               *p_buff;            /* buffer for NDEF message                        */
151e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_ALLOC;
152e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
153e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Data for NFA_SNEP_GET_RESP_CMPL_EVT */
154e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef struct
155e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
156e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_HANDLE         conn_handle;        /* handle for data link connection */
157e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    UINT8               *p_buff;            /* buffer for NDEF message         */
158e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_GET_RESP_CMPL;
159e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
160e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* Union of all SNEP callback structures */
161e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef union
162e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
163e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_REG           reg;            /* NFA_SNEP_REG_EVT             */
164e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_ACTIVATED     activated;      /* NFA_SNEP_ACTIVATED_EVT       */
165e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_DEACTIVATED   deactivated;    /* NFA_SNEP_DEACTIVATED_EVT     */
166e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_CONNECT       connect;        /* NFA_SNEP_CONNECTED_EVT       */
167e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_GET_REQ       get_req;        /* NFA_SNEP_GET_REQ_EVT         */
168e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_PUT_REQ       put_req;        /* NFA_SNEP_PUT_REQ_EVT         */
169e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_GET_RESP      get_resp;       /* NFA_SNEP_GET_RESP_EVT        */
170e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_PUT_RESP      put_resp;       /* NFA_SNEP_PUT_RESP_EVT        */
171e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_DISC          disc;           /* NFA_SNEP_DISC_EVT            */
172e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_ALLOC         alloc;          /* NFA_SNEP_ALLOC_BUFF_EVT      */
173e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project    tNFA_SNEP_GET_RESP_CMPL get_resp_cmpl;  /* NFA_SNEP_GET_RESP_CMPL_EVT   */
174e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project} tNFA_SNEP_EVT_DATA;
175e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
176e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/* NFA SNEP callback */
177e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projecttypedef void (tNFA_SNEP_CBACK) (tNFA_SNEP_EVT event, tNFA_SNEP_EVT_DATA *p_data);
178e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
179e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*****************************************************************************
180e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**  External Function Declarations
181e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*****************************************************************************/
182e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#ifdef __cplusplus
183e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Projectextern "C"
184e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project{
185e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#endif
186e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
187e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
188e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
189e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepStartDefaultServer
190e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
191e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called to listen to SAP, 0x04 as SNEP default
192e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  server ("urn:nfc:sn:snep") on LLCP.
193e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
194e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_DEFAULT_SERVER_STARTED_EVT without data will be returned.
195e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
196e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Note:            If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT
197e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  should happen before calling this function
198e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
199e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
200e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
201e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
202e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
203e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepStartDefaultServer (tNFA_SNEP_CBACK *p_cback);
204e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
205e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
206e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
207e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepStopDefaultServer
208e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
209e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called to stop SNEP default server on LLCP.
210e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
211e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_DEFAULT_SERVER_STOPPED_EVT without data will be returned.
212e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
213e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Note:            If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT
214e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  should happen before calling this function
215e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
216e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
217e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
218e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
219e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
220e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepStopDefaultServer (tNFA_SNEP_CBACK *p_cback);
221e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
222e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
223e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
224e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepRegisterServer
225e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
226e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called to listen to a SAP as SNEP server.
227e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
228e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  If server_sap is set to NFA_SNEP_ANY_SAP, then NFA will allocate
229e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  a SAP between LLCP_LOWER_BOUND_SDP_SAP and LLCP_UPPER_BOUND_SDP_SAP
230e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
231e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFC Forum default SNEP server ("urn:nfc:sn:snep") may be launched
232e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  by NFA_SnepStartDefaultServer ().
233e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
234e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_REG_EVT will be returned with status, handle and service name.
235e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
236e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Note:            If RF discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT
237e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  should happen before calling this function
238e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
239e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
240e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_INVALID_PARAM if p_service_name or p_cback is NULL
241e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
242e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
243e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
244e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepRegisterServer (UINT8           server_sap,
245e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                   char            *p_service_name,
246e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                   tNFA_SNEP_CBACK *p_cback);
247e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
248e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
249e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
250e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepRegisterClient
251e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
252e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called to register SNEP client.
253e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_REG_EVT will be returned with status, handle
254e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  and zero-length service name.
255e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
256e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
257e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_INVALID_PARAM if p_cback is NULL
258e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
259e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
260e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
261e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepRegisterClient (tNFA_SNEP_CBACK *p_cback);
262e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
263e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
264e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
265e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepDeregister
266e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
267e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called to stop listening as SNEP server
268e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  or SNEP client. Application shall use reg_handle returned in
269e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_REG_EVT.
270e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
271e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Note:            If this function is called to de-register a SNEP server and RF
272e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  discovery is started, NFA_StopRfDiscovery()/NFA_RF_DISCOVERY_STOPPED_EVT
273e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  should happen before calling this function
274e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
275e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
276e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_BAD_HANDLE if handle is not valid
277e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
278e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
279e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
280e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepDeregister (tNFA_HANDLE reg_handle);
281e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
282e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
283e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
284e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepConnect
285e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
286e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called by client to create data link connection
287e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  to SNEP server on peer device.
288e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
289e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  Client handle and service name of server to connect shall be provided.
290e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  A conn_handle will be returned in NFA_SNEP_CONNECTED_EVT, if
291e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  successfully connected. Otherwise NFA_SNEP_DISC_EVT will be returned.
292e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
293e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
294e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_BAD_HANDLE if handle is not valid
295e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_INVALID_PARAM if p_service_name or p_cback is NULL
296e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
297e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
298e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
299e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepConnect (tNFA_HANDLE     client_handle,
300e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                            char            *p_service_name);
301e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
302e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
303e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
304e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepGet
305e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
306e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called by client to send GET request.
307e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
308e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  Application shall allocate a buffer and put NDEF message with
309e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  desired record type to get from server. NDEF message from server
310e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  will be returned in the same buffer with NFA_SNEP_GET_RESP_EVT.
311e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  The size of buffer will be used as "Acceptable Length".
312e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
313e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_GET_RESP_EVT or NFA_SNEP_DISC_EVT will be returned
314e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  through registered p_cback. Application may free the buffer
315e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  after receiving these events.
316e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
317e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
318e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
319e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_BAD_HANDLE if handle is not valid
320e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
321e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
322e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
323e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepGet (tNFA_HANDLE     conn_handle,
324e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                        UINT32          buff_length,
325e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                        UINT32          ndef_length,
326e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                        UINT8           *p_ndef_buff);
327e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
328e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
329e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
330e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepPut
331e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
332e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called by client to send PUT request.
333e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
334e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  Application shall allocate a buffer and put desired NDEF message
335e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  to send to server.
336e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
337e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_PUT_RESP_EVT or NFA_SNEP_DISC_EVT will be returned
338e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  through p_cback. Application may free the buffer after receiving
339e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  these events.
340e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
341e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
342e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_BAD_HANDLE if handle is not valid
343e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_INVALID_PARAM if p_service_name or p_cback is NULL
344e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
345e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
346e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
347e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepPut (tNFA_HANDLE     conn_handle,
348e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                        UINT32          ndef_length,
349e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                        UINT8           *p_ndef_buff);
350e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
351e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
352e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
353e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepGetResponse
354e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
355e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called by server to send response of GET request.
356e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
357e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  When server application receives NFA_SNEP_ALLOC_BUFF_EVT,
358e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  it shall allocate a buffer for incoming NDEF message and
359e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  pass the pointer within callback context. This buffer will be
360e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  returned with NFA_SNEP_GET_REQ_EVT after receiving complete
361e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NDEF message. If buffer is not allocated, NFA_SNEP_RESP_CODE_NOT_FOUND
362e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  (Note:There is no proper response code for this case)
363e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  or NFA_SNEP_RESP_CODE_REJECT will be sent to client.
364e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
365e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  Server application shall provide conn_handle which is received in
366e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_GET_REQ_EVT.
367e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
368e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  Server application shall allocate a buffer and put NDEF message if
369e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  response code is NFA_SNEP_RESP_CODE_SUCCESS. Otherwise, ndef_length
370e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  shall be set to zero.
371e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
372e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_GET_RESP_CMPL_EVT or NFA_SNEP_DISC_EVT will be returned
373e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  through registered callback function. Application may free
374e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  the buffer after receiving these events.
375e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
376e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
377e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_BAD_HANDLE if handle is not valid
378e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
379e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
380e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
381e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepGetResponse (tNFA_HANDLE         conn_handle,
382e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                tNFA_SNEP_RESP_CODE resp_code,
383e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                UINT32              ndef_length,
384e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                UINT8               *p_ndef_buff);
385e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
386e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
387e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
388e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepPutResponse
389e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
390e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called by server to send response of PUT request.
391e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
392e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  When server application receives NFA_SNEP_ALLOC_BUFF_EVT,
393e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  it shall allocate a buffer for incoming NDEF message and
394e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  pass the pointer within callback context. This buffer will be
395e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  returned with NFA_SNEP_PUT_REQ_EVT after receiving complete
396e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NDEF message.  If buffer is not allocated, NFA_SNEP_RESP_CODE_REJECT
397e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  will be sent to client or NFA will discard request and send
398e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_RESP_CODE_SUCCESS (Note:There is no proper response code for
399e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  this case).
400e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
401e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  Server application shall provide conn_handle which is received in
402e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_PUT_REQ_EVT.
403e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
404e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_DISC_EVT will be returned through registered callback
405e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  function when client disconnects data link connection.
406e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
407e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
408e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_BAD_HANDLE if handle is not valid
409e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
410e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
411e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
412e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepPutResponse (tNFA_HANDLE         conn_handle,
413e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                                tNFA_SNEP_RESP_CODE resp_code);
414e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
415e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
416e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
417e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepDisconnect
418e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
419e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function is called to disconnect data link connection.
420e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  discard any pending data if flush is set to TRUE
421e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
422e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  Client application shall provide conn_handle in NFA_SNEP_GET_RESP_EVT
423e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  or NFA_SNEP_PUT_RESP_EVT.
424e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
425e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  Server application shall provide conn_handle in NFA_SNEP_GET_REQ_EVT
426e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  or NFA_SNEP_PUT_REQ_EVT.
427e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
428e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_SNEP_DISC_EVT will be returned
429e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
430e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          NFA_STATUS_OK if successfully initiated
431e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_BAD_HANDLE if handle is not valid
432e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  NFA_STATUS_FAILED otherwise
433e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
434e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
435e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern tNFA_STATUS NFA_SnepDisconnect (tNFA_HANDLE conn_handle,
436e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project                                               BOOLEAN     flush);
437e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
438e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project/*******************************************************************************
439e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
440e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Function         NFA_SnepSetTraceLevel
441e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
442e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Description      This function sets the trace level for SNEP.  If called with
443e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**                  a value of 0xFF, it simply returns the current trace level.
444e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
445e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project** Returns          The new or current trace level
446e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project**
447e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project*******************************************************************************/
448e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source ProjectNFC_API extern UINT8 NFA_SnepSetTraceLevel (UINT8 new_level);
449e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
450e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#ifdef __cplusplus
451e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project}
452e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#endif
453e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
454e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project#endif /* NFA_P2P_API_H */
455e9df6ba5a8fcccf306a80b1670b423be8fe7746The Android Open Source Project
456