2 * Copyright (C) 2010 NXP Semiconductors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * \file phFriNfc_LlcpTransport_Connectionless.h
24 #ifndef PHFRINFC_LLCP_TRANSPORT_CONNECTIONLESS_H
25 #define PHFRINFC_LLCP_TRANSPORT_CONNECTIONLESS_H
27 #include <phNfcTypes.h>
28 #include <phNfcStatus.h>
31 #include <phFriNfc_Llcp.h>
34 void Handle_Connectionless_IncommingFrame(phFriNfc_LlcpTransport_t *pLlcpTransport,
35 phNfc_sData_t *psData,
40 * \ingroup grp_fri_nfc
41 * \brief <b>Close a socket on a LLCP-connectionless device</b>.
43 * This function closes a LLCP socket previously created using phFriNfc_LlcpTransport_Socket.
45 * \param[in] pLlcpSocket A pointer to a phFriNfc_LlcpTransport_Socket_t.
47 * \retval NFCSTATUS_SUCCESS Operation successful.
48 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
49 * could not be properly interpreted.
50 * \retval NFCSTATUS_FAILED Operation failed.
52 NFCSTATUS phFriNfc_LlcpTransport_Connectionless_Close(phFriNfc_LlcpTransport_Socket_t* pLlcpSocket);
55 * \ingroup grp_fri_nfc
56 * \brief <b>Send data on a socket to a given destination SAP</b>.
58 * This function is used to write data on a socket to a given destination SAP.
59 * This function can only be called on a connectionless socket.
62 * \param[in] pLlcpSocket A pointer to a LlcpSocket created.
63 * \param[in] nSap The destination SAP.
64 * \param[in] psBuffer The buffer containing the data to send.
65 * \param[in] pSend_RspCb The callback to be called when the
66 * operation is completed.
67 * \param[in] pContext Upper layer context to be returned in
70 * \retval NFCSTATUS_SUCCESS Operation successful.
71 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
72 * could not be properly interpreted.
73 * \retval NFCSTATUS_PENDING Reception operation is in progress,
74 * pSend_RspCb will be called upon completion.
75 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of
76 * a valid type to perform the requsted operation.
77 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized.
78 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress.
79 * \retval NFCSTATUS_FAILED Operation failed.
81 NFCSTATUS phFriNfc_LlcpTransport_Connectionless_SendTo(phFriNfc_LlcpTransport_Socket_t *pLlcpSocket,
83 phNfc_sData_t* psBuffer,
84 pphFriNfc_LlcpTransportSocketSendCb_t pSend_RspCb,
88 * \ingroup grp_lib_nfc
89 * \brief <b>Read data on a socket and get the source SAP</b>.
91 * This function is the same as phLibNfc_Llcp_Recv, except that the callback includes
92 * the source SAP. This functions can only be called on a connectionless socket.
95 * \param[in] pLlcpSocket A pointer to a LlcpSocket created.
96 * \param[in] psBuffer The buffer receiving the data.
97 * \param[in] pRecv_RspCb The callback to be called when the
98 * operation is completed.
99 * \param[in] pContext Upper layer context to be returned in
102 * \retval NFCSTATUS_SUCCESS Operation successful.
103 * \retval NFCSTATUS_INVALID_PARAMETER One or more of the supplied parameters
104 * could not be properly interpreted.
105 * \retval NFCSTATUS_PENDING Reception operation is in progress,
106 * pRecv_RspCb will be called upon completion.
107 * \retval NFCSTATUS_INVALID_STATE The socket is not in a valid state, or not of
108 * a valid type to perform the requsted operation.
109 * \retval NFCSTATUS_NOT_INITIALISED Indicates stack is not yet initialized.
110 * \retval NFCSTATUS_SHUTDOWN Shutdown in progress.
111 * \retval NFCSTATUS_FAILED Operation failed.
113 NFCSTATUS phLibNfc_LlcpTransport_Connectionless_RecvFrom(phFriNfc_LlcpTransport_Socket_t *pLlcpSocket,
114 phNfc_sData_t* psBuffer,
115 pphFriNfc_LlcpTransportSocketRecvFromCb_t pRecv_Cb,
118 #endif /* PHFRINFC_LLCP_TRANSPORT_CONNECTIONLESS_H */