/** Zigbee poll configuration*/typedef struct {UINT8_T forever_flag; ///< TRUE: forever poll if device no network(TAL_ZG_NWK_POWER_ON_ONLINE/TAL_ZG_NWK_JOIN_OK/TAL_ZG_NWK_REJOIN_OK)UINT8_T fast_swicth_parent; ///< TRUE: if ack isn't received, will continue polling until the max number of failures is reached before switching the parentUINT16_T interval_ms; ///< poll period (bet: ms)UINT16_T max_failed_times; ///< enter parent-lost status when poll failed x times.UINT16_T duration_after_data_ms; ///< tiemout waitting app ack (bet: ms)UINT_T duration_after_join_ms; ///< wakeup time when join success.(for gateway get cluser data) (bet:ms)UINT_T duration_after_rejoin_ms; ///< wakeup time when rejoin success.(for app use) (bet:ms)} TAL_ZG_POLL_CFG_T;
/** Zigbee end-device rejoin config*/typedef struct {UINT8_T power_on_active; ///< auto rejoin when power on.UINT8_T send_data_active; ///< auto rejoin when send data if parent lost.UINT8_T reserved; ///< ReservedUINT8_T attempts; ///< max rejoin attempts when parent lost.UINT16_T interval; ///< rejoin attempt interval when parent lost.} TAL_ZG_REJOIN_CFG_T;
/*** @brief register router or sleep device* @return none*/STATIC VOID_T app_sleep_device_node_init(VOID_T){// sleep end device node initTAL_ZG_NODE_CFG_T node_config = {.node_type = ZG_SLEEPY_END_DEVICE,.tx_power = 10,.scan_interval = 100,.scan_duration = ZG_SCAN_DURATION_3,.config.sleep_ed_cfg.poll_config.forever_flag = 1,.config.sleep_ed_cfg.poll_config.fast_swicth_parent = 1,.config.sleep_ed_cfg.poll_config.interval_ms = 250,.config.sleep_ed_cfg.poll_config.max_failed_times = 10,.config.sleep_ed_cfg.poll_config.duration_after_data_ms = 1000,.config.sleep_ed_cfg.poll_config.duration_after_join_ms = 60000,.config.sleep_ed_cfg.poll_config.duration_after_rejoin_ms = 15000,.config.sleep_ed_cfg.rejoin_config.power_on_active = 1,.config.sleep_ed_cfg.rejoin_config.send_data_active = 1,.config.sleep_ed_cfg.rejoin_config.attempts = 3,.config.sleep_ed_cfg.rejoin_config.interval = 3000,};//config zigbee nodetal_zg_node_config(&node_config);}
Element | Function | Supplementary Explanation |
---|---|---|
forever_flag | Whether the device polls the parent node periodically when connected to the network | If there is a need for the gateway to send data to the device, it is recommended to turn it on, such as for a single-fire switch. For devices like door sensors that only report status and have no interactive commands, it can be set tofalse. |
fast_swicth_parent | Generally used whenforever_flagisfalse, to quickly determine if the connection with the parent node is lost | Whenforever_flagisfalse, the device may not be able to detect that it has lost connection with the parent node after sending a set of data requests. Iffast_swicth_parentis set totrue, it will continue to send data requests until it detects that the connection with the parent node is lost, thus allowing for a quick reconnection to the network. |
interval_ms | Set the interval for sending data requests | - |
max_failed_times | How many times data requests can fail without response before triggering a reconnection | - |
duration_after_data_ms | Continuous data request duration after sending data once while connected | The number of corresponding requests isduration_after_data_msdivided byinterval_ms |
duration_after_join_ms | Continuous data request duration after successful network configuration | The number of corresponding requests isduration_after_join_msdivided byinterval_ms |
duration_after_rejoin_ms | Continuous data request duration after successful reconnection | The number of corresponding requests isduration_after_rejoin_msdivided byinterval_ms |
power_on_active | Enable the active reconnection mechanism when the device is powered on and the parent node is lost | It is recommended to turn it on |
send_data_active | Enable the reconnection mechanism when data is sent and the parent node is lost | It is recommended to turn it on |
attempts | How many beacon requests are sent in one set when the parent node is lost | - |
interval | How long to wait before sending another beacon request in one set when the parent node is lost | - |
Is this page helpful?
YesFeedbackClick for services and help
Consult
(001)844-672-5646
Submit Question