You are here: Forum Home → ANT Developers Forums → ANT in Mobile Phones → Thread
byte[] assignChannel = new byte[6];
assignChannel[0] = (byte)4; //message length
assignChannel[1] = AntMesg.MESG_ASSIGN_CHANNEL_ID; //message id
assignChannel[2] = channelNumber;
assignChannel[3] = AntDefine.PARAMETER_RX_ONLY;
assignChannel[4] = 0; //public network
assignChannel[5] = AntDefine.EXT_PARAM_ALWAYS_SEARCH; //Background searching
byte[] enableExt = new byte[6];
enableExt[0] = (byte) 2;
enableExt[1] = AntMesg.MESG_RX_EXT_MESGS_ENABLE_ID;
enableExt[2] = (byte) 0; //filler
enableExt[3] = (byte) 1; //enable
sAntReceiver.ANTTxMessage(assignChannel); //enable background scanning
sAntReceiver.ANTTxMessage(enableExt); //enable extended format
sAntReceiver.ANTSetChannelId(channelNumber, (byte)0, DEVICE_TYPE, TX_TYPE);
sAntReceiver.ANTSetChannelRFFreq(channelNumber, radioFreq);
sAntReceiver.ANTSetLowPriorityChannelSearchTimeout(channelNumber,(byte) 0xFF); // Set search timeout to unlimited
sAntReceiver.ANTSetChannelSearchTimeout(channelNumber, (byte)0); // Disable high priority search
sAntReceiver.ANTOpenChannel(channelNumber);