Welcome Guest,Register Now
Log In

ANT Forum

Welcome guest, please Login or Register

You are here: Forum Home → ANT+ Forums → ANT+ Bike Power → Thread

   

Bike Power - source code error

Avatar
RankRankRankRank

Total Posts: 123

Joined 2013-10-07

PM

Just wanted to point an error I found today in the code distributed with the Bike Power Reference design (antplus_bike_power_v1.3.0)

Page 45 of the power profile states :
The Calibration Data bytes do not have units and may vary for each manufacturer. This value is a signed number allowing for both negative and positive data.

But in the code, the value used to store it is a USHORT (USHORT usCID172_CalibrationData;)

case PBS_CID_172:  // Calibration Successful 0xAC
        
{
            qDebug
() << "Calibration Sucessful 0xAC";

            
pstPage1Data.stBPSCalibrationData.stBPSPage1_CID172_Data.ucCID172_AutoZeroStatus stMessage.aucData[ucDataOffset+2];
            
pstPage1Data.stBPSCalibrationData.stBPSPage1_CID172_Data.ucCID172_ReserveByte3 BPS_PAGE_RESERVE_BYTE;
            
pstPage1Data.stBPSCalibrationData.stBPSPage1_CID172_Data.ucCID172_ReserveByte4 BPS_PAGE_RESERVE_BYTE;
            
pstPage1Data.stBPSCalibrationData.stBPSPage1_CID172_Data.ucCID172_ReserveByte5 BPS_PAGE_RESERVE_BYTE;             pstPage1Data.stBPSCalibrationData.stBPSPage1_CID172_Data.usCID172_Calibrati
            pstPage1Data
.stBPSCalibrationData.stBPSPage1_CID172_Data.usCID172_CalibrationData |= (USHORT)(stMessage.aucData[ucDataOffset+7]<<8);
... 
        


Not sure it can cause bugs, but USHORT can't store negative numbers, I'm trying to fix the SRM offset bug in my software and found that so it may be related..
Thanks.

     

Signature

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

Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Thanks for reporting this!      
Avatar
RankRankRankRank

Total Posts: 123

Joined 2013-10-07

PM

You're welcome!

Now if you could tell me the format of message to send to the Kickr in order to control it in erg mode smile
Burst message or broadcast message? I see multiple information on this..
Thanks ANT!      

Signature

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

Avatar
RankRankRankRank

Total Posts: 745

Joined 2012-09-14

PM

Unfortunately that's proprietary to Wahoo's implementation so you'll have to consult their support resources directly. I can suggest that if the message isn't longer than 8 bytes then it has to be an acknowledged or broadcast message, if you try to burst an 8 byte message then the message will look like an ack to the receiver.      
Avatar
RankRankRankRank

Total Posts: 123

Joined 2013-10-07

PM

Edit: This has been resolved after contacting Wahoo support. Thank you      

Signature

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