Important: Before you run this example, make sure to program the SoftDevice.
Standard ANT search is able to search for devices in one network and radio frequency at a time. For applications intending to connect to devices on different networks/frequencies, this means that the second slave channel will only be able to start searching for a master once the first slave channel has either acquired a master or timed out its search. Search sharing enables two or more channels to search concurrently on different radio frequencies or networks, by alternating which channel uses the radio for searching.
The purpose of this example is to demonstrate how to use search sharing to perform concurrent searches for two devices transmitting in different radio frequencies. This example also shows how to configure the search waveform to limit the impact on acquisition time from switching between multiple frequencies during search. This example can be paired with ANTware, with two master channels in two different radio frequencies.
After start up, this example will configure and open two slave channels with the following parameters.
Parameter | Slave 0 | Slave 1 |
---|---|---|
Channel Type | Slave (0x10) | Slave (0x10) |
Extended Assignment | 0 | 0 |
Network | Public | Public |
Radio Frequency | 50 | 70 |
Device Number | 0(wildcard) | 0(wildcard) |
Device Type | 2 | 3 |
Transmission Type | 1 | 1 |
Channel Period | 8192 (4 Hz) | 8192 (4 Hz) |
High Priority Search Timeout | 0 (disabled) | 0 (disabled) |
Low Priority Search Timeout | 12 (30 seconds) | 12 (30 seconds) |
Search sharing cycles | 1 | 1 |
Search waveform | ANT_WAVEFORM_FAST | ANT_WAVEFORM_FAST |
The high priority search timeout is disabled in both channels to reduce the impact of search on tracking channels. Low priority search timeout is configured to the desired timeout, 30 seconds. Search sharing cycles is set to 1, so that search alternates between the two channels every search cycle. Finally, to reduce the impact in acquisition time from switching back and forth between two radio frequencies, the search waveform is configured to the fast waveform.
<InstallFolder>\examples\ant\experimental\ant_search_sharing\search_sharing_test.xml
. Alternatively, you can configure the device channel manually: