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.
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 |
You can find the source code and project file of the example in the following folder: <InstallFolder>\examples\ant\experimental\ant_continuous_scanning_controller
You can test the Asynchronous Controller using Continuous Scanning Mode example in different ways:
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 |
<InstallFolder>\examples\ant\experimental\ant_continuous_scanning_controller\ant_continuous_scanning_controller_test.xml
. Alternatively, you can configure the device channels manually: