public void ConfigureScan(byte userChannel) { this.userChannel = userChannel; RXQueue = new Queue <byte[]>(16); messageQueue = new Queue <ANT_Response>(16); device = AntManager.Instance.device; device.enableRxExtendedMessages(true, 500); channel = device.getChannel(userChannel); channel.channelResponse += new dChannelResponseHandler(ChannelResponse); channel.assignChannelExt(ANT_ReferenceLibrary.ChannelType.ADV_TxRx_Only_or_RxAlwaysWildCard_0x40, 0, ANT_ReferenceLibrary.ChannelTypeExtended.ADV_AlwaysSearch_0x01, 500); channel.setChannelID(0, false, 0, 0, 500); channel.setChannelFreq(57, 500); channel.setChannelSearchTimeout(0); channel.setLowPrioritySearchTimeout((byte)0xFF); isBackgroundScan = true; channel.openChannel(); broadcasting = true; }
public void ConfigureContinuousScan(ANT_ReferenceLibrary.ChannelType channelType, byte radioFreq, ushort USBNum) { userChannel = 0; RXQueue = new Queue <byte[]>(16); messageQueue = new Queue <ANT_Response>(16); device = AntManager.Instance.devices[USBNum]; device.enableRxExtendedMessages(true, 500); channel = device.getChannel(0); channel.channelResponse += new dChannelResponseHandler(ChannelResponse); channel.assignChannelExt(ANT_ReferenceLibrary.ChannelType.ADV_TxRx_Only_or_RxAlwaysWildCard_0x40, 0, ANT_ReferenceLibrary.ChannelTypeExtended.ADV_AlwaysSearch_0x01, 500); channel.setChannelID(0, false, 0, 0, 500); channel.setChannelFreq(radioFreq, 500); channel.setChannelSearchTimeout(0); channel.setLowPrioritySearchTimeout((byte)0xFF); isBackgroundScan = true; channel.openChannel(); device.openRxScanMode(); broadcasting = true; }