Contiki-NG
|
Files | |
file | ieee-addr.c |
Driver for the CC13xx/CC26xx IEEE addresses. | |
file | ieee-addr.h |
Header file with register and macro declarations for the cc26xx IEEE address driver. | |
Functions | |
void | ieee_addr_cpy_to (uint8_t *dst, uint8_t len) |
Copy the node's IEEE address to a destination memory area. | |
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.
void ieee_addr_cpy_to | ( | uint8_t * | dst, |
uint8_t | len ) |
Copy the node's IEEE address to a destination memory area.
dst | A pointer to the destination area where the IEEE address is to be written |
len | The number of bytes to write to destination area |
This function will copy len LS bytes 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.
< Primary IEEE address location
< Secondary IEEE address location
< Secondary IEEE address location
Definition at line 49 of file ieee-addr.c.
References IEEE_ADDR_CONF_ADDRESS, IEEE_ADDR_CONF_HARDCODED, IEEE_ADDR_LOCATION_PRIMARY, and IEEE_ADDR_LOCATION_SECONDARY.