Bluetooth: Peripheral Running Speed and Cadence Service (RSCS)
The peripheral RSCS sample demonstrates how to use the Running Speed and Cadence Service (RSCS).
Requirements
The sample supports the following development kits:
Hardware platforms |
PCA |
Board name |
|
|---|---|---|---|
nRF54LV10 DK |
PCA10188 |
|
|
PCA10184 |
|
||
nRF54LC10 DK |
PCA10226 |
nrf54lc10dk |
|
PCA10156 |
|
||
PCA10156 |
|
||
PCA10156 |
|
||
PCA10175 |
|
||
PCA10095 |
|
||
PCA10040 |
|
||
PCA10056 |
|
||
PCA10100 |
|
For more security, it is recommended to use the */ns variant of the board target.
When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation.
Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.
The sample also requires a phone or tablet running a compatible application, for example nRF Connect for Mobile or nRF Toolbox.
Overview
This sample demonstrates the use of Running Speed and Cadence Service. It simulates a sensor and sends measurements to the connected device, such as a phone or a tablet.
The mobile application on the device can configure sensor parameters using the SC Control Point characteristic.
User interface
- LED 1:
Blinks, toggling on/off every second, when the main loop is running and the device is advertising.
- LED 2:
Lit when connected.
- LED 0:
Blinks, toggling on/off every second, when the main loop is running and the device is advertising.
- LED 1:
Lit when connected.
Building and running
This sample can be found under samples/bluetooth/peripheral_rscs in the nRF Connect SDK folder structure.
For more security, it is recommended to use the */ns variant of the board target (see the Requirements section above.)
When built for this variant, the sample is configured to compile and run as a non-secure application using security by separation.
Therefore, it automatically includes Trusted Firmware-M that prepares the required peripherals and secure services to be available for the application.
To build the sample, follow the instructions in Building an application for your preferred building environment. See also Programming an application for programming steps and Testing and optimization for general information about testing and debugging in the nRF Connect SDK.
Note
When building repository applications in the SDK repositories, building with sysbuild is enabled by default.
If you work with out-of-tree freestanding applications, you need to manually pass the --sysbuild parameter to every build command or configure west to always use it.
Testing
This testing procedure assumes that you are using nRF Connect for Mobile. After programming the sample to your development kit, test it by performing the following steps:
Power on your development kit.
Connect to the device through nRF Connect for Mobile (the device is advertising as “Nordic_RSCS”).
Observe that the services of the connected device are shown.
In Running Speed and Cadence Service, tap the Notify button for the “RSC Measurement” characteristic.
Observe that notifications with the measurement values are received.
In RSC Feature, tap the Read button to get the supported features.
In Sensor Location, tap the Read button to read the location of the sensor.
In SC Control Point, tap the Indicate button to control the sensor.
The following Op Codes (with data if required) can be written into the SC Control Point:
01 xx xx xx xxto set the Total Distance Value to the entered value in meters. (if the server supports the Total Distance Measurement feature).02to start the sensor calibration process (if the server supports the Sensor Calibration feature).03 xxto update the sensor location (if the server supports the Multiple Sensor Locations feature).04to get a list of supported localizations (if the server supports the Multiple Sensor Locations feature).
The answer consists of the following fields:
10Response Code.xxRequired Op Code.xxStatus:01Success,02Op Code not supported,03Invalid Operand,04Operation Failed.dataOptional, response data.
Dependencies
This sample uses the following nRF Connect SDK libraries:
In addition, it uses the following Zephyr libraries:
include/zephyr/types.hlib/libc/minimal/include/errno.hinclude/sys/printk.hinclude/random/random.hAPI:
include/bluetooth/bluetooth.hinclude/bluetooth/conn.hinclude/bluetooth/uuid.hinclude/bluetooth/gatt.h
The sample also uses the following secure firmware component: