Important: Before you run this example, make sure to program the SoftDevice .
The Broadcast example consists of basic example applications that can be used to test ANT connectivity between a master and a slave.
Transmitter
The transmitter application transmits a packet four times per second. Each transmission is indicated by BSP_INDICATE_SENT_OK .
Packet layout: {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, X }
The last byte of the packet ( X ) is incremented each time.
You can find the source code and the project file of the example in the following folder:
<InstallFolder>\examples\ant\ant_broadcast\tx
Receiver
The receiver application receives a packet four times per second. Each successful transmission is indicated by BSP_INDICATE_RCV_OK .
You can find the source code and the project file of the example in the following folder:
<InstallFolder>\examples\ant\ant_broadcast\rx
Channel configuration
This example uses the default channel configuration:
| Parameter | Transmitter | Receiver |
|---|---|---|
| Channel type | Master (0x10) | Slave (0x00) |
| Network key | Public | Public |
| RF channel | 66 (2466 MHz) | 66 (2466 MHz) |
| Device number | 0x02 | 0x00 (Wildcard) |
| Device type | 0x02 | 0x00 (Wildcard) |
| Transmission type | 0x01 | 0x00 (Wildcard) |
| Channel period | 8192 (4 Hz) | 8192 (4 Hz) |
Testing
Note: You can use a custom channel or encryption when running any of the ANT examples. When adding a new channel or encryption, remember to update SoftDevice ANT event handler configuration .
You can test the Broadcast example in different ways:
- Testing the Broadcast Transmitter with the Broadcast Receiver
- Testing the Broadcast Transmitter using ANTware II
- Testing the Broadcast Receiver using ANTware II
Testing the Broadcast Transmitter with the Broadcast Receiver
- Compile and program the Broadcast Transmitter. Observe that the transmitter board indicates BSP_INDICATE_SENT_OK (4 Hz).
- Compile and program the Broadcast Receiver. Observe that the receiver board indicates BSP_INDICATE_RCV_OK (4 Hz).
Testing the Broadcast Transmitter using ANTware II
- Compile and program the Broadcast Transmitter. Observe that the transmitter board indicates BSP_INDICATE_SENT_OK (4 Hz).
-
Run ANTware II. Select your ANT PC dongle (for example, ANTUSB-m) from the available devices. Configure the device channels by loading the device profile configuration from the following file:
<InstallFolder>\examples\ant\ant_broadcast\tx\ant_broadcast_tx_test.xml. Alternatively, you can configure the device channels manually:- Set the channel assignment to slave.
- Set the channel ID to "0, 0, 0".
-
Click the Auto-Open button. Observe that messages describing the received payload appear for each ANT message. These messages should look similar to the following fragment:
Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-01 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-02 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-03 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-04 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-05 Received BROADCAST_DATA_0x4E :: 4e, 00-00-00-00-00-00-00-00-06
Testing the Broadcast Receiver using ANTware II
- Compile and program the Broadcast Receiver. Observe that the receiver board indicates BSP_INDICATE_RCV_OK (4 Hz).
-
Run ANTware II. Select your ANT PC dongle (for example, ANTUSB-m) from the available devices. Configure the device channels by loading the device profile configuration from the following file:
<InstallFolder>\examples\ant\ant_broadcast\rx\ant_broadcast_rx_test.xml. Alternatively, you can configure the device channels manually:- Set the channel assignment to master.
- Set the channel ID to "2, 2, 1".
- Click the Auto-Open button. Observe that the receiver board indicates BSP_INDICATE_RCV_OK (4 Hz).