Developing with ZBOSS
Random numbers generator

Macros

#define ZB_RAND_MAX   ((zb_uint16_t)0xffff)
 
#define ZB_RANDOM_VALUE(max_value)   (((zb_uint16_t)(max_value)) ? (zb_random() / (ZB_RAND_MAX / (zb_uint16_t)(max_value))) : 0)
 

Functions

zb_uint16_t zb_random (void)
 

Detailed Description

Macro Definition Documentation

◆ ZB_RAND_MAX

#define ZB_RAND_MAX   ((zb_uint16_t)0xffff)

Maximal possible value for randomly generated (16-bit) value

◆ ZB_RANDOM_VALUE

#define ZB_RANDOM_VALUE (   max_value)    (((zb_uint16_t)(max_value)) ? (zb_random() / (ZB_RAND_MAX / (zb_uint16_t)(max_value))) : 0)

Generate random value between 0 to max_value (16 bit)

Function Documentation

◆ zb_random()

zb_uint16_t zb_random ( void  )

Generate random value

Returns
random value between 0 to 0xffff (16 bit)