Contiki-NG
Files | Functions
CC13xx/CC26xx IEEE Address Control

Driver for the retrieval of an IEEE address from flash. More...

Files

 
 

Functions

int ieee_addr_cpy_to (uint8_t *dst, uint8_t len)
 Copy the device's IEEE address to a destination buffer. More...
 

Detailed Description

Driver for the retrieval of an IEEE address from flash.

The user can specify a hardcoded IEEE address through the IEEE_ADDR_CONF_HARDCODED configuration macro.

If the user does not hard-code an address, then one will be read from either the primary location (InfoPage) or from the secondary location (on flash).

In order to allow the user to easily program nodes with addresses, the secondary location is given priority: If it contains a valid address then it will be chosen in favour of the one on InfoPage.

In this context, an address is valid if at least one of the 8 bytes does not equal 0xFF. If all 8 bytes are 0xFF, then the primary location will be used.

In all cases, the address is assumed to be written little-endian.

Lastly, it is possible to override the 2 LSB's of the address by using the NODE_ID make variable.

Function Documentation

◆ ieee_addr_cpy_to()

int ieee_addr_cpy_to ( uint8_t *  dst,
uint8_t  len 
)

Copy the device's IEEE address to a destination buffer.

Parameters
dstA pointer to the destination area where the IEEE address is to be written.
lenThe number of bytes to write to destination area
Returns
0 : Returned successfully -1 : Returned with error

This function will copy len bytes in LSB and it will invert byte order in the process. The factory address on devices is normally little-endian, therefore you should expect dst to store the address in a big-endian order.

Definition at line 60 of file ieee-addr.c.