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

   

calcul power bike

Rank

Total Posts: 12

Joined 2013-12-17

PM

hi,


I currently working on a program developed in Java and I can not seem to get the power. I know analyze the bits I receive but do not know the use to recover power could you please help me. I have some knowledge of java c + + and c # if you ever have an example.
thank you

cordially

suli      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

I'm not sure if I understand your question.
"but do not know the use to RECOVER power" ist not clear to me.
Could you try to explain in a different wording.

Cordialement,
OMB      
Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

Hi Suli,

The ANT+ Bicycle Power Device Profile (http://www.thisisant.com/developer/resources/downloads/#documents_tab) describes all the calculations that should be performed on the received data to obtain the power from any accumulated power fields.

Alternatively you can just display the instantaneous power from the power-only page (0x10) which does not require any calculations.

Thanks,

Kat      
Rank

Total Posts: 12

Joined 2013-12-17

PM

hi,

thank you for your answer. I do not quite understand when you said that the instantaneous power is in the 0x10 page because I have the following code: (this code is note complet)


///Configuration
   
public static final int ANT_SPORT_SPEED_PERIOD 8187
    public static final 
int ANT_SPORT_FREQ 57
    public static final 
boolean PWR_PAIRING_FLAG true;
    public static final 
int PWR_TRANSMISSION_TYPE 0;
    public static final 
int PWR_DEVICE_TYPE 11// 0x0Bu
    
public static final int PWR_DEVICE_ID 29530;

        
power7 message.getUnsignedData()[7];
        
power6 message.getUnsignedData()[6];
        
power5 message.getUnsignedData()[5];
        
power4 message.getUnsignedData()[4];
        
power3 message.getUnsignedData()[3];
        
power2 message.getUnsignedData()[2];
        
power1 message.getUnsignedData()[1];
        
power0 message.getUnsignedData()[0]

but I do not have the instant power in bit 4

the method getUnsignedData is a int[] variable content the 8 bits of protocol. I am sure because I get the heart rate and speed and cadence with another configuration      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

You should make yourself familiar with document "ANT+ Bicycle Power Device Profile" - see the link in Kat Kent's previous post.
This document explains the structure of the power meter message payloads in detail, including what "page 10" means. It's very easy to decode the messages, once you've read and understood this document.

Cheers,
OMB      
Rank

Total Posts: 12

Joined 2013-12-17

PM

Hi thank for the reply
I read this documentation but how to configure the page 0x10? i don't hunderstand this. Thank you for your replys      
Avatar
RankRankRankRank

Total Posts: 235

Joined 2012-08-31

PM

Hi, can you be more specific about what you don't understand?      
Rank

Total Posts: 12

Joined 2013-12-17

PM

Hi
I use Jformica for decode the protocole ANT+. I receive the speed, cadence and heart with this code but i can't have the power. I read your documentation and configure successfully the devices but with your application for sensor simulation I get no frame. Would you have a simple code in any language that the décoderais powerin the 0x10 page? thanks for the reply.

Suli      
Avatar
RankRankRankRank

Total Posts: 296

Joined 0

PM

Well how about contacing the Jformica developers and ask them to add support for the ANT+ Bike Power Profile to their library (or fix it if it's there and just doesn't work as expected)?      
Rank

Total Posts: 12

Joined 2013-12-17

PM

the aim would be to adapt its library so that I can get the power      
Rank

Total Posts: 12

Joined 2013-12-17

PM

I find the power. I give my code for the developer Java who use JFormica.
public class ListenerP implements BroadcastListener<BroadcastDataMessage{

    
private int[] data;
    private 
int powerFinal;
    private 
int cadence;
    private 
int IPLSB;
    private 
int IPMSB