15d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*
25d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Copyright (C) 2010 NXP Semiconductors
35d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
45d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Licensed under the Apache License, Version 2.0 (the "License");
55d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * you may not use this file except in compliance with the License.
65d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * You may obtain a copy of the License at
75d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
85d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *      http://www.apache.org/licenses/LICENSE-2.0
95d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Unless required by applicable law or agreed to in writing, software
115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * distributed under the License is distributed on an "AS IS" BASIS,
125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * See the License for the specific language governing permissions and
145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * limitations under the License.
155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \file  phFriNfc_LlcpTransport.h
195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief
205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Project: NFC-FRI
225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PHFRINFC_LLCP_TRANSPORT_H
265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TRANSPORT_H
275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phNfcHalTypes.h>
285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phNfcLlcpTypes.h>
295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phNfcTypes.h>
305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phLibNfcStatus.h>
315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phFriNfc_Llcp.h>
325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phFriNfc_LlcpUtils.h>
335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifdef ANDROID
345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <string.h>
357c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen#include <pthread.h>
365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif
375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef uint32_t    phFriNfc_Socket_Handle;
405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_llcp_mac
435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Declaration of a TRANSPORT type
445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellystruct phFriNfc_LlcpTransport;
465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_LlcpTransport phFriNfc_LlcpTransport_t;
475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellystruct phFriNfc_LlcpTransport_Socket;
495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_LlcpTransport_Socket phFriNfc_LlcpTransport_Socket_t;
505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
517b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogistruct phFriNfc_Llcp_CachedServiceName;
527b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogitypedef struct phFriNfc_Llcp_CachedServiceName phFriNfc_Llcp_CachedServiceName_t;
537b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== ENUMERATES ===========*/
555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* Enum reperesents the different LLCP Link status*/
575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef enum phFriNfc_LlcpTransportSocket_eSocketState
585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketDefault,
605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketCreated,
615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketBound,
625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketRegistered,
635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketConnected,
645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketConnecting,
655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketAccepted,
665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketDisconnected,
675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketDisconnecting,
685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketRejected,
695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_LlcpTransportSocket_eSocketState_t;
705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== CALLBACKS ===========*/
745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*\ingroup grp_fri_nfc
775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief LLCP socket error notification callback definition
795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*pphFriNfc_LlcpTransportSocketErrCb_t) ( void*      pContext,
815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                       uint8_t    nErrCode);
825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*\ingroup grp_fri_nfc
865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief LLCP socket listen callback definition
885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*pphFriNfc_LlcpTransportSocketListenCb_t) (void*                            pContext,
905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                         phFriNfc_LlcpTransport_Socket_t  *IncomingSocket);
915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*\ingroup grp_fri_nfc
945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief LLCP socket connect callback definition
965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*pphFriNfc_LlcpTransportSocketConnectCb_t)  ( void*        pContext,
985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                            uint8_t      nErrCode,
995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                            NFCSTATUS    status);
1005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*\ingroup grp_fri_nfc
1035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
1045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief LLCP socket disconnect callback definition
1055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
1065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*pphFriNfc_LlcpTransportSocketDisconnectCb_t) (void*        pContext,
1075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                             NFCSTATUS    status);
1085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*\ingroup grp_fri_nfc
1115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
1125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief LLCP socket accept callback definition
1135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
1145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*pphFriNfc_LlcpTransportSocketAcceptCb_t) (void*        pContext,
1155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                         NFCSTATUS    status);
1165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*\ingroup grp_fri_nfc
1195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
1205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief LLCP socket reject callback definition
1215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
1225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*pphFriNfc_LlcpTransportSocketRejectCb_t) (void*        pContext,
1235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                         NFCSTATUS    status);
1245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*\ingroup grp_fri_nfc
1275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
1285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief LLCP socket reception callback definition
1295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
1305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*pphFriNfc_LlcpTransportSocketRecvCb_t) (void*     pContext,
1315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                       NFCSTATUS status);
1325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*\ingroup grp_fri_nfc
1355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
1365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief LLCP socket reception with SSAP callback definition
1375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
1385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*pphFriNfc_LlcpTransportSocketRecvFromCb_t) (void*       pContext,
1395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                           uint8_t     ssap,
1405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                           NFCSTATUS   status);
1415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*\ingroup grp_fri_nfc
1445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
1455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief LLCP socket emission callback definition
1465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
1475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*pphFriNfc_LlcpTransportSocketSendCb_t) (void*        pContext,
1485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                       NFCSTATUS    status);
1495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== STRUCTURES ===========*/
1525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_llcp_mac
1545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Declaration of a SOCKET type
1555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
1565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellystruct phFriNfc_LlcpTransport_Socket
1575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
1585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransportSocket_eSocketState_t    eSocket_State;
1595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransport_eSocketType_t           eSocket_Type;
160c2866714540bec65af19240e95a10d3090df0cf9Sylvain Fonteneau   phFriNfc_LlcpTransport_sSocketOptions_t        sSocketOption;
1615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   pphFriNfc_LlcpTransportSocketErrCb_t           pSocketErrCb;
1625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /* Remote and local socket info */
1645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                                        socket_sSap;
1655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                                        socket_dSap;
166c2866714540bec65af19240e95a10d3090df0cf9Sylvain Fonteneau   // TODO: copy service name (could be deallocated by upper layer)
167cf5cd1520ea32d2b65712a36a105f396df07345cSylvain Fonteneau   phNfc_sData_t                                  sServiceName;
1685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                                        remoteRW;
1695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                                        localRW;
1705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint16_t                                       remoteMIU;
1715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint16_t                                       localMIUX;
1725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                                        index;
1735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1747b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   /* SDP related fields */
1757b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                                       nTid;
1767b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
1775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /* Information Flags */
1785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                        bSocketRecvPending;
1795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                        bSocketSendPending;
1805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                        bSocketListenPending;
1815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                        bSocketDiscPending;
1825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                        bSocketConnectPending;
1835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                        bSocketAcceptPending;
1845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                        bSocketRRPending;
1855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                        bSocketRNRPending;
1865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /* Buffers */
1885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t                                  sSocketSendBuffer;
1895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t                                  sSocketLinearBuffer;
1905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t*                                 sSocketRecvBuffer;
1915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint32_t                                       *receivedLength;
1925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint32_t                                       bufferLinearLength;
1935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint32_t                                       bufferSendMaxLength;
1945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint32_t                                       bufferRwMaxLength;
1955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                         ReceiverBusyCondition;
1965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                         RemoteBusyConditionInfo;
1975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   UTIL_FIFO_BUFFER                               sCyclicFifoBuffer;
1985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint32_t                                       indexRwRead;
1995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint32_t                                       indexRwWrite;
2005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /* Construction Frame */
2025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sPacketHeader_t                  sLlcpHeader;
2035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sPacketSequence_t                sSequence;
2045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                                        socket_VS;
2055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                                        socket_VSA;
2065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                                        socket_VR;
2075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                                        socket_VRA;
2085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /* Callbacks */
2105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   pphFriNfc_LlcpTransportSocketAcceptCb_t        pfSocketAccept_Cb;
2115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   pphFriNfc_LlcpTransportSocketSendCb_t          pfSocketSend_Cb;
2125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   pphFriNfc_LlcpTransportSocketRecvFromCb_t      pfSocketRecvFrom_Cb;
2135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   pphFriNfc_LlcpTransportSocketRecvCb_t          pfSocketRecv_Cb;
2145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   pphFriNfc_LlcpTransportSocketListenCb_t        pfSocketListen_Cb;
2155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   pphFriNfc_LlcpTransportSocketConnectCb_t       pfSocketConnect_Cb;
2165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   pphFriNfc_LlcpTransportSocketDisconnectCb_t    pfSocketDisconnect_Cb;
2175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /* Table of PHFRINFC_LLCP_RW_MAX Receive Windows Buffers */
2195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t                                  sSocketRwBufferTable[PHFRINFC_LLCP_RW_MAX];
2205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /* Pointer a the socket table */
2225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransport_t                       *psTransport;
2235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /* Context */
2245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                                          *pListenContext;
2255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                                          *pAcceptContext;
2265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                                          *pRejectContext;
2275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                                          *pConnectContext;
228837efc3194a03beaaa32b370c63a9270ed9664d8Martijn Coenen   void                                          *pDisconnectContext;
2295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                                          *pSendContext;
2305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                                          *pRecvContext;
2315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                                          *pContext;
2325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly};
2335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
2355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \ingroup grp_fri_nfc_llcp_mac
2367b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi * \brief TODO
2377b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi */
2387b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogistruct phFriNfc_Llcp_CachedServiceName
2397b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi{
2407b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   phNfc_sData_t                         sServiceName;
2417b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                               nSap;
2427b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi};
2437b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
2447b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
2457b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi/**
2467b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi * \ingroup grp_fri_nfc_llcp_mac
2475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief Declaration of a TRANSPORT Type with a table of PHFRINFC_LLCP_NB_SOCKET_DEFAULT sockets
2485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *        and a pointer a Llcp layer
2495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
2505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellystruct phFriNfc_LlcpTransport
2515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
2525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpTransport_Socket_t       pSocketTable[PHFRINFC_LLCP_NB_SOCKET_MAX];
2537b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   phFriNfc_Llcp_CachedServiceName_t     pCachedServiceNames[PHFRINFC_LLCP_SDP_ADVERTISED_NB];
2545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_t                       *pLlcp;
2557c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen   pthread_mutex_t                       mutex;
2565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                bSendPending;
2575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                bRecvPending;
2585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                bDmPending;
2595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                                bFrmrPending;
2605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2617c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen   phFriNfc_Llcp_LinkSend_CB_t           pfLinkSendCb;
262955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi   void                                  *pLinkSendContext;
263955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi
2645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                               socketIndex;
2655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Info field of pending FRMR packet*/
2675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                               FrmrInfoBuffer[4];
2685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sPacketHeader_t         sLlcpHeader;
2695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sPacketSequence_t       sSequence;
2705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly  /**< Info field of pending DM packet*/
27242fd1ffc1f8f87e7faca1724d128dafa70ff3b1eSylvain Fonteneau   phFriNfc_Llcp_sPacketHeader_t         sDmHeader;
27342fd1ffc1f8f87e7faca1724d128dafa70ff3b1eSylvain Fonteneau   phNfc_sData_t                         sDmPayload;
2745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                               DmInfoBuffer[3];
2755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                               LinkStatusError;
2777b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
2787b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   /**< Service discovery related infos */
2797b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   phNfc_sData_t                         *psDiscoveryServiceNameList;
2807b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                               *pnDiscoverySapList;
2817b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                               nDiscoveryListSize;
2827b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                               nDiscoveryReqOffset;
2837b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                               nDiscoveryResOffset;
2847b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
2857b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                               nDiscoveryResTidList[PHFRINFC_LLCP_SNL_RESPONSE_MAX];
2867b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                               nDiscoveryResSapList[PHFRINFC_LLCP_SNL_RESPONSE_MAX];
2877b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                               nDiscoveryResListSize;
2887b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
2897b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   uint8_t                               pDiscoveryBuffer[PHFRINFC_LLCP_MIU_DEFAULT];
2907b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   pphFriNfc_Cr_t                        pfDiscover_Cb;
2917b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi   void                                  *pDiscoverContext;
2927b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
2935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly};
2945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*
2965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly################################################################################
2975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly********************** TRANSPORT Interface Function Prototype  *****************
2985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly################################################################################
2995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
3005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3017c4b4fadb66959c50c170182847886e83393eebfMartijn Coenenbool_t testAndSetSendPending(phFriNfc_LlcpTransport_t* transport);
3027c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen
3037c4b4fadb66959c50c170182847886e83393eebfMartijn Coenenvoid clearSendPending(phFriNfc_LlcpTransport_t* transport);
3047c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen
3055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**
3065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
3075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Create a socket on a LLCP-connected device</b>.
3085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
3095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
3105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Reset (phFriNfc_LlcpTransport_t      *pLlcpSocketTable,
3115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        phFriNfc_Llcp_t               *pLlcp);
3125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
315c56a3c7bc332a6656bedf342236267b636051170Sylvain Fonteneau* \ingroup grp_fri_nfc
316c56a3c7bc332a6656bedf342236267b636051170Sylvain Fonteneau* \brief <b>Close all existing sockets</b>.
317c56a3c7bc332a6656bedf342236267b636051170Sylvain Fonteneau*
318c56a3c7bc332a6656bedf342236267b636051170Sylvain Fonteneau*/
319c56a3c7bc332a6656bedf342236267b636051170Sylvain FonteneauNFCSTATUS phFriNfc_LlcpTransport_CloseAll (phFriNfc_LlcpTransport_t  *pLlcpSocketTable);
320c56a3c7bc332a6656bedf342236267b636051170Sylvain Fonteneau
321c56a3c7bc332a6656bedf342236267b636051170Sylvain Fonteneau
322c56a3c7bc332a6656bedf342236267b636051170Sylvain Fonteneau/**
323955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi* \ingroup grp_fri_nfc
324955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi* \brief <b>Used by transport layers to request a send on link layer</b>.
325955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi*
326955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi*/
327955a8efe369ece977e4757f0ae37b3931169125bSunil JogiNFCSTATUS phFriNfc_LlcpTransport_LinkSend( phFriNfc_LlcpTransport_t         *LlcpTransport,
328955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                           phFriNfc_Llcp_sPacketHeader_t    *psHeader,
329955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                           phFriNfc_Llcp_sPacketSequence_t  *psSequence,
330955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                           phNfc_sData_t                    *psInfo,
3317c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen                                           phFriNfc_Llcp_LinkSend_CB_t      pfSend_CB,
3327c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen                                           uint8_t                          socketIndex,
333955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                           void                             *pContext );
334955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi
335955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi
336955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi/**
337955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi* \ingroup grp_fri_nfc
338955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi* \brief <b>Used by transport layers to send a DM frame</b>.
339955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi*
340955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi*  This function is only used when the DM is not related to a DISC on a socket.
341955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi*/
342955a8efe369ece977e4757f0ae37b3931169125bSunil JogiNFCSTATUS phFriNfc_LlcpTransport_SendDisconnectMode(phFriNfc_LlcpTransport_t* psTransport,
343955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                    uint8_t                   dsap,
344955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                    uint8_t                   ssap,
345955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                    uint8_t                   dmOpCode);
346955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi
347955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi/**
348955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi* \ingroup grp_fri_nfc
349955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi* \brief <b>Used by transport layers to send a FRMR frame</b>.
350955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi*
351955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi*/
352955a8efe369ece977e4757f0ae37b3931169125bSunil JogiNFCSTATUS phFriNfc_LlcpTransport_SendFrameReject(phFriNfc_LlcpTransport_t           *psTransport,
353955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            dsap,
354955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            rejectedPTYPE,
355955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            ssap,
356955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 phFriNfc_Llcp_sPacketSequence_t*   sLlcpSequence,
357955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            WFlag,
358955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            IFlag,
359955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            RFlag,
360955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            SFlag,
361955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            vs,
362955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            vsa,
363955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            vr,
364955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi                                                 uint8_t                            vra);
365955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi
3667b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi/*!
3677b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi* \ingroup grp_fri_nfc
3687b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi* \brief <b>Discover remote services SAP using SDP protocol</b>.
3697b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi */
3707b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil JogiNFCSTATUS phFriNfc_LlcpTransport_DiscoverServices( phFriNfc_LlcpTransport_t  *pLlcpTransport,
3717b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi                                                   phNfc_sData_t             *psServiceNameList,
3727b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi                                                   uint8_t                   *pnSapList,
3737b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi                                                   uint8_t                   nListSize,
3747b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi                                                   pphFriNfc_Cr_t            pDiscover_Cb,
3757b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi                                                   void                      *pContext );
376955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi
377955a8efe369ece977e4757f0ae37b3931169125bSunil Jogi/**
3785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_lib_nfc
3795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Get the local options of a socket</b>.
3805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
3815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function returns the local options (maximum packet size and receive window size) used
3825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* for a given connection-oriented socket. This function shall not be used with connectionless
3835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* sockets.
3845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
3855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[out] pLlcpSocket           A pointer to a phFriNfc_LlcpTransport_Socket_t.
3865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psLocalOptions        A pointer to be filled with the local options of the socket.
3875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
3885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
3895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
3905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
3915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
3925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
3935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_NOT_INITIALISED          Indicates stack is not yet initialized.
3945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SHUTDOWN                 Shutdown in progress.
3955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
3965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
3975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_SocketGetLocalOptions(phFriNfc_LlcpTransport_Socket_t  *pLlcpSocket,
3985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                       phLibNfc_Llcp_sSocketOptions_t   *psLocalOptions);
3995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
4025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_lib_nfc
4035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Get the local options of a socket</b>.
4045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function returns the remote options (maximum packet size and receive window size) used
4065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* for a given connection-oriented socket. This function shall not be used with connectionless
4075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* sockets.
4085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[out] pLlcpSocket           A pointer to a phFriNfc_LlcpTransport_Socket_t.
4105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psRemoteOptions       A pointer to be filled with the remote options of the socket.
4115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
4135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
4145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
4155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
4165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
4175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_NOT_INITIALISED          Indicates stack is not yet initialized.
4185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SHUTDOWN                 Shutdown in progress.
4195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
4205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
4215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_SocketGetRemoteOptions(phFriNfc_LlcpTransport_Socket_t*   pLlcpSocket,
4225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                                        phLibNfc_Llcp_sSocketOptions_t*    psRemoteOptions);
4235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**
4265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
4275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Create a socket on a LLCP-connected device</b>.
4285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function creates a socket for a given LLCP link. Sockets can be of two types :
4305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* connection-oriented and connectionless. If the socket is connection-oriented, the caller
4315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* must provide a working buffer to the socket in order to handle incoming data. This buffer
4325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* must be large enough to fit the receive window (RW * MIU), the remaining space being
4335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* used as a linear buffer to store incoming data as a stream. Data will be readable later
4345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* using the phLibNfc_LlcpTransport_Recv function.
4355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* The options and working buffer are not required if the socket is used as a listening socket,
4365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* since it cannot be directly used for communication.
4375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocketTable      A pointer to a table of PHFRINFC_LLCP_NB_SOCKET_DEFAULT sockets.
4395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  eType                 The socket type.
4405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psOptions             The options to be used with the socket.
4415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psWorkingBuffer       A working buffer to be used by the library.
4425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[out] pLlcpSocket           A pointer to a socket pointer to be filled with a
4435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                    socket found on the socket table.
4445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pErr_Cb               The callback to be called each time the socket
4455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                   is in error.
4465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext              Upper layer context to be returned in the callback.
4475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
4495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
4505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
4515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_BUFFER_TOO_SMALL         The working buffer is too small for the MIU and RW
4525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            declared in the options.
4535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INSUFFICIENT_RESOURCES   No more socket handle available.
4545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
4555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* */
4565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Socket(phFriNfc_LlcpTransport_t                           *pLlcpSocketTable,
4575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        phFriNfc_LlcpTransport_eSocketType_t               eType,
4585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        phFriNfc_LlcpTransport_sSocketOptions_t*           psOptions,
4595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        phNfc_sData_t*                                     psWorkingBuffer,
4605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        phFriNfc_LlcpTransport_Socket_t                    **pLlcpSocket,
4615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        pphFriNfc_LlcpTransportSocketErrCb_t               pErr_Cb,
4625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        void*                                              pContext);
4635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
4655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
4665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Close a socket on a LLCP-connected device</b>.
4675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function closes a LLCP socket previously created using phFriNfc_LlcpTransport_Socket.
4695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* If the socket was connected, it is first disconnected, and then closed.
4705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocket                    A pointer to a phFriNfc_LlcpTransport_Socket_t.
4725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
4745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
4755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
4765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
4775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
4785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Close(phFriNfc_LlcpTransport_Socket_t*   pLlcpSocket);
4795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
4825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
4835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Bind a socket to a local SAP</b>.
4845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function binds the socket to a local Service Access Point.
4865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[out] pLlcpSocket           A pointer to a phFriNfc_LlcpTransport_Socket_t.
4885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pConfigInfo           A port number for a specific socket
4897b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi* \param TODO
4905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
4915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
4925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
4935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
4945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
4955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
4965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_ALREADY_REGISTERED       The selected SAP is already bound to another
4975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                             socket.
4985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
4995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
5005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Bind(phFriNfc_LlcpTransport_Socket_t    *pLlcpSocket,
5017b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi                                      uint8_t                            nSap,
5027b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi                                      phNfc_sData_t                      *psServiceName);
5035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
5045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
5055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
5065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Listen for incoming connection requests on a socket</b>.
5075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function switches a socket into a listening state and registers a callback on
5095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* incoming connection requests. In this state, the socket is not able to communicate
5105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* directly. The listening state is only available for connection-oriented sockets
5115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* which are still not connected. The socket keeps listening until it is closed, and
5125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* thus can trigger several times the pListen_Cb callback.
5135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocket        A pointer to a phFriNfc_LlcpTransport_Socket_t.
5165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pListen_Cb         The callback to be called each time the
5175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                socket receive a connection request.
5185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext           Upper layer context to be returned in
5195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                the callback.
5205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
5225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
5235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
5245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state to switch
5255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            to listening state.
5265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
5275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
5285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Listen(phFriNfc_LlcpTransport_Socket_t*          pLlcpSocket,
5295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        pphFriNfc_LlcpTransportSocketListenCb_t   pListen_Cb,
5305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        void*                                     pContext);
5317b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
5325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
5335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
5345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Accept an incoming connection request for a socket</b>.
5355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This functions allows the client to accept an incoming connection request.
5375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* It must be used with the socket provided within the listen callback. The socket
5385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* is implicitly switched to the connected state when the function is called.
5395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocket           A pointer to a phFriNfc_LlcpTransport_Socket_t.
5415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psOptions             The options to be used with the socket.
5425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psWorkingBuffer       A working buffer to be used by the library.
5435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pErr_Cb               The callback to be called each time the accepted socket
5445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                   is in error.
5455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pAccept_RspCb         The callback to be called when the Accept operation is completed
5465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext              Upper layer context to be returned in the callback.
5475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
5495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
5505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
5515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_BUFFER_TOO_SMALL         The working buffer is too small for the MIU and RW
5525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            declared in the options.
5535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
5545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
5555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Accept(phFriNfc_LlcpTransport_Socket_t*             pLlcpSocket,
5565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        phFriNfc_LlcpTransport_sSocketOptions_t*     psOptions,
5575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        phNfc_sData_t*                               psWorkingBuffer,
5585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        pphFriNfc_LlcpTransportSocketErrCb_t         pErr_Cb,
5595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        pphFriNfc_LlcpTransportSocketAcceptCb_t      pAccept_RspCb,
5605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                        void*                                        pContext);
5615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
5625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**
5635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
5645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Reject an incoming connection request for a socket</b>.
5655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This functions allows the client to reject an incoming connection request.
5675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* It must be used with the socket provided within the listen callback. The socket
5685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* is implicitly closed when the function is called.
5695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocket           A pointer to a phFriNfc_LlcpTransport_Socket_t.
5715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pReject_RspCb         The callback to be called when the Reject operation is completed
5725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext              Upper layer context to be returned in the callback.
5735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
5755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
5765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
5775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
5785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
5795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Reject( phFriNfc_LlcpTransport_Socket_t*           pLlcpSocket,
5805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                            pphFriNfc_LlcpTransportSocketRejectCb_t   pReject_RspCb,
5815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                            void                                      *pContext);
5825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
5835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
5845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Try to establish connection with a socket on a remote SAP</b>.
5855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function tries to connect to a given SAP on the remote peer. If the
5875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* socket is not bound to a local SAP, it is implicitly bound to a free SAP.
5885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocket           A pointer to a phFriNfc_LlcpTransport_Socket_t.
5905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  nSap               The destination SAP to connect to.
5915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pConnect_RspCb     The callback to be called when the connection
5925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                operation is completed.
5935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext           Upper layer context to be returned in
5945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                the callback.
5955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
5965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
5975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
5985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
5995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_PENDING                  Connection operation is in progress,
6005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            pConnect_RspCb will be called upon completion.
6015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
6025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
6035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
6045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
6055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Connect( phFriNfc_LlcpTransport_Socket_t*           pLlcpSocket,
6065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                          uint8_t                                    nSap,
6075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                          pphFriNfc_LlcpTransportSocketConnectCb_t   pConnect_RspCb,
6085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                          void*                                      pContext);
6095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
6105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
6115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
6125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Try to establish connection with a socket on a remote service, given its URI</b>.
6135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function tries to connect to a SAP designated by an URI. If the
6155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* socket is not bound to a local SAP, it is implicitly bound to a free SAP.
6165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocket        A pointer to a phFriNfc_LlcpTransport_Socket_t.
6185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psUri              The URI corresponding to the destination SAP to connect to.
6195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pConnect_RspCb     The callback to be called when the connection
6205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                operation is completed.
6215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext           Upper layer context to be returned in
6225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                the callback.
6235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
6255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
6265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
6275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_PENDING                  Connection operation is in progress,
6285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            pConnect_RspCb will be called upon completion.
6295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
6305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
6315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_NOT_INITIALISED          Indicates stack is not yet initialized.
6325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SHUTDOWN                 Shutdown in progress.
6335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
6345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
6355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_ConnectByUri(phFriNfc_LlcpTransport_Socket_t*           pLlcpSocket,
6365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                              phNfc_sData_t*                            psUri,
6375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                              pphFriNfc_LlcpTransportSocketConnectCb_t   pConnect_RspCb,
6385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                              void*                                     pContext);
6395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
6405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
6415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_lib_nfc
6425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Disconnect a currently connected socket</b>.
6435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function initiates the disconnection of a previously connected socket.
6455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocket        A pointer to a phFriNfc_LlcpTransport_Socket_t.
6475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pDisconnect_RspCb  The callback to be called when the
6485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                operation is completed.
6495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext           Upper layer context to be returned in
6505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                the callback.
6515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
6535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
6545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
6555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_PENDING                  Disconnection operation is in progress,
6565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            pDisconnect_RspCb will be called upon completion.
6575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
6585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
6595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_NOT_INITIALISED          Indicates stack is not yet initialized.
6605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SHUTDOWN                 Shutdown in progress.
6615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
6625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
6635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Disconnect(phFriNfc_LlcpTransport_Socket_t*           pLlcpSocket,
6645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                            pphLibNfc_LlcpSocketDisconnectCb_t         pDisconnect_RspCb,
6655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                            void*                                      pContext);
6665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
6675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
6685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
6695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Send data on a socket</b>.
6705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function is used to write data on a socket. This function
6725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* can only be called on a connection-oriented socket which is already
6735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* in a connected state.
6745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  hSocket            Socket handle obtained during socket creation.
6775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psBuffer           The buffer containing the data to send.
6785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pSend_RspCb        The callback to be called when the
6795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                operation is completed.
6805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext           Upper layer context to be returned in
6815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                the callback.
6825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
6835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
6845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
6855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
6865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_PENDING                  Reception operation is in progress,
6875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            pSend_RspCb will be called upon completion.
6885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
6895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
6905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
6915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
6925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Send(phFriNfc_LlcpTransport_Socket_t*             pLlcpSocket,
6935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                      phNfc_sData_t*                               psBuffer,
6945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                      pphFriNfc_LlcpTransportSocketSendCb_t        pSend_RspCb,
6955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                      void*                                        pContext);
6965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
6975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
6985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
6995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Read data on a socket</b>.
7005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function is used to read data from a socket. It reads at most the
7025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* size of the reception buffer, but can also return less bytes if less bytes
7035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* are available. If no data is available, the function will be pending until
7045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* more data comes, and the response will be sent by the callback. This function
7055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* can only be called on a connection-oriented socket.
7065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  hSocket            Socket handle obtained during socket creation.
7095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psBuffer           The buffer receiving the data.
7105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pRecv_RspCb        The callback to be called when the
7115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                operation is completed.
7125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext           Upper layer context to be returned in
7135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                the callback.
7145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
7165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
7175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
7185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_PENDING                  Reception operation is in progress,
7195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            pRecv_RspCb will be called upon completion.
7205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
7215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
7225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
7235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
7245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_Recv( phFriNfc_LlcpTransport_Socket_t*             pLlcpSocket,
7255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                       phNfc_sData_t*                               psBuffer,
7265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                       pphFriNfc_LlcpTransportSocketRecvCb_t        pRecv_RspCb,
7275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                       void*                                        pContext);
7285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
7295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
7305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
7315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /**
7325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_lib_nfc
7335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Read data on a socket and get the source SAP</b>.
7345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function is the same as phLibNfc_Llcp_Recv, except that the callback includes
7365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* the source SAP. This functions can only be called on a connectionless socket.
7375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocket        A pointer to a LlcpSocket created.
7405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psBuffer           The buffer receiving the data.
7415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pRecv_RspCb        The callback to be called when the
7425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                operation is completed.
7435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext           Upper layer context to be returned in
7445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                the callback.
7455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
7475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
7485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
7495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_PENDING                  Reception operation is in progress,
7505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            pRecv_RspCb will be called upon completion.
7515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
7525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
7535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_NOT_INITIALISED          Indicates stack is not yet initialized.
7545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SHUTDOWN                 Shutdown in progress.
7555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
7565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
7575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_RecvFrom( phFriNfc_LlcpTransport_Socket_t                   *pLlcpSocket,
7585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                           phNfc_sData_t*                                    psBuffer,
7595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                           pphFriNfc_LlcpTransportSocketRecvFromCb_t         pRecv_Cb,
7605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                           void                                              *pContext);
7615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
7625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
7635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \ingroup grp_fri_nfc
7645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \brief <b>Send data on a socket to a given destination SAP</b>.
7655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function is used to write data on a socket to a given destination SAP.
7675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* This function can only be called on a connectionless socket.
7685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pLlcpSocket        A pointer to a LlcpSocket created.
7715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  nSap               The destination SAP.
7725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  psBuffer           The buffer containing the data to send.
7735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pSend_RspCb        The callback to be called when the
7745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                operation is completed.
7755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \param[in]  pContext           Upper layer context to be returned in
7765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                the callback.
7775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*
7785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SUCCESS                  Operation successful.
7795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_PARAMETER        One or more of the supplied parameters
7805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            could not be properly interpreted.
7815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_PENDING                  Reception operation is in progress,
7825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            pSend_RspCb will be called upon completion.
7835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_INVALID_STATE            The socket is not in a valid state, or not of
7845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*                                            a valid type to perform the requsted operation.
7855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_NOT_INITIALISED          Indicates stack is not yet initialized.
7865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_SHUTDOWN                 Shutdown in progress.
7875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly* \retval NFCSTATUS_FAILED                   Operation failed.
7885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly*/
7895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_LlcpTransport_SendTo( phFriNfc_LlcpTransport_Socket_t             *pLlcpSocket,
7905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                         uint8_t                                     nSap,
7915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                         phNfc_sData_t*                              psBuffer,
7925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                         pphFriNfc_LlcpTransportSocketSendCb_t       pSend_RspCb,
7935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                         void*                                       pContext);
794c2866714540bec65af19240e95a10d3090df0cf9Sylvain Fonteneau#endif  /*  PHFRINFC_LLCP_TRANSPORT_H    */
795