NFC ZigBee 3.0 Modules and Libraries: nfc_nwk.h Source File

NFC ZigBee 3.0

NFC ZigBee 3.0 Modules and Libraries
NFC Commissioning using ZigBee Installation Codes
nfc_nwk.h
Go to the documentation of this file.
1 /*****************************************************************************
2  *
3  * MODULE: NFC
4  *
5  * COMPONENT: nfc_nwk.h
6  *
7  * AUTHOR: Martin Looker
8  *
9  * DESCRIPTION: Common macros used by all NFC NWK NDEF processing
10  *
11  * $HeadURL: https://www.collabnet.nxp.com/svn/lprf_sware/Projects/Components/NFC/Tags/+v1000/Include/nfc_nwk.h $
12  *
13  * $Revision: 83780 $
14  *
15  * $LastChangedBy: nxp29761 $
16  *
17  * $LastChangedDate: 2016-10-04 09:44:13 +0100 (Tue, 04 Oct 2016) $
18  *
19  * $Id: nfc_nwk.h 83780 2016-10-04 08:44:13Z nxp29761 $
20  *
21  ****************************************************************************
22  *
23  * This software is owned by NXP B.V. and/or its supplier and is protected
24  * under applicable copyright laws. All rights are reserved. We grant You,
25  * and any third parties, a license to use this software solely and
26  * exclusively on NXP products [NXP Microcontrollers such as JN5168, JN5179].
27  * You, and any third parties must reproduce the copyright and warranty notice
28  * and any other legend of ownership on each copy or partial copy of the
29  * software.
30  *
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
33  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
34  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
35  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
36  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
37  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
38  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
39  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGE.
42  *
43  * Copyright NXP B.V. 2016. All rights reserved
44  *
45  ***************************************************************************/
52 #ifndef NFC_NWK_H_
53 #define NFC_NWK_H_
54 
55 /****************************************************************************/
56 /*** Include Files ***/
57 /****************************************************************************/
58 #include <jendefs.h>
59 
60 /****************************************************************************/
61 /*** Macro Definitions ***/
62 /****************************************************************************/
63 /* Version */
64 #define NFC_NWK_PAYLOAD_VERSION 13
65 /* Key size */
66 #define NFC_NWK_PAYLOAD_KEY_SIZE 16
67 #define NFC_NWK_PAYLOAD_MIC_SIZE 4
68 /* NFC_NWK generic commands */
69 #define NFC_NWK_CMD_NONE 0x00
70 /* NFC_NWK NTAG commands */
71 #define NFC_NWK_NTAG_CMD_JOIN_WITH_CODE 0x41
72 /* NFC_NWK NCI commands */
73 #define NFC_NWK_NCI_CMD_FACTORY_RESET 0xA0
74 #define NFC_NWK_NCI_CMD_JOIN_WITH_CODE 0xA1
76 /****************************************************************************/
77 /*** Type Definitions ***/
78 /****************************************************************************/
79 #pragma GCC diagnostic ignored "-Wpacked"
80 #pragma GCC diagnostic ignored "-Wattributes"
81 
83 typedef struct
84 {
85  uint8 u8Version;
86  uint8 u8Command;
87  uint8 u8Sequence;
88  uint16 u16DeviceId;
89  uint64 u64ExtAddress;
90  uint16 u16ShortAddress;
91  uint8 u8Channel;
92  uint16 u16PanId;
93  uint64 u64ExtPanId;
94  uint8 au8Key[NFC_NWK_PAYLOAD_KEY_SIZE];
95  uint16 u16Crc;
96 } PACK tsNfcNwkNtag;
97 
99 typedef struct
100 {
101  uint8 u8Command;
102  uint8 u8Sequence;
103  uint16 u16DeviceId;
104  uint64 u64ExtAddress;
106  uint8 u8Channel;
107  uint16 u16PanId;
108  uint64 u64ExtPanId;
109  uint8 au8Key[NFC_NWK_PAYLOAD_KEY_SIZE];
110  uint8 au8Mic[NFC_NWK_PAYLOAD_MIC_SIZE];
111  uint8 u8KeySeqNum;
112 } PACK tsNfcNwkNci;
113 
115 typedef struct
116 {
119 } PACK tsNfcNwkPayload;
120 
122 typedef struct
123 {
124  uint8 au8Key[NFC_NWK_PAYLOAD_KEY_SIZE];
125  uint16 u16Crc;
126 } PACK tsNfcNwkInstallCode;
127 
128 #pragma GCC diagnostic pop
129 
130 /****************************************************************************/
131 /*** Exported Functions ***/
132 /****************************************************************************/
133 
134 /****************************************************************************/
135 /*** Exported Variables ***/
136 /****************************************************************************/
137 
138 #endif /* NFC_NWK_H_ */
139 /****************************************************************************/
140 /*** END OF FILE ***/
141 /****************************************************************************/
Definition: nfc_nwk.h:99
tsNfcNwkNci sNci
Definition: nfc_nwk.h:118
uint64 u64ExtAddress
Definition: nfc_nwk.h:89
uint16 u16PanId
Definition: nfc_nwk.h:92
uint16 u16DeviceId
Definition: nfc_nwk.h:88
uint64 u64ExtPanId
Definition: nfc_nwk.h:93
#define NFC_NWK_PAYLOAD_KEY_SIZE
Definition: nfc_nwk.h:66
uint8 u8Version
Definition: nfc_nwk.h:85
Definition: nfc_nwk.h:122
uint8 u8Sequence
Definition: nfc_nwk.h:87
tsNfcNwkNtag sNtag
Definition: nfc_nwk.h:117
Definition: nfc_nwk.h:115
uint8 u8Channel
Definition: nfc_nwk.h:91
uint16 u16Crc
Definition: nfc_nwk.h:95
uint16 u16ShortAddress
Definition: nfc_nwk.h:90
uint8 u8Command
Definition: nfc_nwk.h:86
Definition: nfc_nwk.h:83
#define NFC_NWK_PAYLOAD_MIC_SIZE
Definition: nfc_nwk.h:67
uint8 u8KeySeqNum
Definition: nfc_nwk.h:111
Generated by   doxygen 1.8.13