CSAFE + BLE Characteristic

Post questions and issues with Concept2 PM3 SDK
Locked
dxpack
Paddler
Posts: 13
Joined: July 5th, 2015, 1:59 am

CSAFE + BLE Characteristic

Post by dxpack » July 5th, 2015, 5:43 pm

Using a BLE connection via iPhone, posting CSAFE commands to Characteristic 0x0021, subscribing to Updates from Characteristic 0x0022, I'm finding weird CSAFE response frames.

Even with the weird response frames, I am able to set the PM5 to Standard Workout 1 and GOINUSE (the PM5 UI changes to the 2000M workout). But I am unable to command the PM5 to GOFINISHED, or otherwise end an active workout (see the other thread I've started).

The weird response frames are for all CSAFE commands, for example, GETSTATUS:

Code: Select all

--> send     [0xF1, 0x80, 0x80, 0xF2]
<-- response [0xF1, 0x81, 0x81, 0xF2]
--> send     [0xF1, 0x80, 0x80, 0xF2]
<-- response [0xF1, 0x01, 0x01, 0xF2]

(the above continues, with continued, malformed alternated responses)
I was expecting to receive something along the lines a properly formed response:

Code: Select all

[0xF1, 0x01, 0x80, 0x01, 0x01, 0x81, 0xF2]

(per GETSTATUS example on page 50 of the PM Communication Interface Definition rev 0.15 document)

Another example SETPROGRAM (the command was successful):

Code: Select all

--> send     [0xF1, 0x24, 0x02, 0x01, 0x00, 0x27, 0xF2]
<-- response [0xF1, 0x81, 0x81, 0xF2]
--> send     [0xF1, 0x24, 0x02, 0x01, 0x00, 0x27, 0xF2]
<-- response [0xF1, 0x01, 0x01, 0xF2]

(the above continues, with continued, malformed alternated responses)
GOINUSE is different, though sending it does cause the PM5 to begin the SETPROGRAM workout:

Code: Select all

--> send     [0xF1, 0x85, 0x85, 0xF2]
<-- response [0xF1, 0x85, 0x85, 0xF2]
--> send     [0xF1, 0x85, 0x85, 0xF2]
<-- response [0xF1, 0x85, 0x85, 0xF2]

(the above continues, with continued, malformed identical responses)

GOFINISHED is different still, and does not cause an active workout to end:

Code: Select all

--> send     [0xF1, 0x86, 0x86, 0xF2] (GOFINISHED)
<-- response [0xF1, 0x11, 0x11, 0xF2]
--> send     [0xF1, 0x86, 0x86, 0xF2] (GOFINISHED)
<-- response [0xF1, 0x11, 0x11, 0xF2]
--> send     [0xF1, 0x80, 0x80, 0xF2] (GETSTATUS)
<-- response [0xF1, 0x81, 0x81, 0xF2]
--> send     [0xF1, 0x86, 0x86, 0xF2] (GOFINISHED)
<-- response [0xF1, 0x91, 0x91, 0xF2]
--> send     [0xF1, 0x80, 0x80, 0xF2] (GETSTATUS)
<-- response [0xF1, 0x01, 0x01, 0xF2]
--> send     [0xF1, 0x86, 0x86, 0xF2] (GOFINISHED)
<-- response [0xF1, 0x11, 0x11, 0xF2]
--> send     [0xF1, 0x80, 0x80, 0xF2] (GETSTATUS)
<-- response [0xF1, 0x81, 0x81, 0xF2]
--> send     [0xF1, 0x86, 0x86, 0xF2] (GOFINISHED)
<-- response [0xF1, 0x91, 0x91, 0xF2]
--> send     [0xF1, 0x86, 0x86, 0xF2] (GOFINISHED)
<-- response [0xF1, 0x91, 0x91, 0xF2]

(alternates between 0x11 and 0x91 depending on GETSTATUS response ... say what?!?)
In each case, CSAFE_X_CMD is sent to 0x0021 BLE Characteristic and iPhone app receives Characteristic update from 0x0022.

Can't figure out why this is happening.

dxpack
Paddler
Posts: 13
Joined: July 5th, 2015, 1:59 am

Re: CSAFE + BLE Characteristic

Post by dxpack » July 5th, 2015, 9:29 pm

To add:

A properly formatted response is received when sending CSAFE_GETSERIAL_CMD, with the correct serial number value:

Code: Select all

--> send     [0xF1, 0x94, 0x94, 0xF2]
<-- response [0xF1, 0x81, 0x94, 0x09, 0x34, 0x33, 0x30, 0x31, 0x30, 0x39, 0x31, 0x39, 0x39, 0x22, 0xF2]
All send/receive activity is performed by the same functions - so it does not appear that my code is improperly sending or translating the responses.

User avatar
tijmenvangulik
500m Poster
Posts: 64
Joined: November 25th, 2012, 10:24 am

Re: CSAFE + BLE Characteristic

Post by tijmenvangulik » January 17th, 2016, 11:41 am

Hi,

Have you found a fix for this problem or a response from concept 2 ? I get the same strange values and I can not see an work around.

Tijmen

tussocky
Paddler
Posts: 6
Joined: December 4th, 2021, 5:14 am

Re: CSAFE + BLE Characteristic

Post by tussocky » December 4th, 2021, 5:38 am

tijmenvangulik wrote:
January 17th, 2016, 11:41 am
Hi,

Have you found a fix for this problem or a response from concept 2 ? I get the same strange values and I can not see an work around.

Tijmen
Here I am having this problem 5 years later. Did you ever find a solution?

tussocky
Paddler
Posts: 6
Joined: December 4th, 2021, 5:14 am

Re: CSAFE + BLE Characteristic

Post by tussocky » January 28th, 2022, 5:31 am

Alright, after months of banging my head against the wall I found a solution. The "real" GOFINISHED command is C2 proprietary:

[0xF1, 0x76, 0x04, 0x13, 0x02, 0x01, 0x02, 0x60, 0xF2]

Locked