This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Discovery service dosen't work always

When I keep this function :

static void vMain_iInitDeviceManager_Exe(bool erase_bonds)
{
    uint32_t               err_code;
    dm_init_param_t        init_param = {.clear_persistent_data = erase_bonds};
    dm_application_param_t register_param;

// Initialize persistent storage module.
err_code = pstorage_init();
APP_ERROR_CHECK(err_code);

err_code = dm_init(&init_param);
APP_ERROR_CHECK(err_code);

memset(&register_param.sec_param, 0, sizeof(ble_gap_sec_params_t));

register_param.sec_param.bond         = SEC_PARAM_BOND;
register_param.sec_param.mitm         = SEC_PARAM_MITM;
register_param.sec_param.lesc         = SEC_PARAM_LESC;
register_param.sec_param.keypress     = SEC_PARAM_KEYPRESS;
register_param.sec_param.io_caps      = SEC_PARAM_IO_CAPABILITIES;
register_param.sec_param.oob          = SEC_PARAM_OOB;
register_param.sec_param.min_key_size = SEC_PARAM_MIN_KEY_SIZE;
register_param.sec_param.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
register_param.evt_handler            = device_manager_evt_handler;
register_param.service_type           = DM_PROTOCOL_CNTXT_GATT_SRVR_ID;

err_code = dm_register(&m_app_handle, &register_param);
APP_ERROR_CHECK(err_code);
}

the discovery service works, if not it dosen't work.

SDK11 , hrs_app image description

Parents
  • Thanks for your help, All I did to avoid this problem is to added

    				case BLE_GATTS_EVT_SYS_ATTR_MISSING:
    					// No system attributes have been stored.
    					sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
    			 
    			break;
    

    to the function :

    static void on_ble_evt(ble_evt_t * p_ble_evt)
    

    and now it is ok.

    another question, if you can help, is the data manager mandatory for the DFU ?

Reply
  • Thanks for your help, All I did to avoid this problem is to added

    				case BLE_GATTS_EVT_SYS_ATTR_MISSING:
    					// No system attributes have been stored.
    					sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
    			 
    			break;
    

    to the function :

    static void on_ble_evt(ble_evt_t * p_ble_evt)
    

    and now it is ok.

    another question, if you can help, is the data manager mandatory for the DFU ?

Children
No Data
Related