Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

   

Connecting to speed sensor after timeout

Rank

Total Posts: 1

Joined 2025-01-29

PM

I'm trying to read data from a speed sensor on a PC using the ANT SDK.
I use the following code to connect to the sensor:

#define USER_ANTCHANNEL 0 // ANT channel to use
#define USER_DEVICENUM 0 // Device number
#define USER_DEVICETYPE 0x7b // Device type
#define USER_TRANSTYPE 0 // Transmission type
#define USER_PERIOD      8118

ANT_SetChannelIdUSER_ANTCHANNELUSER_DEVICENUMUSER_DEVICETYPEUSER_TRANSTYPE );
ANT_SetChannelRFFreqUSER_ANTCHANNELUSER_RADIOFREQ );
ANT_SetChannelPeriodUSER_ANTCHANNELUSER_PERIOD );
ANT_AssignChannelUSER_ANTCHANNELCHANNEL_TYPE_SLAVEUSER_NETWORK_NUM ); 


This seems to work until the sensor falls asleep then the connection timeouts. Then I call ANT_AssignChannel again until the sensor wakes up. I can receive some messages from the sensor, but most of them are RX Fail.
What would be the proper way to reconnect to the sensor? Do I have to call ANT_ResetSystem every time a timeout happens? This does not seem to be required with ANTware II.

Thanks in advance.