2 * Copyright (C) 2010 NXP Semiconductors
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 * \file phNfcLlcpTypes.h
19 * \brief NFC LLCP public types
26 #ifndef PHNFCLLCPTYPES_H /* */
27 #define PHNFCLLCPTYPES_H /* */
29 #include <phNfcTypes.h>
30 #include <phLibNfcStatus.h>
32 /*=========== CONSTANTS ===========*/
35 * \name LLCP default parameters.
37 * Definitions for use when wanting to use default LLCP parameter values.
41 #define PHFRINFC_LLCP_MIU_DEFAULT 128 /**< Default MIU value (in bytes).*/
42 #define PHFRINFC_LLCP_WKS_DEFAULT 1 /**< Default WKS value (bitfield).*/
43 #define PHFRINFC_LLCP_LTO_DEFAULT 10 /**< Default LTO value (in step of 10ms).*/
44 #define PHFRINFC_LLCP_RW_DEFAULT 1 /**< Default RW value (in frames).*/
45 #define PHFRINFC_LLCP_OPTION_DEFAULT 0 /**< Default OPTION value (in frames).*/
46 #define PHFRINFC_LLCP_MIUX_DEFAULT 0 /**< Default MIUX value (in bytes) */
47 #define PHFRINFC_LLCP_SN_MAX_LENGTH 255 /**< Max length value for the Service Name */
48 #define PHFRINFC_LLCP_RW_MAX 15 /**< Max RW value (in frames).*/
52 * \name LLCP config parameters.
54 * Definitions used for internal LLCP configuration.
58 #define PHFRINFC_LLCP_NB_SOCKET_MAX 10 /**< Max.number of simultaneous sockets */
63 * \name Fixed value for ERROR op code.
67 #define PHFRINFC_LLCP_ERR_DISCONNECTED 0x00
68 #define PHFRINFC_LLCP_ERR_FRAME_REJECTED 0x01
69 #define PHFRINFC_LLCP_ERR_BUSY_CONDITION 0x02
70 #define PHFRINFC_LLCP_ERR_NOT_BUSY_CONDITION 0x03
74 * \name Fixed value for DM op code.
78 #define PHFRINFC_LLCP_DM_OPCODE_DISCONNECTED 0x00
79 #define PHFRINFC_LLCP_DM_OPCODE_SAP_NOT_ACTIVE 0x01
80 #define PHFRINFC_LLCP_DM_OPCODE_SAP_NOT_FOUND 0x02
81 #define PHFRINFC_LLCP_DM_OPCODE_CONNECT_REJECTED 0x03
82 #define PHFRINFC_LLCP_DM_OPCODE_CONNECT_NOT_ACCEPTED 0x20
83 #define PHFRINFC_LLCP_DM_OPCODE_SOCKET_NOT_AVAILABLE 0x21
86 /*========== ENUMERATES ===========*/
88 /* Enum reperesents the different LLCP Link status*/
89 typedef enum phFriNfc_LlcpMac_eLinkStatus
91 phFriNfc_LlcpMac_eLinkDefault,
92 phFriNfc_LlcpMac_eLinkActivated,
93 phFriNfc_LlcpMac_eLinkDeactivated
94 }phFriNfc_LlcpMac_eLinkStatus_t;
96 /* Enum represents the different Socket types */
97 typedef enum phFriNfc_LlcpTransport_eSocketType
99 phFriNfc_LlcpTransport_eDefaultType,
100 phFriNfc_LlcpTransport_eConnectionOriented,
101 phFriNfc_LlcpTransport_eConnectionLess
102 }phFriNfc_LlcpTransport_eSocketType_t;
105 /*========== STRUCTURES ===========*/
107 typedef struct phFriNfc_LlcpTransport_sSocketOptions
109 /** The remote Maximum Information Unit Extension (NOTE: this is MIUX, not MIU !)*/
112 /** The Receive Window size (4 bits)*/
115 }phFriNfc_LlcpTransport_sSocketOptions_t;
117 typedef struct phFriNfc_Llcp_sLinkParameters
119 /** The remote Maximum Information Unit (NOTE: this is MIU, not MIUX !)*/
122 /** The remote Well-Known Services*/
125 /** The remote Link TimeOut (in 1/100s)*/
128 /** The remote options*/
131 } phFriNfc_Llcp_sLinkParameters_t;