This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Device Manager (peripheral) SDK6

Hi guys,

i'm just porting my app from SDK5.2+SDv6.0.0 to SDK6.0+SDv7.0.0 and stuck with the device manager. There rises some questions, and i hope someone can help me.

  • what i want just bonding (without saving any context), after initialising (pstorage_init, dm_init and dm_register) and dispatching the (dm_ble_evt_handler(p_ble_evt); the bonding should be working or do i have to call sd_ble_gap_sec_info_reply and sd_ble_gap_sec_params_reply a second time in my application?

  • after a successful bonding of 2 devices, i get a whitelist with addr_count == 2 but if i create it with the given api-function, it returns two identical address of the first bonded device.

  • I saw, there are lot of DebugLog commands in the device_manager. After undefine resp. defining the Macros, what else i have todo to log? Is printf already directed to the UART?

Thanks a lot in advance!

Kind regards, Leo

  • Hi Leo,

    what i want just bonding (without saving any context), after initialising (pstorage_init, dm_init and dm_register) and dispatching the (dm_ble_evt_handler(p_ble_evt); the bonding should be working or do i have to call sd_ble_gap_sec_info_reply and sd_ble_gap_sec_params_reply a second time in my application?

    [Krishna]: You do not need to and should handle sd_ble_gap_sec_info_reply and sd_ble_gap_sec_params_reply anywhere in the application. This should be handled by thedevice manager module. Also, please ensure that 'pstorage_sys_event_handler' is provided with system events. You need to register for system events using the softdevice_sys_evt_handler_set API.

    after a successful bonding of 2 devices, i get a whitelist with addr_count == 2 but if i create it with the given api-function, it returns two identical address of the first bonded device.

    [Krishna]: This is strange. Its is possible to paste your code to create the white list here. I have verified locally for HID Keyboard example that the white list is created as expected with different addresses after disconnect and after power cycle of the device as well. Hence your code will help understand problem you are facing better.

    I saw, there are lot of DebugLog commands in the device_manager. After undefine resp. defining the Macros, what else i have todo to log? Is printf already directed to the UART?

    To enable log, you will have to define ENABLE_DEBUG_LOG_SUPPORT in addition. Also recommend reading documentation on the trace library under 'Debug Logger' in the libraries section.

  • Hi Krishna,

    thanks for your reply. I already read the section "Debug Logger", but i don't know, how to print the Device Manager Logs to UART (printf isn't working).

    Do you have any tips for the bonding-problem? (bonded two devices, MAX_BOND_DEV are 2, whitelist contains 2 address, the two are identical. So if a bond device 1, and then 2 and reconnect device 2, i got the device_id 0). Thanks!

  • Hi Leo,

    For printf, please enable microlib in the project for printf to work. Also UART setting for dev kit are no hardware flow control, baud rate 38400. Ensure this is what you have configured on your terminal.

    For the same device appearing in the bonded device list, it is very strange, and definitely not the expected behavior. Also, I am unable to reproduce the problem here. Hopefully, debug logs will help understand what is happening better. Request you to share the logs.

    Regards, Krishna

  • Hi Krishna, thanks again! i programmed a wrapper with sprintf, and so i was able to produce a log-file. But it seems, that using printf is a cleaner/faster version :) You can find the produced log-file here: devzone.nordicsemi.com/.../ . I additionally printed some extra line (searching for device, and printing new peer-table), but if you need another setup please let me know. Kind regards, Leo

  • Hi Leo,

    Log clearly does not look encouraging. One thing I observe is suspicious search for devices twice on connection. I have no immediate answer on why this happens.

    In order to understand the problem further, I request you to try two things: a. After disconnection of second device, is it possible for you to reset the nrf51 and provide the logs on initialization? b. I see that of two masters connection first one distributes and IRK while the other one does not. Is it possible for you to change the order of the 2 masters connecting..? Meaning, connect first the master that does not distribute IRK and then the one that does. The order should not be a problem, but want to rule this out.

    Thanks!

    Regards, Krishna

Related