コード例 #1
0
        private void startChannel()
        {
            //Just try this in case we get an active channel for some reason
            channel.closeChannel(500);
            channel.unassignChannel(500);

            if (!channel.assignChannel(ANT_ReferenceLibrary.ChannelType.BASE_Master_Transmit_0x10, 0, 500))
            {
                statusReport = "Failed to start, assign() failed";
            }
            else if (!channel.setChannelID((ushort)deviceNum, false, 9, 5, 500))
            {
                statusReport = "Failed to start, setChannelId() failed";
            }
            else if (!channel.setChannelFreq(57, 500))
            {
                statusReport = "Failed to start, setChannelFreq() failed";
            }
            else if (!channel.setChannelPeriod(32768, 500))
            {
                statusReport = "Failed to start, setChannelPeriod() failed";
            }
            else if (!channel.setChannelTransmitPower(ANT_ReferenceLibrary.TransmitPower.RADIO_TX_POWER_0DB_0x03, 500))
            {
                statusReport = "Failed to start, setChannelTransmitPower() failed";
            }
            else if (!channel.openChannel(500))
            {
                statusReport = "Failed to start, openChannel() failed";
            }
            else
            {
                statusReport = "Remote Control Channel is open";
            }
        }