IAnt RadioInitialize Continuous Scan Mode Method
Initializes the ANT radio for continuous scan mode.
Definition
Namespace: SmallEarthTech.AntRadioInterface
Assembly: SmallEarthTech.AntRadioInterface (in SmallEarthTech.AntRadioInterface.dll) Version: 5.0.2+3bc433b476ad11fc6896cfd0bd783d60504dc315
Returns an array of ANT channels. The first element of the array (ANT channel 0) is used for continuous scan mode to receive broadcast messages from ANT master devices. The remaining channels should be configured so messages may be sent to ANT master devices.
Assembly: SmallEarthTech.AntRadioInterface (in SmallEarthTech.AntRadioInterface.dll) Version: 5.0.2+3bc433b476ad11fc6896cfd0bd783d60504dc315
C#
Task<IAntChannel[]> InitializeContinuousScanMode()VB
Function InitializeContinuousScanMode As Task(Of IAntChannel())C++
Task<array<IAntChannel^>^>^ InitializeContinuousScanMode()F#
abstract InitializeContinuousScanMode : unit -> Task<IAntChannel[]> Return Value
TaskIAntChannelReturns an array of ANT channels. The first element of the array (ANT channel 0) is used for continuous scan mode to receive broadcast messages from ANT master devices. The remaining channels should be configured so messages may be sent to ANT master devices.
Example
Implementors typically would perform the following setup -
C#
public Task<IAntChannel[]> InitializeContinuousScanMode()
{
// multiple clients may attempt to initialize
lock (_lock)
{
// test if channels have not been allocated (first time initialization)
if (_channels.Length == 0)
{
// allocate channels for this radio
_logger.LogInformation("Allocating channels for continuous scan mode.");
_channels = new IAntChannel[NumChannels];
// configure channel 0 for continuous scan mode
SetNetworkKey(0, new byte[] { 0xB9, 0xA5, 0x21, 0xFB, 0xBD, 0x72, 0xC3, 0x45 });
EnableRxExtendedMessages(true);
_channels[0] = GetChannel(0);
_channels[0].AssignChannel(ChannelType.BaseSlaveReceive, 0, 500);
_channels[0].SetChannelID(new ChannelId(0), 500);
_channels[0].SetChannelFreq(57, 500);
OpenRxScanMode();
// assign channels for devices to use for sending messages
for (int i = 1; i < NumChannels; i++)
{
_channels[i] = GetChannel(i);
_ = _channels[i].AssignChannel(ChannelType.BaseSlaveReceive, 0, 500);
}
}
}
return Task.FromResult(_channels);
}