欢迎你们进群交流分享:QQ群:773082801element
1.Mesh SDK模型,Node节点在重启以后,心跳不能正常保持,即没法在次启动心跳的解决办法:post
缘由:主要是由于相关模型没有从Flash里面读取所致,所以只须要回复保存配置便可。学习
关键代码以下:ui
#if ACCESS_MODEL_PUBLISH_PERIOD_RESTORE static inline void restore_publication_period(access_common_t * p_model) { if (p_model->model_info.publication_period.step_num != 0) { access_publish_period_set(&p_model->publication_state, (access_publish_resolution_t) p_model->model_info.publication_period.step_res, p_model->model_info.publication_period.step_num); } } #endif static inline bool restore_models(void) { bool success; uint32_t restore_count = restore_flash_data(FLASH_GROUP_MODEL, restore_acquired_model, &success); if (success && restore_count > 0) { for (access_model_handle_t i = 0; i < ACCESS_MODEL_COUNT; ++i) { if (m_model_pool[i].model_info.element_index != ACCESS_ELEMENT_INDEX_INVALID) { restore_addresses_for_model(&m_model_pool[i]); #if ACCESS_MODEL_PUBLISH_PERIOD_RESTORE restore_publication_period(&m_model_pool[i]); #endif } } } return success; }
要想使能恢复心跳等模型,只须要使能 ACCESS_MODEL_PUBLISH_PERIOD_RESTORE 宏便可。宏位于文件: nrf_mesh_config_core.hrest
本文章将会对遇到的Mesh SDK遇到的问题,进行长期更新,也欢迎你们有什么问题,留言。blog
欢迎你们进群交流分享:QQ群:773082801element