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

Adding peer manager to ble_app_uart

Hi,

I'm developing with 52840 DK, trying to add peer manager to another project I've modified from ble_app_uart (basically I've added saadc, SPI, USB and I2C module based on original example. Also this project was migrated from 52832 DK to 52840 DK and has been proven working).

As for peer manager example, I referred ble_app_bms from SDK16.

Here are the attempts I've done:

- Copying peer_manager_init(); and its evt_handler() from ble_app_bms. Copying and modifying erase_bonds and advertising_start().

- Adding source files from         ...\components\ble\peer_manager   to nRF_BLE group

- Adding        fds.c     fstorage.c        fstorage_sd.c   to nRF_Libraries group

- Including     fds.h   peer_manager.h   peer_manager_handler.h to main.c

- Enable fds, fstorage, peer_manager module in sdk_config

Now here is my situation,

I could compile the project without error and burned it into 52840DK.

Seems like I could erase existing bonds from flash.

I could connect without bonding(which is not what we want) and it works as usual, but when I manually bond it, connection failed and it shows "invalid pin or passkey, bonding failed" on nrf_connect.

And it LOG shows as follows when bonding failed.

I've been stuck by this problem for weeks. But it just works differently from sample projects.

Which part of it goes wrong.

Your help is appreciated, I could upload my project if necessary.

Parents Reply
  • Hello Avadacadabara,

    Einar is currently out of office, so I will be handling this case from now on.

    Avadacadabara said:

    I am happy to hear that bonding works now!

    Avadacadabara said:
    However bonding window does not pop up automatically, I have to press bond manually.

    I am not sure that I understand what you mean when you say this - do you mean the bonding option in the nRF Connect application for smartphones? Is this option not showing up when you enter into the connection, or is the issue that you have to manually press the bond option that appears?
    In case of the latter, this is likely due to the security requirements of the service provided. If you take a look at the services_init function of the ble_app_hrs you could see where this may be configured. If the central tries to interact with a service that it does not have the required security for, the peripheral will send a security request.

    Best regards,
    Karl

Children
No Data
Related