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

How to add device_manager in existing ble_app_uart code?

Hello, I am using sdk 11 and I am refering to code ble_app_uart. I am using nrf51 and I want to add passkey to this code. So do this I added

   // Add static pin:
uint8_t passkey[] = STATIC_PASSKEY;
ble_opt.gap_opt.passkey.p_passkey = passkey;
err_code =  sd_ble_opt_set(BLE_GAP_OPT_PASSKEY, &ble_opt);
APP_ERROR_CHECK(err_code);

Now I want to add

static void device_manager_init(void) { uint32_t err_code; dm_init_param_t init_data; dm_application_param_t register_param;

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

// Clear all bonded centrals if the Bonds Delete button is pushed.
init_data.clear_persistent_data = 0;// (nrf_gpio_pin_read(BOND_DELETE_ALL_BUTTON_ID) == 0);

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

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

register_param.sec_param.timeout      = SEC_PARAM_TIMEOUT;
register_param.sec_param.bond         = SEC_PARAM_BOND;
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;

// Using static pin:
register_param.sec_param.mitm    = SEC_PARAM_MITM;
register_param.sec_param.io_caps = SEC_PARAM_IO_CAPABILITIES;

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

}

So I am trying to add device_manager files from components. When I compiled I am getting error like ............\components\ble\device_manager\device_manager.h(72): error: #5: cannot open source input file "device_manager_cnfg.h": No such file or directory

My new file is ble_app_main.txt

Thanks

Parents
  • Hi,

    Make sure that you have added the relevant files to the Keil project. This is done by right clicking on a project folder in the project window, and clicking on "Add existing files to Group". You also need to include the path for the files added; Options for Target->C/C++->Include Paths. In SDK 11 the device_manager_cnfg.h should be placed in the project config folder: SDK_FOLDER\examples\ble_peripheral\ble_app_uart\config. Take a look at e.g. the ble_app_hrs project to see how the config file is configured.

  • Hello Sigurd, I am following your suggestions and I am referring the code ble_app_hrs and ble_app_gls. I am editing the code ble_app_hrs. Now I want that my app should prompt the static passkey entry before connection. To do this I have made changes by referring ble_app_gls. I am attaching my txt file above in question. Thanks, Shailav

Reply
  • Hello Sigurd, I am following your suggestions and I am referring the code ble_app_hrs and ble_app_gls. I am editing the code ble_app_hrs. Now I want that my app should prompt the static passkey entry before connection. To do this I have made changes by referring ble_app_gls. I am attaching my txt file above in question. Thanks, Shailav

Children
No Data
Related