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 phNfcLlcpTypes.h 195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \brief NFC LLCP public types 205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Project: NFC-FRI 225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#ifndef PHNFCLLCPTYPES_H /* */ 275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHNFCLLCPTYPES_H /* */ 285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phNfcTypes.h> 305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#include <phLibNfcStatus.h> 315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*=========== CONSTANTS ===========*/ 335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name LLCP default parameters. 365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Definitions for use when wanting to use default LLCP parameter values. 385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 395d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 405d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /*@{*/ 415d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_MIU_DEFAULT 128 /**< Default MIU value (in bytes).*/ 425d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_WKS_DEFAULT 1 /**< Default WKS value (bitfield).*/ 435d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_LTO_DEFAULT 10 /**< Default LTO value (in step of 10ms).*/ 445d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_RW_DEFAULT 1 /**< Default RW value (in frames).*/ 455d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_OPTION_DEFAULT 0 /**< Default OPTION value (in frames).*/ 465d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_MIUX_DEFAULT 0 /**< Default MIUX value (in bytes) */ 474bbf618b661ce7787efab168dd106115268fd539Sunil Jogi#define PHFRINFC_LLCP_MIUX_MAX 0x7FF /**< Max MIUX value (in bytes) */ 484bbf618b661ce7787efab168dd106115268fd539Sunil Jogi#define PHFRINFC_LLCP_PDU_HEADER_MAX 3 /**< Max size of PDU header (in bytes) */ 495d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_SN_MAX_LENGTH 255 /**< Max length value for the Service Name */ 505d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_RW_MAX 15 /**< Max RW value (in frames).*/ 515d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 525d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 535d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 545d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name LLCP config parameters. 555d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 565d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * Definitions used for internal LLCP configuration. 575d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 585d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 595d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /*@{*/ 603002430f96eb9c9f37806404e7dcfc944da383afMartijn Coenen#define PHFRINFC_LLCP_NB_SOCKET_MAX 10 /**< Max.number of simultaneous sockets */ 617b187e70a5f0ffc021cc06a9f1a2bf2c0f8f8767Sunil Jogi#define PHFRINFC_LLCP_SNL_RESPONSE_MAX 256 /**< Max.number of simultaneous discovery requests */ 625d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@}*/ 635d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 645d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 655d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \internal 665d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name Fixed value for ERROR op code. 675d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 685d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 695d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 705d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_ERR_DISCONNECTED 0x00 715d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_ERR_FRAME_REJECTED 0x01 725d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_ERR_BUSY_CONDITION 0x02 735d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_ERR_NOT_BUSY_CONDITION 0x03 745d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 755d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/** 765d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \internal 775d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * \name Fixed value for DM op code. 785d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly * 795d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly */ 805d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*@{*/ 815d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_DM_OPCODE_DISCONNECTED 0x00 825d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_DM_OPCODE_SAP_NOT_ACTIVE 0x01 835d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_DM_OPCODE_SAP_NOT_FOUND 0x02 845d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_DM_OPCODE_CONNECT_REJECTED 0x03 855d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_DM_OPCODE_CONNECT_NOT_ACCEPTED 0x20 865d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#define PHFRINFC_LLCP_DM_OPCODE_SOCKET_NOT_AVAILABLE 0x21 875d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 885d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 895d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== ENUMERATES ===========*/ 905d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 915d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* Enum reperesents the different LLCP Link status*/ 925d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef enum phFriNfc_LlcpMac_eLinkStatus 935d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 945d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_LlcpMac_eLinkDefault, 955d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_LlcpMac_eLinkActivated, 965d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_LlcpMac_eLinkDeactivated 975d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_LlcpMac_eLinkStatus_t; 985d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 995d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* Enum represents the different Socket types */ 1005d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef enum phFriNfc_LlcpTransport_eSocketType 1015d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 1025d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_LlcpTransport_eDefaultType, 1035d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_LlcpTransport_eConnectionOriented, 1045d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly phFriNfc_LlcpTransport_eConnectionLess 1055d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_LlcpTransport_eSocketType_t; 1065d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1075d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1085d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/*========== STRUCTURES ===========*/ 1095d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1105d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_LlcpTransport_sSocketOptions 1115d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 1125d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** The remote Maximum Information Unit Extension (NOTE: this is MIUX, not MIU !)*/ 1135d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t miu; 1145d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1155d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** The Receive Window size (4 bits)*/ 1165d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t rw; 1175d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1185d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly}phFriNfc_LlcpTransport_sSocketOptions_t; 1195d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1205d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pellytypedef struct phFriNfc_Llcp_sLinkParameters 1215d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly{ 1225d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** The remote Maximum Information Unit (NOTE: this is MIU, not MIUX !)*/ 1235d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t miu; 1245d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1255d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** The remote Well-Known Services*/ 1265d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint16_t wks; 1275d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1285d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** The remote Link TimeOut (in 1/100s)*/ 1295d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t lto; 1305d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1315d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly /** The remote options*/ 1325d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly uint8_t option; 1335d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1345d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly} phFriNfc_Llcp_sLinkParameters_t; 1355d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1365d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly#endif 1375d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly 1385d9927ba30ba449badb9f6df0fbeb4d6aedc6e2aNick Pelly/* EOF */ 139