Repository navigation
fix(bluetooth): decode the short live frame sent by PICOOC-CC - #1565
dferrandizmont wants to merge 2 commits into
Conversation
The PICOOC-CC sends a 10-byte 0x39 frame (timestamp, weight, impedance) instead of the 16-byte one, so parseLiveFrame rejected it and no measurement was ever stored. Recognise it by its length byte and treat it as a settled reading.
|
Same failure on a PICOOC-S3 — the short frame is not CC-specific. openScale 3.1.3-debug, the scale advertises as What the frame contains:
Barefoot, the same 10-byte layout carries a real reading: So the layout matches your CC capture byte for byte, and the fix you describe covers the S3 as well. What needs to be done (I tested this locally on the scale; no patch attached, since it is your PR):
With those four things the S3 stores the weight and, in the barefoot capture, the derived composition. |
…atalog The PICOOC-S3 uses the same 10-byte live frame as the CC. Add its captured frames (barefoot and with socks, where impedance is 0 and only the weight is stored) and give both models their own row in the scale catalog.
|
Thanks a lot for trying it on the S3 and sharing the captures, good to know it's the same frame and not just a CC quirk. Points 1–3 were already in the PR exactly like that. I've pushed c2fb071 for the rest:
|
My PICOOC-CC connects fine on 3.1.3 and goes through the whole handshake, but nothing ever gets saved. The log shows why:
This model sends a shorter live frame: opcode, length, the timestamp from our time reply, weight ×20 and impedance ×10, and that's it (no pounds/unit/phase/flag). In that capture it's 82.3 kg and 449.0 Ω. It only comes once, after the profile exchange, and the scale hangs up a few seconds later, so it's already the settled reading.
Full session from the log:
No 0x32 or 0x3C ever arrives, so composition comes from StandardImpedanceLib.
The fix makes
parseLiveFramerecognise the short layout by its length byte (0x0A) and treat it as complete. A truncated 16-byte frame is still rejected since its length byte is 0x10. I added a parser test with the captured frame and a replay of the CC session that expects a single record.Tested with a debug build on my scale (Pixel 10 Pro, Android 17): the measurement is stored with weight, impedance and the estimated composition.
PicoocHandlerTestpasses.