Publish:publish 就是 Element 主动发送 status 的过程,可以通过 Config Model
Publication Set 命令配置 publish address,以及设置周期 publish 参数。当配置了 publish
address 后,只要状态发生变化, Node 都会自动执行 publish status 的动作。是否需要周
期发送,就要看周期 publish 的参数。
上电之后通过调用publish_when_powerup推送当前状态
使用 CFG_MODEL_PUB_SET 设置推送地址 , 设备接到之后调用mesh_cmd_sig_cfg_model_pub_set , 但是这个没开源
当配置了publish addr 之后, mesh_pub_period_proc这个函数回周期调用判断是否有addr地址, 有的话就会上报
当设置了publish之后, 设备会定时上报状态 ,使用工具设置pub addr之后,设备回周期上报
也可以调用API,手动发送,API接口分别为
int mesh_g_onoff_st_publish(u8 idx);
int mesh_g_level_st_publish(u8 idx);
int mesh_g_power_st_publish(u8 idx);
int mesh_health_cur_sts_publish(u8 idx);