feat: expose the full v0.6.3.102 FFI surface - #56
Merged
Conversation
Sync framework-system-ffi-extensions v0.6.2.93 -> v0.6.3.102 (nested framework-system v0.6.4-3 -> v0.6.5-19) and wrap all 46 newly exported functions. The FFI grew from 44 to 90 entry points across two tranches: PD controller/charger/retimer info, GPIO, thermal thresholds and sensor names, Smart Battery, EC diagnostics (hello, sysinfo, protocol info, panic data, port 80 history, switches, AP throttle, ADC), hibernate delay, standalone mode, GPU serial, input controls, and nine handle-free HID/USB peripheral calls. Group the new EC surface into facets on IFrameworkEcConnection rather than flattening ~65 members onto one interface: Diagnostics, Gpio, Thermal, Battery, PowerDelivery, Input and PowerManagement. Each facet borrows the connection's handle through an accessor, so every call runs the same ObjectDisposedException check as the existing members. The nine handle-free calls go on a new IFrameworkPeripherals/FrameworkPeripherals pair, mirroring IFrameworkSystem/FrameworkSystem so they stay mockable. Handle FrameworkStatusCode.NotSupported (-9), added by this FFI release. It previously fell through to the default arm of the status mapping and surfaced as ArgumentOutOfRangeException; NVMe version readback on non-Linux hosts returns it, so it now maps to a dedicated FrameworkNotSupportedStatusException. Unlike DataUnavailable, it means the capability is not compiled in for the platform and is permanent. Notable correctness details, verified against upstream framework_lib: - Port 80 history: `writes` is the *next* write slot, so the newest entry is at (writes - 1) % history_size. The native ABI comment states writes % history_size, which names the oldest entry once the ring has wrapped. Partially filled rings expose only the slots actually written. - Retimer version is four raw I2C register bytes, not text. It is exposed as bytes plus a hex-quad VersionString matching upstream's rendering, and gated to Framework 16, whose expansion-bay command backs it. - Smart Battery capacities switch to 10 mWh units when BatteryMode bit 15 is set, so they are surfaced as parallel ElectricCharge?/Energy? sets selected by IsCapacityReportedInEnergyUnits rather than as a single mistyped quantity. - Per-key RGB is gated to Framework Desktop, which is what upstream documents; the Framework 16 keyboard is not EC-controlled. - RemapCapsLockToControl hardcodes the Framework 12 matrix position, so it is documented as model-specific rather than universal. Interface change: IFrameworkEcConnection gains seven facet properties. Existing members are untouched, so callers are unaffected, but external implementers of the interface must add them. Also update the CLI demo with read-only panels for every new facet, keeping Smart Battery and the audio card version out of the refresh loop because both are too expensive to poll, and add 21 hardware tests covering the new surface plus a hardware-free Port 80 ordering regression test. 41/41 pass on Framework hardware. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> To commit it as-is (this stages everything, including the submodule pointer bump to 40f98e0): git add -A && git commit -F - <<'EOF' feat: expose the full v0.6.3.98 FFI surface Sync framework-system-ffi-extensions v0.6.2.93 -> v0.6.3.98 (nested framework-system v0.6.4-3 -> v0.6.5-19) and wrap all 46 newly exported functions. The FFI grew from 44 to 90 entry points across two tranches: PD controller/charger/retimer info, GPIO, thermal thresholds and sensor names, Smart Battery, EC diagnostics (hello, sysinfo, protocol info, panic data, port 80 history, switches, AP throttle, ADC), hibernate delay, standalone mode, GPU serial, input controls, and nine handle-free HID/USB peripheral calls. Group the new EC surface into facets on IFrameworkEcConnection rather than flattening ~65 members onto one interface: Diagnostics, Gpio, Thermal, Battery, PowerDelivery, Input and PowerManagement. Each facet borrows the connection's handle through an accessor, so every call runs the same ObjectDisposedException check as the existing members. The nine handle-free calls go on a new IFrameworkPeripherals/FrameworkPeripherals pair, mirroring IFrameworkSystem/FrameworkSystem so they stay mockable. Handle FrameworkStatusCode.NotSupported (-9), added by this FFI release. It previously fell through to the default arm of the status mapping and surfaced as ArgumentOutOfRangeException; NVMe version readback on non-Linux hosts returns it, so it now maps to a dedicated FrameworkNotSupportedStatusException. Unlike DataUnavailable, it means the capability is not compiled in for the platform and is permanent. Notable correctness details, verified against upstream framework_lib: - Port 80 history: `writes` is the *next* write slot, so the newest entry is at (writes - 1) % history_size. The native ABI comment states writes % history_size, which names the oldest entry once the ring has wrapped. Partially filled rings expose only the slots actually written. - Retimer version is four raw I2C register bytes, not text. It is exposed as bytes plus a hex-quad VersionString matching upstream's rendering, and gated to Framework 16, whose expansion-bay command backs it. - Smart Battery capacities switch to 10 mWh units when BatteryMode bit 15 is set, so they are surfaced as parallel ElectricCharge?/Energy? sets selected by IsCapacityReportedInEnergyUnits rather than as a single mistyped quantity. - Per-key RGB is gated to Framework Desktop, which is what upstream documents; the Framework 16 keyboard is not EC-controlled. - RemapCapsLockToControl hardcodes the Framework 12 matrix position, so it is documented as model-specific rather than universal. Interface change: IFrameworkEcConnection gains seven facet properties. Existing members are untouched, so callers are unaffected, but external implementers of the interface must add them. Also update the CLI demo with read-only panels for every new facet, keeping Smart Battery and the audio card version out of the refresh loop because both are too expensive to poll, and add 21 hardware tests covering the new surface plus a hardware-free Port 80 ordering regression test. 41/41 pass on Framework hardware.
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.
Sync framework-system-ffi-extensions v0.6.2.93 -> v0.6.3.102 (nested framework-system v0.6.4-3 -> v0.6.5-19) and wrap all 46 newly exported functions. The FFI grew from 44 to 90 entry points across two tranches: PD controller/charger/retimer info, GPIO, thermal thresholds and sensor names, Smart Battery, EC diagnostics (hello, sysinfo, protocol info, panic data, port 80 history, switches, AP throttle, ADC), hibernate delay, standalone mode, GPU serial, input controls, and nine handle-free HID/USB peripheral calls.
Group the new EC surface into facets on IFrameworkEcConnection rather than flattening ~65 members onto one interface: Diagnostics, Gpio, Thermal, Battery, PowerDelivery, Input and PowerManagement. Each facet borrows the connection's handle through an accessor, so every call runs the same ObjectDisposedException check as the existing members. The nine handle-free calls go on a new IFrameworkPeripherals/FrameworkPeripherals pair, mirroring IFrameworkSystem/FrameworkSystem so they stay mockable.
Handle FrameworkStatusCode.NotSupported (-9), added by this FFI release. It previously fell through to the default arm of the status mapping and surfaced as ArgumentOutOfRangeException; NVMe version readback on non-Linux hosts returns it, so it now maps to a dedicated FrameworkNotSupportedStatusException. Unlike DataUnavailable, it means the capability is not compiled in for the platform and is permanent.
Notable correctness details, verified against upstream framework_lib:
writesis the next write slot, so the newest entry is at (writes - 1) % history_size. The native ABI comment states writes % history_size, which names the oldest entry once the ring has wrapped. Partially filled rings expose only the slots actually written.Interface change: IFrameworkEcConnection gains seven facet properties. Existing members are untouched, so callers are unaffected, but external implementers of the interface must add them.
Also update the CLI demo with read-only panels for every new facet, keeping Smart Battery and the audio card version out of the refresh loop because both are too expensive to poll, and add 21 hardware tests covering the new surface plus a hardware-free Port 80 ordering regression test. 41/41 pass on Framework hardware.
Co-Authored-By: Claude Opus 5 noreply@anthropic.com
To commit it as-is (this stages everything, including the submodule pointer bump to 40f98e0):
git add -A && git commit -F - <<'EOF'
feat: expose the full v0.6.3.98 FFI surface
Sync framework-system-ffi-extensions v0.6.2.93 -> v0.6.3.98 (nested framework-system v0.6.4-3 -> v0.6.5-19) and wrap all 46 newly exported functions. The FFI grew from 44 to 90 entry points across two tranches: PD controller/charger/retimer info, GPIO, thermal thresholds and sensor names, Smart Battery, EC diagnostics (hello, sysinfo, protocol info, panic data, port 80 history, switches, AP throttle, ADC), hibernate delay, standalone mode, GPU serial, input controls, and nine handle-free HID/USB peripheral calls.
Group the new EC surface into facets on IFrameworkEcConnection rather than flattening ~65 members onto one interface: Diagnostics, Gpio, Thermal, Battery, PowerDelivery, Input and PowerManagement. Each facet borrows the connection's handle through an accessor, so every call runs the same ObjectDisposedException check as the existing members. The nine handle-free calls go on a new IFrameworkPeripherals/FrameworkPeripherals pair, mirroring IFrameworkSystem/FrameworkSystem so they stay mockable.
Handle FrameworkStatusCode.NotSupported (-9), added by this FFI release. It previously fell through to the default arm of the status mapping and surfaced as ArgumentOutOfRangeException; NVMe version readback on non-Linux hosts returns it, so it now maps to a dedicated FrameworkNotSupportedStatusException. Unlike DataUnavailable, it means the capability is not compiled in for the platform and is permanent.
Notable correctness details, verified against upstream framework_lib:
writesis the next write slot, so the newest entry is at (writes - 1) % history_size. The native ABI comment states writes % history_size, which names the oldest entry once the ring has wrapped. Partially filled rings expose only the slots actually written.Interface change: IFrameworkEcConnection gains seven facet properties. Existing members are untouched, so callers are unaffected, but external implementers of the interface must add them.
Also update the CLI demo with read-only panels for every new facet, keeping Smart Battery and the audio card version out of the refresh loop because both are too expensive to poll, and add 21 hardware tests covering the new surface plus a hardware-free Port 80 ordering regression test. 41/41 pass on Framework hardware.