CSAFE + BLE Characteristic
Posted: 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:
I was expecting to receive something along the lines a properly formed response:
Another example SETPROGRAM (the command was successful):
GOINUSE is different, though sending it does cause the PM5 to begin the SETPROGRAM workout:
GOFINISHED is different still, and does not cause an active workout to end:
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.
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)
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)
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?!?)
Can't figure out why this is happening.