| nRF5 SDK v12.0.0 |

Choose documentation: | nRF5 SDK | S130 SoftDevice API | S132 SoftDevice API | S212 SoftDevice API | S332 SoftDevice API

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Experimental: Bluetooth Developer Studio Example
This example requires one of the following SoftDevices: S130, S132

Important: Before you run this example, make sure to program the SoftDevice.

The bluetoothds_template application is an example that you can use as a starting point for developing your own application using services generated by Bluetooth Developer Studio.

Note
  The application will stop advertising after 3 minutes and go to system-off mode. Push button 1 to wake it up and restart advertising.

# Implementation

To implement your own application, you must first generate a custom profile in Bluetooth Developer Studio. You can then use this custom profile in the example application.

## Generating a custom profile

1. Create a custom profile:
   1. Click File > New.
   2. Rename the Project to, for example, "Test project".
   3. Enter a string for NAMESPACE, for example "com.MyCompany".
   4. Rename the Profile to, for example, "Test Profile"
2. Create a custom service:
   1. Click CUSTOM SERVICE.
   2. Rename the new service to, for example, "Test profile test service".
3. Add a new characteristic:
   1. Click +.
   2. Rename the new characteristic to, for example, "RX".
   3. Set the Read/Write/Notify/Indicate properties. For example, set "Write Without Response" to "Mandatory".
   4. Add fields to the characteristic. For example, add a "value" field with format "_VARIABLE".
4. Add further characteristics, if required. For example, add a "TX" characteristic with the Notify property set to "Mandatory" and a "_VARIABLE" field named "value".
5. Generate the code:
   1. Click Tools > Generate Code.
   2. Select "Server" and "NORDIC SEMICONDUCTOR NRF5X V1.1.x".

## Including the custom profile

1. If you want to use tracing, define the APP_LOG macro:
   #define APPL_LOG app_trace_log
2. In the Keil project, add the source file of the service by adding `ble_test_profile_test_service.c` to the group nRF_BLE.

# Setup

You can find the source code and the project file of the example in the following folder: `<InstallFolder>\examples\ble_peripheral\experimental_bluetoothds_template`

Buttons assignments:

- Button 1: Wake up and start advertising.

# Testing

Test the Template 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_BDS'), then connect and perform service discovery. Observe that the BSP_INDICATE_CONNECTED state is indicated.
3. Disconnect and observe that the BSP_INDICATE_ADVERTISING state is indicated. You can wait for 3 minutes and observe that the BSP_INDICATE_IDLE is indicated.
4. In system-off mode, press button 1. The application starts advertising again.