Macros | |
#define | ZIGBEE_NRF_LOG_MODULE_NAME zigbee |
Name of the log module related to Zigbee. | |
Enumerations | |
enum | addr_type_t { ADDR_INVALID = 0, ADDR_ANY = 1, ADDR_SHORT = 2, ADDR_LONG = 3 } |
Address type. More... | |
Functions | |
void | zb_osif_get_ieee_eui64 (zb_ieee_addr_t ieee_eui64) |
Read IEEE long address from FICR registers. More... | |
void | zb_osif_wait_for_event (void) |
Function which waits for event – essential implementation of sleep on NRF52. | |
void | zb_osif_go_idle (void) |
Function which tries to sleep down the MCU. More... | |
void | zb_nrf52_periph_disable (void) |
Function which disables all Zigbee stack-related peripherals. More... | |
void | zb_nrf52_periph_enable (void) |
Function which enables back all Zigbee stack-related peripherals. More... | |
zb_uint32_t | zb_osif_sleep (zb_uint32_t sleep_tmo) |
Function which tries to put the device into deep sleep mode, caused by an empty Zigbee stack scheduler queue. More... | |
void | zb_osif_wake_up (void) |
Function which is called after zb_osif_sleep finished and ZBOSS timer is reenabled. More... | |
void | zigbee_erase_persistent_storage (zb_bool_t erase) |
Function for setting the Erase persistent storage, depending on the erase pin. If the erase pin (1.39 by default, defined in zigbee_helpers.c) is shortened to the ground, then the persistent storage is erased. Otherwise, whether the storage is erased is decided upon the input parameter 'erase'. This behaviour is only valid if PCA10056 is used. More... | |
int | to_hex_str (char *p_out, uint16_t out_size, const uint8_t *p_in, uint8_t in_size, bool reverse) |
Function for converting an input buffer to a hex string. More... | |
bool | parse_hex_str (char const *p_in_str, uint8_t in_str_len, uint8_t *p_out_buff, uint8_t out_buff_size, bool reverse) |
Read array of uint8_t from hex string. More... | |
static bool | parse_hex_u8 (char const *s, uint8_t *p_value) |
Parse a hex string to uint8_t. More... | |
static bool | parse_hex_u16 (char const *s, uint16_t *p_value) |
Parse a hex string to uint16_t. More... | |
int | ieee_addr_to_str (char *p_str_buf, uint16_t buf_len, const zb_ieee_addr_t p_in) |
Function for converting 64-bit address to hex string. More... | |
addr_type_t | parse_address (const char *input, zb_addr_u *output, addr_type_t addr_type) |
Function for parsing a null-terminated string of hex characters into 64-bit or 16-bit address. More... | |
static bool | parse_long_address (const char *input, zb_ieee_addr_t addr) |
Function for parsing a null-terminated string of hex characters into a 64-bit address. More... | |
static bool | parse_short_address (const char *input, zb_uint16_t *addr) |
Function for parsing a null-terminated string of hex characters into 16-bit address. More... | |
zb_ret_t | zigbee_default_signal_handler (zb_bufid_t bufid) |
Function for passing signals to the default Zigbee stack event handler. More... | |
void | zigbee_led_status_update (zb_bufid_t bufid, uint32_t led_idx) |
Function for indicating the Zigbee network connection status on LED. If the device is successfully commissioned, the LED is turned on. If the device is not commissioned or has left the network, the LED is turned off. More... | |
void | user_input_indicate (void) |
Function for indicating the default signal handler about user input on the device. If the device is not commissioned, the rejoin procedure is started. More... | |
void | zigbee_power_down_unused_ram (void) |
Function for powering down unused RAM. Powers down all unused sections in RAM banks. | |
enum addr_type_t |
Address type.
int ieee_addr_to_str | ( | char * | p_str_buf, |
uint16_t | buf_len, | ||
const zb_ieee_addr_t | p_in | ||
) |
Function for converting 64-bit address to hex string.
[out] | p_str_buf | Pointer to output buffer. |
[in] | buf_len | Length of the buffer pointed by p_str_buf. |
[in] | p_in | Zigbee IEEE address to be converted to string. |
addr_type_t parse_address | ( | const char * | input, |
zb_addr_u * | output, | ||
addr_type_t | addr_type | ||
) |
Function for parsing a null-terminated string of hex characters into 64-bit or 16-bit address.
The function will skip 0x suffix from input if present.
input | Pointer to the input string string representing the address in big endian. |
output | Pointer to the resulting zb_addr_u variable. |
addr_type | Expected address type. |
bool parse_hex_str | ( | char const * | p_in_str, |
uint8_t | in_str_len, | ||
uint8_t * | p_out_buff, | ||
uint8_t | out_buff_size, | ||
bool | reverse | ||
) |
Read array of uint8_t from hex string.
p_in_str | Pointer to the input hex string. |
in_str_len | Length, in characters, of the input string. |
p_out_buff | Pointer to the output uint8_t array. |
out_buff_size | Size, in bytes, of the output uint8_t array. |
reverse | If true then parse from end to start. |
true | if the conversion succeed |
false | if the conversion failed |
|
inlinestatic |
Parse a hex string to uint16_t.
The function verifies if input is valid, i.e., if all input characters are valid hex digits. If an invalid character is found then function fails.
s | Pointer to input string. |
p_value | Pointer to output value. |
true | if the conversion succeed |
false | if the conversion failed |
|
inlinestatic |
Parse a hex string to uint8_t.
The function verifies if input is valid, i.e., if all input characters are valid hex digits. If an invalid character is found then function fails.
s | Pointer to input string. |
p_value | Pointer to output value. |
true | if the conversion succeed |
false | if the conversion failed |
|
inlinestatic |
Function for parsing a null-terminated string of hex characters into a 64-bit address.
The function will skip 0x suffix from input if present.
input | Pointer to the input string representing the address in big endian. |
addr | Variable where the address will be placed. |
true | if the conversion succeed |
false | if the conversion failed |
|
inlinestatic |
Function for parsing a null-terminated string of hex characters into 16-bit address.
The function will skip 0x suffix from input if present.
input | Pointer to the input string representing the address in big endian. |
addr | Pointer to the a variable where address will be placed. |
true | if the conversion succeed |
false | if the conversion failed |
int to_hex_str | ( | char * | p_out, |
uint16_t | out_size, | ||
const uint8_t * | p_in, | ||
uint8_t | in_size, | ||
bool | reverse | ||
) |
Function for converting an input buffer to a hex string.
[out] | p_out | Pointer to the output buffer. |
[in] | out_size | Size of the output buffer. |
[in] | p_in | Pointer to the input buffer. |
[in] | in_size | Size of the input buffer. |
[in] | reverse | If true, data output happens in the reverse order. |
void user_input_indicate | ( | void | ) |
Function for indicating the default signal handler about user input on the device. If the device is not commissioned, the rejoin procedure is started.
void zb_nrf52_periph_disable | ( | void | ) |
Function which disables all Zigbee stack-related peripherals.
Function is defined as weak; to be redefined if someone wants to implement their own going-to-deep-sleep policy/share resources between Zigbee stack and other components.
void zb_nrf52_periph_enable | ( | void | ) |
Function which enables back all Zigbee stack-related peripherals.
Function is defined as weak; to be redefined if someone wants to implement their own going-to-deep-sleep policy/share resources between Zigbee stack and other components.
void zb_osif_get_ieee_eui64 | ( | zb_ieee_addr_t | ieee_eui64 | ) |
Read IEEE long address from FICR registers.
[out] | ieee_eui64 | Pointer to a long address structure to be filled. |
The 24 oldest bits are filled in by the ZIGBEE_VENDOR_OUI macro and the remainder is taken from the FICR register.
void zb_osif_go_idle | ( | void | ) |
Function which tries to sleep down the MCU.
Function is defined as weak; to be redefined if someone wants to implement their own going-to-sleep policy.
zb_uint32_t zb_osif_sleep | ( | zb_uint32_t | sleep_tmo | ) |
Function which tries to put the device into deep sleep mode, caused by an empty Zigbee stack scheduler queue.
Function is defined as weak; to be redefined if someone wants to implement their own going-to-deep-sleep policy.
void zb_osif_wake_up | ( | void | ) |
Function which is called after zb_osif_sleep finished and ZBOSS timer is reenabled.
Function is defined as weak; to be redefined if someone wants to implement their own going-to-deep-sleep policy/share resources between Zigbee stack and other components.
zb_ret_t zigbee_default_signal_handler | ( | zb_bufid_t | bufid | ) |
Function for passing signals to the default Zigbee stack event handler.
[in] | bufid | Reference to the Zigbee stack buffer used to pass signal. |
void zigbee_erase_persistent_storage | ( | zb_bool_t | erase | ) |
Function for setting the Erase persistent storage, depending on the erase pin. If the erase pin (1.39 by default, defined in zigbee_helpers.c) is shortened to the ground, then the persistent storage is erased. Otherwise, whether the storage is erased is decided upon the input parameter 'erase'. This behaviour is only valid if PCA10056 is used.
[in] | erase | Whether to erase the persistent storage in case the erase pin is not shortened to the ground. |
void zigbee_led_status_update | ( | zb_bufid_t | bufid, |
uint32_t | led_idx | ||
) |
Function for indicating the Zigbee network connection status on LED. If the device is successfully commissioned, the LED is turned on. If the device is not commissioned or has left the network, the LED is turned off.
[in] | bufid | Reference to the Zigbee stack buffer used to pass signal. |
[in] | led_idx | LED index, as defined in the board-specific BSP header. The index starts from 0. |