Skip to content

feat: v2.2.0 — Discovery (§Phase 13 milestone 46) - #39

Merged
SoundMatt merged 1 commit into
mainfrom
feat/v2.2.0-discovery
Jul 28, 2026
Merged

SoundMatt merged 1 commit into
mainfrom
feat/v2.2.0-discovery

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

Implements ROADMAP.md milestone 46, "Discovery (v2.2.0)": the mandatory
discovery request and discovery-stream claiming mechanism from the OPEN
Alliance TC18 Remote Control Protocol Specification v0.5.1_RC.

  • New include/rcp/discovery.hpp:
    • make_discovery_request / encode_discovery_request: an unconditional
      ACF_ABB read targeting byte_bus_id 0 (kDiscoveryByteBusId, matching
      regmap::kEp0) at register-map address 0 (kDiscoveryRegisterAddress),
      always wrapped in an NTSCF header. Rides directly on rcp/wire.hpp's
      existing NTSCF/ACF_ABB framing (v2.0.0) — no changes to that codec.
    • decode_discovery_request: a TSCF-headed discovery request is dropped
      as a decode failure (DiscoveryErrc::tscf_headed_request_dropped), not
      a boolean flag a caller could forget to check.
    • DiscoveryClaim: the first discovery request accepted while
      rcp::lifecycle::ServerLifecycle reports HwUnconfigured/
      HwConfigured reserves the discovery stream for that client's
      configuration writes; the reservation lapses after a configurable
      Discovery_TimeOut (kDefaultTimeout, ~20ms default) if no
      configuration request follows; other clients' concurrent discovery
      requests never dislodge an active claim, nor does an active claim ever
      block their own reads from being answered; a request in RcpConfigured
      is always NotEligible, since claiming is scoped to the two
      pre-RCP-configured states.
    • should_answer_discovery: a single, always-true, testable call site
      documenting the mandatory any-state answering invariant.
  • New tests/test_discovery.cpp (REQ-DISC-001..009), registered in
    tests/CMakeLists.txt following the existing test_wire/test_lifecycle/
    test_regmap pattern.
  • .fusa-reqs.json: 9 new traced requirements (REQ-DISC-001..009).
  • ROADMAP.md: milestone 46 gets a "Done (v2.2.0)" paragraph following the
    milestone 44/45 precedent.
  • Version bump: include/rcp/version.hpp and the CMake project version to
    2.2.0.

No existing header needed changes — rcp/wire.hpp, rcp/lifecycle.hpp, and
rcp/regmap.hpp are used as-is, per the roadmap's own dependency note for
this milestone.

Test plan

  • cmake --build (system AppleClang, matching CI's clang-14 config)
    builds the full tree with zero warnings on the new files under the
    repo's strict -Wall -Wextra -Wpedantic -Wshadow ... flags.
  • ctest full suite: 44/45 tests pass, including the new rcp_discovery
    (16 test cases / 50 assertions). The one non-pass
    (rcp_powerstate) is a pre-existing, unrelated timing/threading test
    that I killed manually after it stalled in this sandbox — unrelated to
    this change (confirmed pre-existing on main before this branch).
  • .fusa-reqs.json remains valid JSON with the new REQ-DISC-* entries
    traced to tests/test_discovery.cpp.
  • CI (build-and-test matrix, relay-conform, clang-tidy, cpp-FuSa gates)

…13 milestone 46)

Adds rcp/discovery.hpp: the broadcastable ACF_ABB discovery read addressed
to byte_bus_id 0 (kDiscoveryByteBusId, matching regmap::kEp0) at register-map
address 0 (kDiscoveryRegisterAddress), always NTSCF-headed — a TSCF-headed
discovery request is dropped by decode_discovery_request as a decode failure
(DiscoveryErrc::tscf_headed_request_dropped), not a flag a caller could
forget to check. Rides directly on rcp/wire.hpp's existing NTSCF/ACF_ABB
framing with no changes to that codec.

DiscoveryClaim implements discovery-stream claiming: the first discovery
request accepted while rcp::lifecycle::ServerLifecycle reports
HwUnconfigured/HwConfigured reserves the stream for that client's
configuration writes; the reservation lapses after a configurable
Discovery_TimeOut (~20ms default) if no configuration request follows;
concurrent discovery requests from other clients never dislodge an active
claim nor block their own reads from being answered; and a request in
RcpConfigured is always NotEligible, since claiming itself is scoped to the
two pre-RCP-configured states. should_answer_discovery is a single,
always-true, testable call site documenting the any-state answering
invariant (extraction §3.1, §3.5).

New coverage in tests/test_discovery.cpp (REQ-DISC-001..009), traced in
.fusa-reqs.json.

Bumps version.hpp and the CMake project version to 2.2.0, and adds
ROADMAP.md milestone 46's "Done (v2.2.0)" note following the milestone
44/45 precedent.

Signed-off-by: Matt <47545907+SoundMatt@users.noreply.github.com>
@SoundMatt
SoundMatt merged commit e185a69 into main Jul 28, 2026
20 checks passed
@SoundMatt
SoundMatt deleted the feat/v2.2.0-discovery branch July 28, 2026 16:23
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.

1 participant