Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Please suggest nrf52832 example project performing both central and peripheral roles simultaneously or supply sanity check

My use case initially is a single central sensor server powered from the mians and serving by BLE one battery-powered peripheral that has one of the commonly available st7565 SPI LCD panels.  Where I'm uncertain how to proceed is after the initial stage when the sensor server needs to act like a central for the battery powered peripheral and like a peripheral for the various and sundry Android/iOS devices I'm going to be asked to support. I've prototyped an MVP for the initial stage with the familiar NUS|ble_app_uart[_c] examples and I'm happy the one-to-one approach will work using lightly modified examples. Looking forward I seek to minimize the amount of damage I'll have to do to the server side next year and prepare the ground for the server to perform both the central and the peripheral roles.

I'm seeking either a reasonably clear s132-based example project that performs both roles to work from or confirmation that adding the peripheral role to examples/ble_central/ble_app_uart_c is unlikely to turn into a tangled bowl of spaghetti (or be impossible).  All four examples/ble_central_and_peripheral are marked experimental in my SDK(v15), two of them I can't yet build due to the dependency on micro_ecc_lib_nrg52.a and gcc toolchain, causing a bit of anxiety.   In a perfect world there would have been a ble_central_and_peripheral/ble_app_uart_c_and_p project but there isn't so I seek suggestions, advice, insults, etc on either a base project already working for both roles to build on or comfort that it's indeed possible with s132 and use of the uart central as the base project.

Thanks in advance, Howard

Parents
  • Hi,

    I would start by having a look at the Experimental: BLE Relay Example. Even though the example is "experimental" it would still be a good starting point, either for developing your multirole application or just for learning purposes. In any case it would be a good reference.

    Whether or not an approach of starting with a central example and add the peripheral role ends up in a tangled bowl of spaghetti would mostly depend on the person implementing it and how well organized they keep the project underway. Since you expressed the concern I assume that you are cautious enough to avoid that.

    I would probably start with the BLE Relay Example (ble_app_hrs_rscs_relay) and change the services over to NUS rather than starting with one end of NUS and add the other, but I think all starting points would work as long as you use the other examples for reference.

    Regards,
    Terje

Reply
  • Hi,

    I would start by having a look at the Experimental: BLE Relay Example. Even though the example is "experimental" it would still be a good starting point, either for developing your multirole application or just for learning purposes. In any case it would be a good reference.

    Whether or not an approach of starting with a central example and add the peripheral role ends up in a tangled bowl of spaghetti would mostly depend on the person implementing it and how well organized they keep the project underway. Since you expressed the concern I assume that you are cautious enough to avoid that.

    I would probably start with the BLE Relay Example (ble_app_hrs_rscs_relay) and change the services over to NUS rather than starting with one end of NUS and add the other, but I think all starting points would work as long as you use the other examples for reference.

    Regards,
    Terje

Children
Related