Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Fitness Equipment → Thread

   

Beginner’s question - setting resistance

Rank

Total Posts: 1

Joined 2021-05-27

PM

Hello. I'm developing a game in unity for my smart trainer. I don't have experience in ANT+. I purchased a code for controlling my Ant+ (https://assetstore.unity.com/packages/tools/network/advanced-ant-71980). It mostly works fine. I'm connecting properly to my device and can read speed and distance data. But, I'm failing at setting the resistance on the device. Here is the failing code:

pageToSend = new byte[8] { 0x30, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, (byte)(resistance * 2) };//unit is 0.50%
deviceChannel.sendAcknowledgedData(pageToSend);



The value of:
(byte)ANT_ReferenceLibrary.ANTMessageID.RESPONSE_EVENT_0x40)
is: ANT_ReferenceLibrary.ANTEventID.EVENT_TRANSFER_TX_COMPLETED_0x05

So I'm assuming the transfer was complete, but no resistance was changed. Same problem applies to the slope.

Any advice or pointing in the right direction is highly appreciated.
Sorry for the newbie question
Oren      
RankRankRankRank

Total Posts: 370

Joined 2012-06-27

PM

Just to confirm you are using the fitness equipment functionality of that asset?

You have confirmed that the trainer you are working with supports basic resistance mode? See table 8-46 in the profile doc.      

Signature

Ian Haigh