Add xcxbike: proprietary FFF0/FFF6 telemetry bike and detection before FTMS - #4908
Closed
cagnulein wants to merge 2 commits into
Closed
Add xcxbike: proprietary FFF0/FFF6 telemetry bike and detection before FTMS#4908cagnulein wants to merge 2 commits into
cagnulein wants to merge 2 commits into
Conversation
Owner
Author
|
Mail blazsona |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
XCX-001048) expose a broken FTMS implementation while providing correct telemetry on a proprietaryFFF0/FFF6channel, so they must not be handled via generic FTMS.FA 05FFF6 packets and expose speed, cadence, watts, energy, resistance and distance without inventing control commands.XCX-takes precedence over service-based FTMS detection so these peripherals are instantiated as the custom class rather thanftmsbike.Description
xcxbikewith header and source:src/devices/xcxbike/xcxbike.handsrc/devices/xcxbike/xcxbike.cpp, including an internalXcxTelemetrystruct and a safeparseTelemetry()parser that validates packet length and header bytes and decodes fields using little-endian helpers.0000FFF0-0000-1000-8000-00805F9B34FBand locatesFFF5(write) andFFF6(notify) by UUID; it enables notifications onFFF6by writing the CCCD01 00and does not send any writes toFFF5.speed = LE16(bytes 6..7) / 10.0,cadence = LE16(bytes 13..14),power = byte 17(low byte only, documented),distanceRaw = LE24(bytes 8..10)and code usesdistance = distanceRaw / 10.0(km) rather than the firmware's FTMS metres interpretation.XCX-name branch insrc/devices/bluetooth.cppplaced before the generic FTMS handling soXCX-devices are constructed asxcxbike.devices/xcxbike/xcxbike.cppanddevices/xcxbike/xcxbike.htosrc/qdomyos-zwift.pri.tst/Devices/TestXcxBikeParser.handtst/Devices/TestXcxBikeParser.cpp(four supplied capture packets + rejection cases) and registeredXCX-001048in device test data index to expectxcxbikeand explicitly excludeftmsbike.forceResistance, start/stop and FTMS control are not used or emulated;watts()returns zero when cadence is zero in line with repository conventions.Testing
git diff --cached --checkand repository grep checks to confirm no forbidden writes or accidental FTMS usage are present in the newxcxbikecode (nowriteCharacteristic/2ad2/1826/ftmsusages introduced). — succeeded.XCX-branch appears before theftmsbikecreation and instantiatesxcxbikein that code path. — succeeded.tst/Devices/TestXcxBikeParser.*were added to the test suite (tst/qdomyos-zwift-tests.pro) but the full Google Test build/run was not executed because the Qt build tools (qmake) and Qt development environment are not available in the execution environment. — not run due to missingqmake/Qt.make_prhelper and run a packaged MCP helper failed due to environment/network restrictions; these are orthogonal to the code changes and do not affect the implementation or parser verification performed above.Files changed (high level):
src/devices/xcxbike/{xcxbike.h,xcxbike.cpp},src/devices/bluetooth.cpp,src/devices/bluetooth.h,src/qdomyos-zwift.pri,tst/Devices/TestXcxBikeParser.*,tst/Devices/deviceindex.*,tst/Devices/devicetestdataindex.cpp.If you want, I can run the full unit test build and/or tighten name-matching rules (e.g., restrict to
XCX-001048) once a Qt/toolchain-enabled environment is available.Codex Task