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

how to implement multiple profiles on nrf51822 DK?

Hi Team,

Is it possible to have multiple profiles like serial, heart rate monitor, proximity etc. in single code? What are the efficient ways to do it?

Regards, Milan

  • Yes this is possible. There is nothing special required, just add the services required by the profiles, and make sure that the GAP parameters etc are fulfilled.

    If the profiles are to be supported simultaneously, note that the GAP parameters of the various profiles might not be compatible and could make two special profiles incompatible for simultaneous operation.

    It seems like the nRF51 SDK is not built for these types of operations, but by moving whats usually in the main.c file to a profile-specific file, and adding a "start" - "stop" interface, it should be possible to have a clean solution for both simultaneous and non-simultaneous multi profile applications.

  • Not to my knowledge. My first thought would be to take the typical "main.c" content and move one layer up, so that you would get "profile_hrs.c" and "profile_xxx.c". After implementing the typical "init", "start", "stop" functions for these profiles you should do all initialization for the shared resources in "main.c". Most importantly, all direct softdevice invokation/handling should take place here.

    By forwarding all softdevice events to all profiles (which again forwards them to their respective services) you should be able to have to GAP compliant profiles running simultaneously.

Related