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

   

[Solved]SumulANT+ Testing page 0x11

Avatar
RankRankRankRank

Total Posts: 123

Joined 2013-10-07

PM

Hello,

I am working on implementing the bike power profile to my application.

For the page : Standard Wheel Torque Main Data Page (0x11)
I would like to know if it's possible to test it with some tools, SimulANT+ doesn't seem to provide this page with the "power sensor (power-only)" that they provide. I need to know if it's working because my software will support power meter as data source for speed.
Thanks in advance


My current decoding code for power (not complete):


/// decodePowerMessage
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void Power_Controller::decodePowerMessage(ANT_MESSAGE stMessage{


    UCHAR ucDataOffset 
MESSAGE_BUFFER_DATA2_INDEX;   // For most data messages
    
UCHAR ucPage stMessage.aucData[ucDataOffset];


    switch (
ucPage{

    
/// 0x10 - Power Main Data Page - Standard Power Only-------------------------------------------------------------------
    
case (UCHAR)0x10:
    
{

        pstPage16Data
.ucPOEventCount       stMessage.aucData[ucDataOffset+1];
        
pstPage16Data.ucReserveByte2 stMessage.aucData[ucDataOffset+2];  // Pedal percentage
        
pstPage16Data.ucPOInstantCadence   stMessage.aucData[ucDataOffset+3];
        
pstPage16Data.usPOAccumulatedPower = (USHORT)stMessage.aucData[ucDataOffset+4];
        
pstPage16Data.usPOAccumulatedPower |= (USHORT)(stMessage.aucData[ucDataOffset+5]<<8);
        
pstPage16Data.usPOInstantPower     = (USHORT)stMessage.aucData[ucDataOffset+6];
        
pstPage16Data.usPOInstantPower     |= (USHORT)(stMessage.aucData[ucDataOffset+7]<<8);


        if (
firstPage0x10Now{
            firstPage0x10Now 
false;
            
ucPOEventCountPrev pstPage16Data.ucPOEventCount;
            
usPOAccumulatedPowerPrev pstPage16Data.usPOAccumulatedPower;
        
}
        
else {  /// Calculate Average Power

            
ulPOEventCountDiff = (ULONG)((pstPage16Data.ucPOEventCount ucPOEventCountPrev) & MAX_UCHAR);
            
ulPOAccumulatedPowerDiff = (ULONG)((pstPage16Data.usPOAccumulatedPower usPOAccumulatedPowerPrev) & MAX_USHORT);
            if (
ulPOEventCountDiff==0)
            
{
                
/// TODO EMIT POWER, show 0 value?
                //                ucWTZeroPowerCheck++;
                //                if(ucWTZeroPowerCheck >= BPSRX_MAX_REPEATS)  // Event sync zero speed condition
                //                {
                //                }
            
}
            
else
            
{
                stCalculatedStdPowerData
.ulAvgStandardPower ulPOAccumulatedPowerDiff/ulPOEventCountDiff;
                
ucPOEventCountPrev pstPage16Data.ucPOEventCount;
                
usPOAccumulatedPowerPrev pstPage16Data.usPOAccumulatedPower;
            
}

            
if (pstPage16Data.ucReserveByte2 != (UCHAR)0xFF{
                qDebug
() << "pedal percent SUPPORTED:" << pstPage16Data.ucReserveByte2;  //To calculate : p28 doc
            
}

            
//                    qDebug() <<  "INSTANT POWER NOW: "<< pstPage16Data.usPOInstantPower;
            //                    qDebug() <<  "CALCULATED POWER NOW: "<< stCalculatedStdPowerData.ulAvgStandardPower;
            //                    qDebug() << "CADENCE NOW:"<< pstPage16Data.ucPOInstantCadence;


            /// EMIT POWER
            
if (usingForPower{
                emit powerChanged
(stCalculatedStdPowerData.ulAvgStandardPower);
            
}
            
/// EMIT CADENCE
            
if (usingForCadence{
                cadenceChanged
(pstPage16Data.ucPOInstantCadence);
            
}
        }
        
break;
    
}

        
/// 0x11 - Standard Wheel Torque Main Data Page------------------------------------------------------------------------
    
case (UCHAR)0x11:
    
{

        
///TODO : TEST (SIMULANT DOESNT PROVIDE THIS PAGE)
        // Wheel Torque (WT) Main Data Page
        
pstPage17Data.ucWTEventCount stMessage.aucData[ucDataOffset+1];
        
pstPage17Data.ucWTWheelTicks stMessage.aucData[ucDataOffset+2];
        
pstPage17Data.ucWTInstantCadence stMessage.aucData[ucDataOffset+3];
        
pstPage17Data.usWTAccumulatedWheelPeriod = (USHORT)stMessage.aucData[ucDataOffset+4];
        
pstPage17Data.usWTAccumulatedWheelPeriod |= (USHORT)(stMessage.aucData[ucDataOffset+5]<<8);
        
pstPage17Data.usWTAccumulatedTorque = (USHORT)stMessage.aucData[ucDataOffset+6];
        
pstPage17Data.usWTAccumulatedTorque |= (USHORT)(stMessage.aucData[ucDataOffset+7]<<8);

        if (
firstPage0x11Now{
            firstPage0x11Now 
false;
            
bWTFirstPageCheck=0;

...
    default:
    
{
        qDebug
() << "to implement...page:" << hex <<  ucPage;
        break;
    
}
    }


    
/// TODO:
    /// Common page - in a external class -processCommonMessage(stMessage)
    /// 0x50 - Common data- Manufacturer’s Information
    /// 0x51 - Common data- Product Information
    /// 0x52 - Common data- Battery Voltage 

     

Signature

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

Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

Hi,

If you use the Power Sensor (Wheel Torque) simulator in SimulANT+ then this page will be provided. Power-only sensors don't send this page.

Kat      
Avatar
RankRankRankRank

Total Posts: 123

Joined 2013-10-07

PM

Kat Kent - 18 December 2013 02:04 PM
Hi,

If you use the Power Sensor (Wheel Torque) simulator in SimulANT+ then this page will be provided. Power-only sensors don't send this page.

Kat


Hmm I must be blind, I can't see this sensor in the list -_-
https://www.dropbox.com/s/3gxsfvc8s13emyk/sensorList.png

Thanks Kat,      

Signature

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

Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

Are you using the latest version?      
Avatar
RankRankRankRank

Total Posts: 123

Joined 2013-10-07

PM

Kat Kent - 18 December 2013 02:36 PM
Are you using the latest version?


Great it's working now, didn't realize you guys were updating so fast smile
Thanks      

Signature

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