< div class = "字段field-name-taxonomy-forums field-type-taxonomy-term-reference field-label-above”> < div class = "字段标签" >论坛:,< / div > < div class = "字段条目" > < div class =”field-item甚至“rel = " sioc: has_container " > < a href = " /论坛/ dialog-smartbond-bluetooth-low-energy - % E2 % 80% 93 -软件”“=“sioc:容器sioc:论坛”属性= " rdfs: label skos: prefLabel”数据类型= " " >对话框Smartbond蓝牙低能量-软件< / > < / div > < / div > < / div > < div class =”字段field-name-body field-type-text-with-summary field-label-hidden”> < div class = "字段条目" > < div class =”field-item甚至“财产=“内容:编码”> < p >亲爱的先生们,< br / > sps_host我们有困难的代码(project DA14580_DSPS_3.150.2___13_2_2015). what we're doing is adding some timers that run background tasks and that should survive disconnection. if we leave the code as is, when the disconnection event comes in, the function app_disconnect_func (file app_task.c) resets (see code snippet below) the system state and we never get events anymore: app_reset_app(); // link loss (timer timeout) //reset higher layers
// Reset the environment **this is important because otherwise the profile att database will not be re-initiated**
memset(&app_env, 0, sizeof(app_env));
// Initialize next_prf_init value for first service to add in the database
app_env.next_prf_init = APP_PRF_LIST_START + 1;
if we comment this out the system crashes randomly (hard fault handler) at disconnection or reconnection.
is there any way to reset the app without killing other timers?
also, how tested is the connection/disconnection of the host code? we have the sensation that the same crash may occur also when resetting everything.