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_Llcp.h
195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief NFC LLCP core
205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Project: NFC-FRI
225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PHFRINFC_LLCP_H
265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_H
275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*include files*/
295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phNfcTypes.h>
305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phNfcLlcpTypes.h>
315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phNfcStatus.h>
325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phFriNfc.h>
335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phFriNfc_LlcpMac.h>
355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name NFC Forum Logical Link Control Protocol
385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * File: \ref phFriNfc_Llcp.h
405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** \defgroup grp_fri_nfc_llcp NFC Forum Logical Link Control Protocol Component
455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *  TODO
475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*=========== DEBUG MACROS ===========*/
515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* LLCP TRACE Macros */
535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#if defined(LLCP_TRACE)
545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phOsalNfc.h>
555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <stdio.h>
565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellyextern char phOsalNfc_DbgTraceBuffer[];
575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define LLCP_MAX_TRACE_BUFFER   150
585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define LLCP_PRINT( str )  phOsalNfc_DbgString(str)
595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define LLCP_DEBUG(str, arg) \
605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   {                                                                    \
615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      snprintf(phOsalNfc_DbgTraceBuffer,LLCP_MAX_TRACE_BUFFER,str,arg); \
625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);                    \
635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   }
645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define LLCP_PRINT_BUFFER(msg,buf,len) \
655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   {                                                                             \
665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      snprintf(phOsalNfc_DbgTraceBuffer,LLCP_MAX_TRACE_BUFFER,"\n\t %s:",msg);   \
675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      phOsalNfc_DbgString(phOsalNfc_DbgTraceBuffer);                             \
685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      phOsalNfc_DbgTrace(buf,len);                                               \
695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly      phOsalNfc_DbgString("\r");                                                 \
705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   }
715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#else
725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define LLCP_PRINT( str )
735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define LLCP_DEBUG(str, arg)
745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define LLCP_PRINT_BUFFER(msg,buf,len)
755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif
765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*=========== CONSTANTS ===========*/
795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *  \name LLCP local protocol version.
825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /*@{*/
855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_VERSION_MAJOR   0x01  /**< Major number of local LLCP version.*/
867b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_VERSION_MINOR   0x01  /**< Minor number of local LLCP version.*/
875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_VERSION         ((PHFRINFC_LLCP_VERSION_MAJOR << 4) | PHFRINFC_LLCP_VERSION_MINOR) /**< Local LLCP version.*/
885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/
895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *  \name LLCP packet types.
925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /*@{*/
955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_SYMM       0x00 /**< Symmetry.*/
965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_PAX        0x01 /**< PArameter Exchange.*/
975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_AGF        0x02 /**< AGgregated Frame.*/
985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_UI         0x03 /**< Unnumbered Information.*/
995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_CONNECT    0x04 /**< Connect.*/
1007b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_PTYPE_DISC       0x05 /**< Disconnect.*/
1015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_CC         0x06 /**< Connection Complete.*/
1025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_DM         0x07 /**< Disconnected Mode.*/
1035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_FRMR       0x08 /**< FRaMe Reject.*/
1047b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_PTYPE_SNL        0x09 /**< Service Name Lookup.*/
1057b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_PTYPE_RESERVED1  0x0A /**< Reserved.*/
1067b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_PTYPE_RESERVED2  0x0B /**< Reserved.*/
1075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_I          0x0C /**< Information.*/
1085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_RR         0x0D /**< Receive Ready.*/
1095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PTYPE_RNR        0x0E /**< Receive Not Ready.*/
1107b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_PTYPE_RESERVED3  0x0F /**< Reserved.*/
1115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/
1125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *  \name LLCP well-known SAPs.
1155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
1165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
1175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /*@{*/
1185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_SAP_LINK                     0x00 /**< Link SAP.*/
1195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_SAP_SDP                      0x01 /**< Service Discovery Protocol SAP.*/
1203a9d18ff42ce17d62e1968ed93358d036989b670Sylvain Fonteneau#define PHFRINFC_LLCP_SAP_WKS_FIRST                0x02 /**< Other Well-Known Services defined by the NFC Forum.*/
1215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_SAP_SDP_ADVERTISED_FIRST     0x10 /**< First SAP number from SDP-avertised SAP range.*/
1225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_SAP_SDP_UNADVERTISED_FIRST   0x20 /**< First SAP number from SDP-unavertised SAP range.*/
123651794422f331be5865ed8afcab6a56e3abe7521Sylvain Fonteneau#define PHFRINFC_LLCP_SAP_NUMBER                   0x40 /**< Number of possible SAP values (also first invalid value).*/
1245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_SAP_DEFAULT                  0xFF /**< Default number when a socket is created or reset */
1257b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_SDP_ADVERTISED_NB            0x10 /**< Number of SDP advertised SAP slots */
1267b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi/*@}*/
1277b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi
1287b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi/**
1297b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi *  \name LLCP well-known SAPs.
1307b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi *
1317b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi */
1327b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi /*@{*/
1337b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_SERVICENAME_SDP              "urn:nfc:sn:sdp" /**< Service Discovery Protocol name.*/
1345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/
1355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *  \name Length value for DM opCode
1385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
1395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
1405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /*@{*/
1415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_DM_LENGTH                    0x01 /**< Length value for DM opCode */
1425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/
1435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \internal
1475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name Masks used with parameters value.
1485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
1495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
1505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/
1515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_MIUX_MASK                 0x07FF   /**< \internal Mask to apply to MIUX TLV Value.*/
1525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_WKS_MASK                  0x0001   /**< \internal Minimal bits to be set in WKS TLV Value.*/
1535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_RW_MASK                   0x0F     /**< \internal Mask to apply to RW TLV Value.*/
1545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_OPT_MASK                  0x03     /**< \internal Mask to apply to OPT TLV Value.*/
1555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/
1565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \internal
1595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name Type codes for parameters in TLV.
1605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
1615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
1625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/
1635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_TYPE_VERSION               0x01   /**< \internal VERSION parameter Type code.*/
1645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_TYPE_MIUX                  0x02   /**< \internal MIUX parameter Type code.*/
1655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_TYPE_WKS                   0x03   /**< \internal WKS parameter Type code.*/
1665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_TYPE_LTO                   0x04   /**< \internal LTO parameter Type code.*/
1675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_TYPE_RW                    0x05   /**< \internal RW parameter Type code.*/
1685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_TYPE_SN                    0x06   /**< \internal SN parameter Type code.*/
1695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_TYPE_OPT                   0x07   /**< \internal OPT parameter Type code.*/
1707b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_TLV_TYPE_SDREQ                 0x08   /**< \internal SDREQ parameter Type code.*/
1717b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_TLV_TYPE_SDRES                 0x09   /**< \internal SDRES parameter Type code.*/
1725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/
1735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \internal
1765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name Fixed Value length for parameters in TLV.
1775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
1785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
1795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/
1805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_LENGTH_HEADER              2   /**< \internal Fixed length of Type and Length fields in TLV.*/
1815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_LENGTH_VERSION             1   /**< \internal Fixed length of VERSION parameter Value.*/
1825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_LENGTH_MIUX                2   /**< \internal Fixed length of MIUX parameter Value.*/
1835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_LENGTH_WKS                 2   /**< \internal Fixed length of WKS parameter Value.*/
1845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_LENGTH_LTO                 1   /**< \internal Fixed length of LTO parameter Value.*/
1855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_LENGTH_RW                  1   /**< \internal Fixed length of RW parameter Value.*/
1865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_TLV_LENGTH_OPT                 1   /**< \internal Fixed length of OPT parameter Value.*/
1875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/
1885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
1895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/**
1905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *  \name LLCP packet field sizes.
1915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly *
1925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
1935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /*@{*/
1945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PACKET_HEADER_SIZE     2 /**< Size of the general packet header (DSAP+PTYPE+SSAP).*/
1955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PACKET_SEQUENCE_SIZE   1 /**< Size of the sequence field, if present.*/
1965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_PACKET_MAX_SIZE        (PHFRINFC_LLCP_PACKET_HEADER_SIZE + \
1975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                             PHFRINFC_LLCP_PACKET_SEQUENCE_SIZE + \
1985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                             PHFRINFC_LLCP_MIU_DEFAULT + \
1995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                             PHFRINFC_LLCP_TLV_MIUX_MASK) /**< Maximum size of a packet */
2005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/
2015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2028608ad938da280b895e3bb71435d6fe34c589219Sylvain Fonteneau/*========== MACROS ===========*/
2038608ad938da280b895e3bb71435d6fe34c589219Sylvain Fonteneau
2048608ad938da280b895e3bb71435d6fe34c589219Sylvain Fonteneau#define CHECK_SEND_RW(socket) ( (((socket)->socket_VS - (socket)->socket_VSA)  % 16) < (socket)->remoteRW )
2055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== ENUMERATES ===========*/
2075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef phFriNfc_LlcpMac_ePeerType_t      phFriNfc_Llcp_eRole_t;
2095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef phFriNfc_LlcpMac_eLinkStatus_t    phFriNfc_Llcp_eLinkStatus_t;
2115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== CALLBACKS ===========*/
2135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*phFriNfc_Llcp_Check_CB_t) (
2155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                             *pContext,
2165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   NFCSTATUS                        status
2175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly);
2185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*phFriNfc_Llcp_LinkStatus_CB_t) (
2205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                             *pContext,
2215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_eLinkStatus_t      eLinkStatus
2225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly);
2235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2247c4b4fadb66959c50c170182847886e83393eebfMartijn Coenentypedef void (*phFriNfc_Llcp_LinkSend_CB_t) (
2257c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen   void                             *pContext,
2267c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen   uint8_t                          socketIndex,
2277c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen   NFCSTATUS                        status
2287c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen);
2297c4b4fadb66959c50c170182847886e83393eebfMartijn Coenen
2305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*phFriNfc_Llcp_Send_CB_t) (
2315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                             *pContext,
2325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   NFCSTATUS                        status
2335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly);
2345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef void (*phFriNfc_Llcp_Recv_CB_t) (
2365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                             *pContext,
2375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t                    *psData,
2385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   NFCSTATUS                        status
2395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly);
2405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== STRUCTURES ===========*/
2425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Llcp_sPacketHeader
2445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
2455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< The destination service access point*/
2465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   unsigned   dsap : 6;
2475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< The packet type*/
2495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   unsigned   ptype : 4;
2505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< The source service access point*/
2525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   unsigned   ssap : 6;
2535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly} phFriNfc_Llcp_sPacketHeader_t;
2555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Llcp_sPacketSequence
2575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
2585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   unsigned   ns : 4;
2605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for reception*/
2625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   unsigned   nr : 4;
2635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly} phFriNfc_Llcp_sPacketSequence_t;
2655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Llcp_sSendOperation
2675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
2685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sPacketHeader_t    *psHeader;
2705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sPacketSequence_t  *psSequence;
2735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t                    *psInfo;
2765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_Send_CB_t          pfSend_CB;
2795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                             *pContext;
2825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly} phFriNfc_Llcp_sSendOperation_t;
2845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Llcp_sRecvOperation
2865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
2875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                    nSap;
2895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t              *psBuffer;
2925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_Recv_CB_t    pfRecv_CB;
2955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Sequence number for sending*/
2975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                       *pContext;
2985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
2995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly} phFriNfc_Llcp_sRecvOperation_t;
3005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Llcp
3025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{
3035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< The current state*/
3045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                          state;
3055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< MAC mapping instance*/
3075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_LlcpMac_t               MAC;
3085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Local LLC role*/
31034ff48f6cd6595a899e05fbd56f4c84891840d3fNick Pelly   phFriNfc_LlcpMac_ePeerType_t         eRole;
3115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Local link parameters*/
3135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sLinkParameters_t  sLocalParams;
3145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Remote link parameters*/
3165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sLinkParameters_t  sRemoteParams;
3175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Negociated protocol version (major number on MSB, minor on LSB)*/
3195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                          version;
3205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Internal reception buffer, its size may vary during time but not exceed nRxBufferSize*/
3225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t                   sRxBuffer;
3235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Actual size of reception buffer*/
3255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint16_t                        nRxBufferLength;
3265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Internal emission buffer, its size may vary during time but not exceed nTxBufferSize*/
3285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t                   sTxBuffer;
3295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Actual size of emission buffer*/
3315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint16_t                        nTxBufferLength;
3325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Callback function for link status notification*/
3345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_LinkStatus_CB_t    pfLink_CB;
3355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Callback context for link status notification*/
3375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                             *pLinkContext;
3385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Callback function for compliance checking*/
3405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_Check_CB_t         pfChk_CB;
3415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Callback context for compliance checking*/
3435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                             *pChkContext;
3445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Symmetry timer*/
3465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint32_t                         hSymmTimer;
3475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Control frames buffer*/
3495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                          pCtrlTxBuffer[10];
3505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Control frames buffer size*/
3525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                          pCtrlTxBufferLength;
3535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< DISC packet send pending flag*/
3555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                           bDiscPendingFlag;
3565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< FRMR packet send pending flag*/
3585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   bool_t                           bFrmrPendingFlag;
3595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Header of pending FRMR packet*/
3615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sPacketHeader_t    sFrmrHeader;
3625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Info field of pending FRMR packet*/
3645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   uint8_t                          pFrmrInfo[4];
3655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Send callback*/
3675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_Send_CB_t          pfSendCB;
3685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Send callback*/
3705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                             *pSendContext;
3715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Pending send header*/
3735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sPacketHeader_t    *psSendHeader;
3745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Pending send sequence*/
3765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_sPacketSequence_t  *psSendSequence;
3775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Pending send info*/
3795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phNfc_sData_t                    *psSendInfo;
3805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Receive callback*/
3825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   phFriNfc_Llcp_Recv_CB_t          pfRecvCB;
3835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   /**< Receive callback*/
3855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly   void                             *pRecvContext;
3865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly} phFriNfc_Llcp_t;
3885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== UNIONS ===========*/
3905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== FUNCTIONS ===========*/
3935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
3945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
3955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief TODO
3965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
3975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_Llcp_EncodeLinkParams( phNfc_sData_t                   *psRawBuffer,
3985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                          phFriNfc_Llcp_sLinkParameters_t *psLinkParams,
3995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                          uint8_t                         nVersion );
4005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
4035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief TODO
4045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
4055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_Llcp_Reset( phFriNfc_Llcp_t                 *Llcp,
4065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                               void                            *LowerDevice,
4075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                               phFriNfc_Llcp_sLinkParameters_t *psLinkParams,
4085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                               void                            *pRxBuffer,
4095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                               uint16_t                        nRxBufferLength,
4105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                               void                            *pTxBuffer,
4115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                               uint16_t                        nTxBufferLength,
4125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                               phFriNfc_Llcp_LinkStatus_CB_t   pfLink_CB,
4135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                               void                            *pContext );
4145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
4165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief TODO
4175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
4185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_Llcp_ChkLlcp( phFriNfc_Llcp_t               *Llcp,
4195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                 phHal_sRemoteDevInformation_t *psRemoteDevInfo,
4205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                 phFriNfc_Llcp_Check_CB_t      pfCheck_CB,
4215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                 void                          *pContext );
4225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
4245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief TODO
4255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
4265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_Llcp_Activate( phFriNfc_Llcp_t  *Llcp );
4275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
4295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief TODO
4305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
4315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_Llcp_Deactivate( phFriNfc_Llcp_t *Llcp );
4325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
4345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief TODO
4355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
4365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_Llcp_GetLocalInfo( phFriNfc_Llcp_t                   *Llcp,
4375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                      phFriNfc_Llcp_sLinkParameters_t   *pParams );
4385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
4405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief TODO
4415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
4425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_Llcp_GetRemoteInfo( phFriNfc_Llcp_t                  *Llcp,
4435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                                       phFriNfc_Llcp_sLinkParameters_t  *pParams );
4445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
4465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief TODO
4475d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
4485d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_Llcp_Send( phFriNfc_Llcp_t                  *Llcp,
4495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                              phFriNfc_Llcp_sPacketHeader_t    *psHeader,
4505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                              phFriNfc_Llcp_sPacketSequence_t  *psSequence,
4515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                              phNfc_sData_t                    *psInfo,
4525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                              phFriNfc_Llcp_Send_CB_t          pfSend_CB,
4535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                              void                             *pContext );
4545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*!
4565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief TODO
4575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */
4585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick PellyNFCSTATUS phFriNfc_Llcp_Recv( phFriNfc_Llcp_t            *Llcp,
4595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                              phFriNfc_Llcp_Recv_CB_t    pfRecv_CB,
4605d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly                              void                       *pContext );
4615d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly
4635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif /* PHFRINFC_LLCP_H */
464