/** 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);}
元素 | 作用 | 补充说明 |
---|---|---|
forever_flag | 在网时设备是否定时向父节点请求数据 | 如果有网关下发数据给该设备的需求,建议开启,例如单火开关。像门磁等只有状态上报而没有下发交互的设备,可以置为false。 |
fast_swicth_parent | 一般用于forever_flag为false时,快速判断是否与父节点断开连接 | forever_flag为false时,设备发送一组数据请求可能没法感知已经与父节点失联,fast_swicth_parent置为true后,会持续发送数据请求直到感知到已与父节点失联,从而可以快速重连网络。 |
interval_ms | 设置数据请求的发送间隔 | - |
max_failed_times | 发送多少次数据请求没有响应会触发重连 | - |
duration_after_data_ms | 在网发送一次数据后连续的数据请求持续时间 | duration_after_data_ms除以interval_ms是对应的请求次数 |
duration_after_join_ms | 配网成功时连续的数据请求持续时间 | duration_after_join_ms除以interval_ms是对应的请求次数 |
duration_after_rejoin_ms | 重连成功时连续的数据请求持续时间 | duration_after_rejoin_ms除以interval_ms是对应的请求次数 |
power_on_active | 使能与父节点失联状态时,上电主动触发重连机制 | 建议开启 |
send_data_active | 使能与父节点失联状态时,发送数据时触发重连机制 | 建议开启 |
attempts | 与父节点失联状态时,触发重连机制一组发多少次 beacon request | - |
interval | 与父节点失联状态时,触发重连机制一组隔多久发一次 beacon request | - |
该内容对您有帮助吗?
是意见反馈点击获取服务和帮助
智能客服
400-881-8611
提交工单