Skip to content

feat(sbp2): expose the current session and command ABI to the app#85

Draft
gly11 wants to merge 3 commits into
mrmidi:mainfrom
gly11:sbp2/app-diagnostics
Draft

feat(sbp2): expose the current session and command ABI to the app#85
gly11 wants to merge 3 commits into
mrmidi:mainfrom
gly11:sbp2/app-diagnostics

Conversation

@gly11

@gly11 gly11 commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • expose the current SBP-2 address-space and session selectors (46-49 and 52-60) through the Swift connector
  • encode/decode the native-endian 20-byte command request and 16-byte result ABI
  • size destructive command-result reads from the requested transfer length (up to 16 MiB) plus sense data
  • show discovered SBP-2 unit metadata in the device detail UI
  • add wire-format and Epson scanner metadata regression tests

Why this replaces the older fork PRs

This consolidates the still-useful parts of gly11#7 and gly11#9.

The old connector used selectors 53-61, but current main uses 52-60 and reserves selector 61 for the developer bus-reset request. It also used a fixed 512-byte command-result buffer. Current main consumes a result on read, so retrying after kIOReturnNoSpace would lose a large READ result. This version validates the request first and allocates the full result capacity before the destructive read.

Validation

Committed PR branch

  • 9 focused Swift tests pass (selector ABI, request/result wire codec, 16 MiB bound, malformed result handling, Epson GT-X970 metadata)
  • complete ASFWTests suite passes
  • unsigned Debug macOS build passes
  • no new warnings originate from the added files
  • GitHub Build and Test check: passed

Live read-only MCP follow-up

With the #84 driver installed and the MCP server running, local follow-up MCP changes were exercised against the Epson V750 Pro / GT-X970 unit:

  • MCP health reported ready
  • asfw_sbp2_list_units discovered GUID 0x00004800004D438D
  • asfw_sbp2_inspect_unit decoded ROM offset 0xF and LUN 0
  • the focused MCP test slice passed 20/20

These MCP follow-up changes are still local and are not included in this PR's current head. They should be submitted separately rather than silently expanding this PR.

Remaining hardware coverage

  • app-owned SBP-2 session and command execution through the new ABI has not yet been validated
  • asfw_sbp2_get_session_status correctly reports capabilityUnavailable from a different MCP/user-client owner because live session state is owner-scoped
  • ModernCoolScan end-to-end validation remains pending

This PR therefore remains a draft.

CI organization

Shared CI workflow cleanup is tracked separately in #88. After #88 merges, this branch should be rebased onto main so the duplicated CI commits can be dropped cleanly.

@gly11
gly11 force-pushed the sbp2/app-diagnostics branch from 417b5ec to 5d68165 Compare July 26, 2026 09:24
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