NFC ZigBee 3.0 Modules and Libraries: app_nci_icode.h File Reference

NFC ZigBee 3.0

NFC ZigBee 3.0 Modules and Libraries
NFC Commissioning using ZigBee Installation Codes
app_nci_icode.h File Reference

ZigBee 3.0 NCI network commissioning. More...

#include <jendefs.h> #include <nci.h>

Go to the source code of this file.

Macros

#define APP_NCI_ADDRESS   0xFFU
 
#define APP_NCI_I2C_LOCATION   FALSE
 
#define APP_NCI_I2C_FREQUENCY_HZ   100000
 
#define APP_NCI_TICK_MS   5
 
#define APP_NCI_IRQ_PIN   18
 
#define APP_NCI_VEN_PIN   15
 

Functions

PUBLIC void APP_vNciStart (uint8 u8ApplicationEndpoint)
 Starts NCI processing. More...
 
PUBLIC void APP_vNciStop (void)
 Stops the NCI running. More...
 
PUBLIC void APP_cbNciTimer (void *pvParams)
 ZTIMER callback function. More...
 
PUBLIC void APP_cbNciEvent (teNciEvent eNciEvent, uint32 u32Address, uint32 u32Length, uint8 *pu8Data)
 NCI event callback function. More...
 

Detailed Description

ZigBee 3.0 NCI network commissioning.

app_nci_icode.h contains application APIs that can be used to operate an attached NCI (reader) to write ZigBee 3.0 network data into other devices fitted with NTAGs to commission them into a network.

The changes required to add these features to ZigBee 3.0 applications are described in the sections on the individual functions and have already been made to the Coordinator device in the JN-AN-1217 ZigBee 3.0 Application Note. The changes in the source code are all wrapped by #ifdef APP_NCI_ICODE. The NCI functionality is disabled by default in the Coordinator but can be enabled in the makefile or on the command line by setting APP_NCI_ICODE = 1.

Macro Definition Documentation

◆ APP_NCI_ADDRESS

#define APP_NCI_ADDRESS   0xFFU

I2C Address (0xFF for automatic detection)

◆ APP_NCI_I2C_LOCATION

#define APP_NCI_I2C_LOCATION   FALSE

TRUE uses alternate I2C lines (DIO16, 17) instead of (DIO14, 15)

◆ APP_NCI_I2C_FREQUENCY_HZ

#define APP_NCI_I2C_FREQUENCY_HZ   100000

I2C frequency in Hz

◆ APP_NCI_TICK_MS

#define APP_NCI_TICK_MS   5

Interval of tick timer in ms

◆ APP_NCI_IRQ_PIN

#define APP_NCI_IRQ_PIN   18

Sets DIO connected to IRQ pin

◆ APP_NCI_VEN_PIN

#define APP_NCI_VEN_PIN   15

Sets DIO connected to VEN pin

Function Documentation

◆ APP_vNciStart()

PUBLIC void APP_vNciStart ( uint8  u8ApplicationEndpoint)

Starts NCI processing.

This function should be called during initialisation after the call to BDB_vStart().

APP_vNtagStart() starts the u8TimerNci ZTIMER which must be present in the application (usually in app_main.c). This timer runs continuously in order to monitor for and react to NTAGs being placed in the NCI field.

Parameters
u8ApplicationEndpointMain application endpoint, used to determine the Device ID to be written into presented NTAGs

◆ APP_vNciStop()

PUBLIC void APP_vNciStop ( void  )

Stops the NCI running.

This function may be called to abort NCI processing. The current ZigBee 3.0 application notes do not make use of this function.

◆ APP_cbNciTimer()

PUBLIC void APP_cbNciTimer ( void *  pvParams)

ZTIMER callback function.

This is the callback function used by the NCI ZTIMER and drives the processing of NCI data.

Warning
This function should not be called directly by the application code.

If a valid NFC_NWK_NTAG_CMD_JOIN_WITH_CODE command has been read from an NTAG during processing it will initiate one of the following actions depending on the state of the DIO set by the define APP_BUTTONS_BUTTON_1:

  • Input is low (button is down): writes the NFC_NWK_NCI_CMD_FACTORY_RESET command data into the NTAG to intiate a factory reset in the presented device.
  • Input is high (button is up): if the NCI devices is in a network writes the NFC_NWK_NCI_CMD_JOIN_WITH_CODE data into the NTAG to initiate out of band commissioning in the presented device. The installation code and its CRC are zeroed in the NTAG at this point.

◆ APP_cbNciEvent()

PUBLIC void APP_cbNciEvent ( teNciEvent  eNciEvent,
uint32  u32Address,
uint32  u32Length,
uint8 *  pu8Data 
)

NCI event callback function.

This is the callback function used by the NCI library to pass events and data from the NCI to the application.

This function initiates the reading of data from NTAGs when they are presented to the NCI indicated by the E_NCI_EVENT_PRESENT event.

Warning
This function should not be called directly by the application code.
Parameters
eNciEventEvent raised
u32AddressByte address in NTAG of data relating to the event
u32LengthLength of data relating to the event
pu8DataPointer to data relating to the event
Generated by   doxygen 1.8.13