we add static pass key in example code hrs with dfu,but when connecting with phone,input passkey on phone,the nrf51822 will rebootdevice_manager_cnfg.h main.c
we add static pass key in example code hrs with dfu,but when connecting with phone,input passkey on phone,the nrf51822 will rebootdevice_manager_cnfg.h main.c
Hi RiverYWang,
in your main.c file you have device_manager_evt_handler and when you have entered a wrong pass key or if the authentication has failed for some other reasons then you do not handle the error. Instead you say that event_result can never fail and if it fails then your default handling is system_reboot in in app_error.c (app_error_handler->NVIC_SystemReset)
So you have to do two things.
you have to handle error AUTH status errors (Search for BLE_GAP_SEC_STATUS) OR remove APP_ERROR_CHECK(event_result); from your main.c device_manager_evt_handler
The default of APP_ERROR_CHECK failures for you seems to be system reset. Please override the error handler in app_error.c so that you handle the errors as you wish rather than system restarts.
Please have a look at this post, to understand better on how error handling works.
Hi RiverYWang,
in your main.c file you have device_manager_evt_handler and when you have entered a wrong pass key or if the authentication has failed for some other reasons then you do not handle the error. Instead you say that event_result can never fail and if it fails then your default handling is system_reboot in in app_error.c (app_error_handler->NVIC_SystemReset)
So you have to do two things.
you have to handle error AUTH status errors (Search for BLE_GAP_SEC_STATUS) OR remove APP_ERROR_CHECK(event_result); from your main.c device_manager_evt_handler
The default of APP_ERROR_CHECK failures for you seems to be system reset. Please override the error handler in app_error.c so that you handle the errors as you wish rather than system restarts.
Please have a look at this post, to understand better on how error handling works.