Skip to content

feat(yiciyuan): correct FJB-02/03 support and add host rotation modes - #956

Open
xmsama wants to merge 2 commits into
buttplugio:masterfrom
xmsama:pr/yiciyuan-runtime
Open

xmsama wants to merge 2 commits into
buttplugio:masterfrom
xmsama:pr/yiciyuan-runtime

Conversation

@xmsama

@xmsama xmsama commented Sep 24, 2026

Copy link
Copy Markdown

Summary

Implements the Yiciyuan protocol/runtime-mode scope approved in #954, extending #917 and the FJB-03 findings in #888.

Depends on #955. This branch contains its prerequisite commit followed by a separate Yiciyuan commit. The prerequisite remains in the aggregate diff until #955 is merged.

Protocol changes

  • Restrict FJB-02 to one Oscillate output and battery input. Stroke and rotation are mechanically coupled; device-info responses report motor A only.
  • Add FJB-03 detection and model-specific frames: A controls coupled stroke/rotation, B controls suction (Constrict), and C controls independent vibration.
  • Encode FJB-03 A amplitude as 1..20 in one direction or 21..40 in the opposite direction; reserve 0 for stop. Do not map unsigned intensity continuously across both direction ranges.
  • Send C through 35 11 04 N checksum, exposing seven fixed modes. Reapply active C after A/B writes, and keep the two packet families distinct during coalescing.
  • Subscribe to FF42, issue model-specific device-info queries, and retain the notification subscription for the connection lifetime.
  • Enable latest-state scheduling for FJB-02/03. FJB-03 has no artificial output pacing or zero-value hold; FJB-02 retains its configured pacing, defaulting to 75 ms.
  • Permit model-level message_gap_ms in the configuration schema and regenerate the bundled device configuration.

Host-side rotation modes

  • Add per-address Forward, Reverse, and Alternate settings without changing the unsigned client-facing Oscillate command.
  • Apply mode changes between write batches. Cancel the previous cycle, write zero, wait for the reversal pause, and resume with the latest amplitude. A stopped output must remain stopped.
  • Keep transition timers, direction encoding, and validation in the backend. Client waveforms do not select direction through amplitude or slope.

The Rust settings API is submitted for design review. It does not alter advertised device features, add a wire-protocol command, reload device definitions, or simulate reconnection. Central UI, persistence, and engine-time configuration reload are excluded, consistent with the feedback in intiface/intiface-central#287.

Hardware validation

Tested on physical YCY-FJB-02 and YCY-FJB-03:

  • FJB-02 coupled stroke/rotation and single-output capability.
  • FJB-03 coupled A motion, B suction, and independent C vibration activation.
  • Opposite FJB-03 rotation directions, compared with the official app.

Independent vibration activation was verified, not every fixed mode. The latest runtime-switching implementation has software coverage but has not been hardware-verified. FJB-02 connection stability improved after connecting the motherboard's external antenna; that improvement is not attributed solely to software.

Automated validation

Windows, Rust 1.96.0:

  • cargo test -p buttplug_server --lib: 67 passed.
  • cargo test -p buttplug_tests --test test_device_protocols: 871 passed.

Suite totals include initialization ordering/error/timeout tests, packet/checksum tests, stop ordering, mode transitions, and legacy/current client protocol fixtures. Non-Windows builds and physical stop delivery after link loss are not verified.

Virtual Linear, Linear observation routing, YS-TD models, and Windows Bluetooth connection-retry changes are excluded.

@CLAassistant

CLAassistant commented Sep 24, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants