CSafe_SetUserCFG1_CMD

Post questions and issues with Concept2 PM3 SDK

CSafe_SetUserCFG1_CMD

Postby Phil_M » February 18th, 2015, 4:22 pm

Hi all,

Can someone explain the two examples relating to the above wrapper command from the Concept2 Preliminary manual in the SDK.

On pg 50 in Appendix 2, it gives two examples using the command wrapper. One for a short command and one for a long command.

1) Get higher resolution workout times:
Command Frame 0xF1 0x1A 0x01 0xA0 0xBB 0xF2

0xF1 and 0xF2 are the start flag and end flag.
0x1A is the Csafe_SetUserCFG1_CMD itself, and
0xA0 is the CSAFE_PM_GET_WORKTIME Command.

What are 0x01 and 0xBB doing? I have managed to successfully run the above command, but when I try and switch out worktime for something else, it errors. I assume I need to change 0x01 and 0xBB for something else, but as I dont know what they are doing, I cant work out what to change them to.

the long example is essentially the same.

2) Get workout type and drag factor:
Command Frame: 0xF0 0xFD 0x00 0x1A 0x02 0x89 0xC1 0x50 0xF2

Again, 0xF0 and 0xF2 I understand to be the extended frame start flag, and the usual stop flag.
0x1A is the command wrapper
0x89 is workout type and 0xC1 is drag factor.
0xFD is the Erg Address
0x00 is the PC address

So we are left with 0x02 after the command wrapper when in the previous example there was an 0x01,
and then after the two commands there is an 0x50. What are these doing, and how are they chosen? If I wanted a different set of commands, how would I determine what numbers were required before and after?

Does the 0x01 and 0x02 refer to the number of following commands to look out for?
What determines the 0xBB and 0x50 numbers which follow the commands and appear before the stop flag.

Any help greatly appreciated.

Thanks,
Phil
Phil_M
Paddler
 
Posts: 30
Joined: November 23rd, 2014, 10:10 am

Re: CSafe_SetUserCFG1_CMD

Postby dxpack » July 6th, 2015, 6:08 pm

In the first example:

0x01 is the SETUSERCFG1 message content length (the SETUSERCFG1 message content being 0xA0)
0xBB is the checksum on the frame content (0x1A, 0x01, 0xA0). The checksum is byte for byte XOR on the frame content. If you change the frame content you need to calculate the correct checksum.

Similarly for the second example:

0x02 is the SETUSERCFG1 message content length (the SETUSERCFG1 message content being 0x89 0xC1)
0x50 is the checksum on the frame content (0x1A 0x02 0x89 0xC1).
dxpack
Paddler
 
Posts: 13
Joined: July 5th, 2015, 1:59 am

Re: CSafe_SetUserCFG1_CMD

Postby Phil_M » July 19th, 2015, 3:34 pm

Excellent,

Thank you for this, it makes perfect sense.

Amazed to get an answer after all this time. Thanks for checking the older posts.
Phil_M
Paddler
 
Posts: 30
Joined: November 23rd, 2014, 10:10 am


Return to SDK Questions

Who is online

Users browsing this forum: No registered users and 2 guests