nRF5 SDK v11.0.0
Experimental: Continuous Scanning Controller
This example requires the following SoftDevice: S212

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

The Continuous Scanning Controller example demonstrates how to use continuous scanning to asynchronously send a message to the nearest device. In the image below, the controller (Node A) is in range to receive messages from nodes C, D and E. When the user presses a button on the controller, it uses continuous scanning mode to identify the node with the strongest RSSI and sends back a command message to that node in the reverse direction. The continuous scanning mode is only active for a short period of time after the button press, making this suitable for battery operated devices. For demonstration purposes, the asynchronous controller example is intended to be used in conjunction with Scan and Forward example, but can be adapted to other control applications.

The example can be used with two or more development boards or one development board and one ANT USB stick attached to a PC running ANTware II.

ant_continuous_scanning_controller.svg
ANT Continuous Scanning Controller example topology

Function of LEDs on Controller is presented in table below:

Hardware Function
BSP_LED_0 Turns on when continuous scanning is active
BSP_LED_1 Toggles when DEVICE_STATUS_PAGE is received on continuous scanning channel
BSP_LED_2 Turns on if no Nodes were found sending a DEVICE_STATUS_PAGE after continuous scanning

Setup

You can find the source code and project file of the example in the following folder: <InstallFolder>\examples\ant\experimental\ant_continuous_scanning_controller

Testing

You can test the Asynchronous Controller using Continuous Scanning Mode example in different ways:

Testing the example using Scan and Forward example

  1. Compile and program development board (Node A) with the Asynchronous Controller using Continuous Scanning Mode application.
  2. Compile and program other development boards (Node B – Node X) with the Scan and Forward application.
  3. Separate the nodes in a configuration of your choice. Distances greater than 2 meters provides the best experience.
  4. On the controller device (Node A), when a button is pressed, the corresponding command is sent into the network of nodes.
  5. On the network nodes (Node A – Node X), the LEDs will turn on or off based on the command received from the controller.

Function of Asynchronous Controller Buttons is presented in table below:

Button Command
BSP_BUTTON_0 Closest Node – LED on
BSP_BUTTON_1 Closest Node – LED off
BSP_BUTTON_2 All Nodes – LED on
BSP_BUTTON_3 All Nodes – LED off

Testing the example using ANTware II

  1. Compile and program development board (Node A) with the Continuous Scanning Controller application.
  2. Run AntWare II. Select your ANT PC dongle (for example, ANTUSB-m) from the available devices. Configure the device channel by loading the device profile configuration from the following file: <InstallFolder>\examples\ant\experimental\ant_continuous_scanning_controller\ant_continuous_scanning_controller_test.xml. Alternatively, you can configure the device channels manually:
    1. Set the channel assignment to master.
    2. Set the channel ID to "1, 1, 21".
    3. Set the channel period to "2048" (16 Hz).
    4. Set the radio frequency to "25".
    5. Keep the default for all other settings.
  3. Set the broadcast message to 20-01-00-00-00-00-00-00 (The second byte of the broadcast message matches the device number) and click Auto-Open button.
  4. Pressing a button on the Controller (Node A) will send a command which can be seen in the ANTware message window as an acknowledged message.

Documentation feedback | Developer Zone | Updated