nRF51 SDK - S130 SoftDevice
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Multiprotocol Application

The Multiprotocol Application is an example that implements the Heart Rate profile in Bluetooth mode and the Gazell device mode.

When the application starts, it is in Bluetooth mode and behaves as the Heart Rate Application application. If button 2 is pressed, the application switches to Gazell device mode. In this mode, it attempts to send packets to a host. If the packets are successfully sent, the BSP_INDICATE_SENT_OK state is indicated. If it fails, the BSP_INDICATE_SEND_ERROR state is indicated. If button 1 is pressed, the application switches back to Bluetooth mode.

Note
This application is not power optimized!
In Bluetooth mode, the application goes to system-off after 3 minutes of advertising if no connection is initiated. Press button 1 to restart in Bluetooth mode or button 2 to restart in Gazell mode.
This application uses a local copy of Application Timer using SWI1 instead of SWI0.

Setup

The name of the example is ble_app_gzll_s130_pca10028. If you are not using the Keil Pack Installer, you can find the source code and project file of the example in the following folder: <InstallFolder>\examples\multiprotocol\ble_app_gzll

Button assignments:

  • During system-off:
    • Button 1: Wake up and start advertising in Bluetooth mode.
    • Button 2: Wake up and start advertising in Bluetooth mode.
  • During Advertising and Connection:
    • Button 1: Switch to Bluetooth mode.
    • Button 2: Switch to Gazell device mode.

Testing

Test the Bluetooth part of the Multiprotocol Application with the nRF Toolbox app, which is available on both iOS (Apple Store) and Android (Google Play).

You can also test the application with the Master Control Panel by performing the following steps:

  1. Compile and program the application. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
  2. Connect to the device from Master Control Panel (the device will be advertising as 'Nordic_BLE_GZL'), then perform service discovery. Observe that the BSP_INDICATE_CONNECTED state is indicated.
  3. Click the 'Enable services' button on the Master Control Panel. Observe that Heart Rate notifications are received every second, and Battery Level notifications are received every two seconds.
  4. Click on the Disconnect button on the Master Control Panel. Observe that the BSP_INDICATE_ADVERTISING state is indicated.
  5. Press the Gazell button (Button 2) and observe that the BSP_INDICATE_SEND_ERROR state is indicated (if a Gazell host device is running, you should observe that the BSP_INDICATE_SENT_OK state is indicated and that the LEDs on the host device are lit in a running sequence).