Skip to content

Toggle the CAN logger over BLE and report its address #51

Description

@Tichael

Part of #10, which has the design and open questions. Needs OpenCarControls/contracts#27 merged (and its pin bumped) first. Builds on #22 (PR #44).

#22 starts the SavvyCAN listener whenever [network.can_logger] enabled = true. Make it a runtime toggle instead, controlled by the app over BLE.

  • Handle SetCanLoggerEnabled in the BLE dispatcher (a SystemCommand: BLE only, dropped from MQTT). Bonded phone and controller-lease rules as for the other system commands.
  • A runtime "logger enabled" flag in core-interface, off at every boot. While off, the board listener does not accept connections. Turning it on opens the listener; turning it off ends any session (buses released) and closes the listener.
  • Build config becomes "compiled in", on by default. When the board has no WiFi (LTE doesn't count, for security reasons), skip the logger quietly instead of failing the build. Update config.toml.example and the docs.
  • Report the logger state in SystemState: enabled, client connected, port, and the IPv4 address. ESP: the WiFi station address from the embassy-net stack (WiFi interface only). PC: the listener binds all interfaces, so report a best-effort address.
  • Safety: the dev read-only toggle from Report CAN bus health and add the dev read-only toggle #27 must not be able to unlock the buses while logging; keep the existing forced read-only and relock-after-session behaviour. Coordinate with Report CAN bus health and add the dev read-only toggle #27, which also adds system state and a system command.
  • Host tests for the flag, the dispatch (including MQTT being refused), disable-ends-session, and the state fields. ESP code can't be built in every environment; say what was and wasn't verified.
  • Update docs/can.md, docs/ble.md and docs/architecture.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions