You are here: Forum Home → ANT Developers Forums → ANT General Questions → Thread
BOOL ANTControl_ConfigScanningMode(USHORT usDeviceNo_, UCHAR ucDeviceType_, UCHAR ucTransType_, UCHAR ucRFFreq_, BOOL bRxOnly)
{
    BOOL bStatus = TRUE;
    cdScanningMode.usDeviceNo = usDeviceNo_;
    cdScanningMode.ucDeviceType = ucDeviceType_;
    cdScanningMode.ucTransType = ucTransType_;
    cdScanningMode.ucRFFreq = ucRFFreq_;
    if(bRxOnly)
        cdScanningMode.ucChannelType = 0x40;
    else
        cdScanningMode.ucChannelType = 0x00;
 UCHAR USER_NETWORK_KEY[8] =  {0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, }; //removed ANT Key so I can post on forums
 
 // SetNetworkKey
 ANT_SetNetworkKey(ANT_NETWORK, USER_NETWORK_KEY);  //0, USER_NETWORK_KEY
 if(!WaitAck(MESG_NETWORK_KEY_ID, MESSAGE_TIMEOUT))
    bStatus = FALSE;
    // Config scanning mode
    // Using public network, so no need to set network key
    ANT_AssignChannel(cdScanningMode.ucChannel, cdScanningMode.ucChannelType, ANT_NETWORK);
  if(!WaitAck(MESG_ASSIGN_CHANNEL_ID, MESSAGE_TIMEOUT))
    bStatus = FALSE;
    
    // Set channel ID mask
 ...
} 
——————————————————
Free Indoor Cycling Software - https://maximumtrainer.com
——————————————————
Free Indoor Cycling Software - https://maximumtrainer.com