Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Channel Period of a Master(transmitter)

Avatar
RankRankRankRank

Total Posts: 123

Joined 2013-10-07

PM

Hi, just to put you in context, I am running the DEMO_LIB example included in the Windows library package. I am using a movestick usb stick and a Garmin HR strap (HRM1B)

The demo is working fine if I set the channel period manually. if not, I get constant RX fail (7 in a row). Is there a way to retrieve the Channel period from a device? I have tried with "MESG_CHANNEL_MESG_PERIOD_ID". but the code below never get executed (code added in Demo::ProcessMessage(..) )

case MESG_CHANNEL_MESG_PERIOD_ID:
        
{
            printf
("GOT HERE -- ");
            if(
stMessage.aucData[2] != RESPONSE_NO_ERROR)
            
{
                printf
("Error configuring Channel Period: Code 0%d\n"stMessage.aucData[2]);
                break;
            
}
            printf
("Channel Period set\n");
            
printf("Setting Radio Frequency...\n");
            
bStatus pclMessageObject->SetChannelPeriod(USER_ANTCHANNELusMessagePeriod);
            break;
        




// with this line, the demo works, but I would like usMessagePeriod to be retrieved from the device.
bStatus pclMessageObject->SetChannelPeriod(USER_ANTCHANNELusMessagePeriod); 


Parameters used to run Demo.cpp
#define USER_BAUDRATE         (57600)       // For AT3/AP2, use 57600 //50000
#define USER_RADIOFREQ        (57)          // 57=HR

#define USER_ANTCHANNEL       (0)           // 0=RECEIVE
#define USER_DEVICENUM        (0)           // 0=PAIRING, MyHR=16868
#define USER_DEVICETYPE       (0)           // 0=PAIRING, 120=HR, 121=S&C, 11=POWER
#define USER_TRANSTYPE        (0)           // 0=PAIRING

#define USER_NETWORK_KEY      {[Removed]}  // ANT+ Managed Network Key
#define USER_NETWORK_NUM      (0)      // The network key is assigned to this network number

#define MESSAGE_TIMEOUT       (1000)
const USHORT usMessagePeriod 8070;         // 8700=4messages/sec 


If you can help me a little bit, I just started with ANT+, I read the HR Profile and the Message protocol pdf. I would like to detect the channel period, because if I hard-code it and the user device is not a 4Ghz one, my program would probably bug.
Thank you!

     

Signature

——————————————————
Free Indoor Cycling Software - https://maximumtrainer.com

RankRankRankRank

Total Posts: 156

Joined 2013-01-07

PM

Blaisminator,

What are you trying to achieve with your application? If you are just planning on connecting to a single ANT+ HRM, I would recommend using the channel configuration parameters defined in the ANT+ HRM Device Profile
(Channel Period = 8070/32768 seconds).

There are no built in ways of figuring out the channel period of a master, you would have to use timestamps with a scanning channel to calculate the channel period of a master yourself. Or in the case of ANT-FS, the channel period is specified in the message payload.

For ANT+ devices, the recommended practice is to use the channel period specified in the respective profile because all ANT+ devices have been tested and certified for those channel configuration values.

Note: Your post was edited to remove the ANT+ Network Key which is subject to Terms of Use and shouldn't be posted in the public forum.      
Avatar
RankRankRankRank

Total Posts: 123

Joined 2013-10-07

PM

Thanks for your answer!

My application just act as a display device for heart rate, cadence and power device.
The first time you use the application, a pairing system let you find your device without having your device id. Then the devices id are stored for easier pairing the next time.

I will use the Channel Period of 8070 without worrying then, good to know that all the heart rate strap are certified.
Sorry about the ANT+ Network key, I should probably read the term of use now.. smile      

Signature

——————————————————
Free Indoor Cycling Software - https://maximumtrainer.com