Skip to content

Releases: nemarpuc/libaoahid

v4.0.1

Choose a tag to compare

@github-actions github-actions released this 29 Sep 10:25

libaoahid 4.0.1

No library code changed. Hardware-verified on a Samsung Galaxy Tab S11 and a
POCO F6 Pro (Windows 10 x64 and Arch Linux): the profiles and paths marked
Verified in docs/TARGET_MATRIX.md; every other row is still unverified.

Documentation

  • README: a Demo section with a video of aoahid_player, an app built on this
    library.
  • docs/TARGET_MATRIX.md: rows 1, 2, 3 and 6 of the accessory mode and Bulk
    Channel table are verified on hardware (Samsung Galaxy Tab S11 and POCO F6
    Pro, on Windows 10 x64 and Arch Linux).
  • docs/TARGET_MATRIX.md: Keyboard, Mouse, Consumer Toggle, all three
    Gamepad D-pad forms, and fixed-MT Touchscreen took effect on the same
    hardware (Application API column).
  • docs/PORTING.md: the Samsung-on-Windows driver note is a hardware
    observation, not a user report.

v4.0.0

Choose a tag to compare

@github-actions github-actions released this 28 Sep 12:15

libaoahid 4.0.0

Changed (breaking)

  • aoahid_device_open sends no AOA request. It no longer sends request 51 to
    re-check the version, so it no longer returns AOAHID_ERR_NOT_AOA or a
    version error. A device without AOA 2.0 HID opens and then fails at
    aoahid_node_open with AOAHID_ERR_STALL.
  • The library applies no AOA version policy. aoahid_discover still sends
    request 51 to each device and lists those with a nonzero version; the new
    aoahid_device_info.protocol_version reports that version, and the caller
    decides what to open. A caller that fills aoahid_device_info itself sends
    no request 51 at all, which also avoids Android's accessory-handshake
    broadcast (SOURCE_CONFLICTS.md T-12).
  • aoahid_device_info gains protocol_version. It fits in existing padding,
    so the size and the offsets of serial and product are unchanged.
  • aoahid_device_options drops every member that did nothing:
    startup_mode, accept_future_protocol_versions,
    reenumeration_timeout_ms, first_report_attempts,
    first_report_backoff_us, accessory_strings, and
    enable_deprecated_audio_mode. validate_reports moves to the end so the
    structure has no interior padding. Rebuild every caller against this header.
  • Removed: aoahid_device_protocol_version(), aoahid_startup_mode,
    AOAHID_START_CURRENT_USB_MODE, AOAHID_START_ACCESSORY_MODE, and
    AOAHID_ERR_VERSION (code 5 is now unassigned; no other code changes). Use
    aoahid_accessory_start to switch a device to accessory mode.
  • The shared library is libaoahid.so.4 with the AOAHID_4.0 symbol node.
  • The Python, C#, and Rust bindings follow the new layouts and drop the
    removed names. The C#, Python, Rust, and C examples print each device's AOA
    version and refuse a version below 2 themselves.

Documentation

  • The guide, API, design, and example documents describe probe-free open and
    caller-side version checks, and no longer describe ABI placeholders. The
    guide's first-report policy now matches the library, which has never retried
    since 2.0.0.

Verification status

Fake-backend tests only (the dev, TSan, and ASan/UBSan configurations).
Nothing is hardware-verified.

v3.0.5

Choose a tag to compare

@github-actions github-actions released this 28 Sep 00:54

libaoahid 3.0.5

Changed

  • Reports are serialized a byte at a time instead of a bit at a time, about
    2.9 times faster for a 16-contact touchscreen report (766 ns to 267 ns on
    one x86-64 machine). The bytes on the wire are unchanged; the new encoder
    was checked against the old one over 2,000,000 random fields.
  • Internal cleanups with no behavior change: unused parameters, a duplicated
    protocol-version check, and setup-packet fields rewritten on every submit
    although acquiring the transfer slot had already written them.

Fixed

  • examples/c/verify: a failure could print "no field" and "no reason"
    instead of the failing call's diagnostic, because aoahid_result_name()
    clears the last-error record and C leaves argument evaluation order
    unspecified. The record is now read first.
  • On Linux, the shared library now relinks when cmake/aoahid.map changes,
    as the Apple build already did for its export list.
  • The integration tests compile with Clang 22: the replacement
    operator delete overloads in tests/integration/test_transport.cpp no
    longer take top-level const parameters.

Documentation

  • README: the ADB section no longer suggests adb connect localhost:5555, a
    port the adb server scans for emulators, and describes how
    aoahid_adb_proxy works (a Channel on the application's own USB handle).
  • QUICKSTART: AOAHID_USE_FAKE_LIBUSB is OFF unless a test configuration
    turns it on, and aoahid_verify_all is listed with the other verify
    programs. examples/README.md lists touchpad.c.

Verification status

Fake-backend tests only (the dev, TSan, and ASan/UBSan configurations, and a
Clang build). Nothing is hardware-verified.

v3.0.4

Choose a tag to compare

@github-actions github-actions released this 27 Sep 12:27

libaoahid 3.0.4

Changed

  • The repository is renamed from nemarpuc/Libaoa_hid to
    nemarpuc/libaoahid, matching the library (libaoahid), header
    (aoahid.h), and CMake package (aoahid) names. Package metadata, release
    validation (AOAHID_EXPECTED_REPOSITORY), and documentation links use the
    new name. GitHub redirects the old URLs; the Pages URL is now
    https://nemarpuc.github.io/libaoahid/. The library is unchanged.
  • 3.0.3 was tagged, but its release did not publish because the repository
    was renamed while the release job ran. 3.0.4 contains all of 3.0.3.

Verification status

No library code changed. Nothing is hardware-verified.

v3.0.2

Choose a tag to compare

@github-actions github-actions released this 27 Sep 09:04

libaoahid 3.0.2

Fixed

  • On Windows, a Channel on the interface that libusb's WinUSB backend
    auto-claims for control transfers (typically ADB) could lose its claim when
    a HID report transfer in flight during aoahid_channel_open completed.
    aoahid_channel_open now waits, within the Device's close_drain_timeout_ms,
    until no report transfer is in flight before it claims the interface, and
    returns AOAHID_ERR_TIMEOUT if one still is. aoahid_channel_close waits
    the same way (best effort) before releasing it. See FACT_AUDIT.md A-25.

Verification status

Fake-backend tests only. Nothing is hardware-verified.

v3.0.1

Choose a tag to compare

@github-actions github-actions released this 27 Sep 00:38

libaoahid 3.0.1

Packaging

  • Linux archives record how the bundled libusb was built from the bundled
    source (libusb_build in share/doc/libaoahid/build-metadata.json), and
    THIRD_PARTY_NOTICES.md points to it. The library itself is unchanged.

Verification status

No library code changed. Nothing is hardware-verified.

v3.0.0

Choose a tag to compare

@github-actions github-actions released this 23 Sep 20:35

libaoahid 3.0.0

Added

  • aoahid_channel_options.read_mode and aoahid_channel_read_mode.
    AOAHID_CHANNEL_READ_STREAM (zero) keeps the read-ahead byte stream.
    AOAHID_CHANNEL_READ_REQUEST submits no read-ahead. Instead, a read with
    nothing buffered submits one IN transfer of its capacity, rounded up to
    wMaxPacketSize and capped at transfer_bytes, the way host adb reads a
    length-prefixed payload. A request completes as soon as it is full, so a
    packet-aligned message with no zero-length packet no longer waits for more
    data. A timeout leaves the request pending for the next read, so no byte is
    lost.
  • The Python, C#, and Rust bindings expose the new field and constants.

Changed (breaking)

  • aoahid_channel_options grows by one 32-bit field, so its struct_size
    changes. Rebuild every caller against this header. Zero keeps the 2.x
    behavior.

Documentation

  • docs/API.md explains when a stream-mode read waits (a Bulk IN transfer
    completes only when full or on a short packet), with AOSP adb references.

Verification status

Verified with fake-libusb tests (request sizing, pending timeout, buffered
remainder, zero-length packet, unplug), plus ASan/UBSan and ThreadSanitizer.
Nothing is hardware-verified.

v2.0.1

Choose a tag to compare

@github-actions github-actions released this 23 Sep 08:41

libaoahid 2.0.1

Removed

  • docs/ARCHITECTURE_USB_HUB.md, which still described a rejected automatic
    design and an unimplemented ADB-server plan. docs/API.md now cites the
    Android 10-second accessory-request timeout directly from AOSP
    UsbDeviceManager.java.
  • An unused internal Channel query and two fake-libusb test helpers left over
    from that rejected design. No public function, structure, value, or behavior
    changes; the ABI is identical to 2.0.0.

Verification status

Documentation and dead-code removal only. Nothing is hardware-verified; the
accessory-mode and Channel hypotheses in docs/TARGET_MATRIX.md remain
[unverified on hardware], and every profile remains not hardware-verified.

v2.0.0

Choose a tag to compare

@github-actions github-actions released this 23 Sep 07:36

libaoahid 2.0.0

Changed (breaking)

  • The library never retries a transfer. The first report after
    aoahid_node_open used to be resent automatically after a STALL (default 20
    attempts, 1 ms apart); it is now sent once and AOAHID_ERR_STALL is returned.
    A STALL means the target refused request 57 (f_accessory stalls while the
    HID ID is not yet registered), so the refused state now stays pending and the
    caller's next submit resends it; timeouts, cancellations, and I/O errors still
    consume the submitted state because delivery is unknown.
    first_report_attempts and first_report_backoff_us stay in
    aoahid_device_options for layout compatibility and are ignored.
    examples/c/verify/verify_common.h shows a bounded caller-side resend.
  • SOVERSION 2 (libaoahid.so.2) with the ELF symbol-version node
    AOAHID_2.0, because the change above alters documented behavior.

Added

  • aoahid_accessory_start with aoahid_accessory_options: sends AOA requests
    51, 52 (the caller's aoahid_aoa_strings; a nonempty manufacturer and model
    are required, each at most 256 bytes including its NUL as AOA 1.0 specifies,
    checked before any request), and 53 to a device in its current USB mode, then
    closes it and returns. It never waits for re-enumeration and never retries. The
    application rediscovers the accessory-mode device (VID 0x18D1, PID
    0x2D00-0x2D05) and opens it with the unchanged aoahid_device_open. A
    device already in accessory mode receives no request. There is no call that
    leaves accessory mode.
  • Bulk Channels on a Device: aoahid_channel_open, aoahid_channel_read,
    aoahid_channel_write, aoahid_channel_close, and aoahid_channel_options.
    A Channel selects configuration 1 only on an unconfigured device (AOA 1.0),
    claims the first interface with the requested class triple (for example ADB
    0xFF/0x42/0x01) on the Device's own USB handle, keeps IN
    transfers submitted ahead of the reader, uses a transfer pool separate from
    HID, reads as a byte stream, back-pressures writes, and can end a write with
    an explicit zero-length packet that behaves the same on every backend. Read
    and write take no lock and allocate nothing. Channels follow the Node close
    rules, and aoahid_device_close also closes them.
  • examples/c/verify/verify_accessory.c: switches the first phone to
    accessory mode, types one letter, and opens an ADB Channel when USB debugging
    is on.
  • C, Python, C#, and Rust declarations for every new function and structure.

Changed

  • Every USB handle is owned by one internal Port shared by the Device and its
    Channels. aoahid_discover probes a device that an open Device already holds
    through that handle instead of opening it a second time (WinUSB refuses a
    second open). aoahid_accessory_start likewise borrows an open Device's
    handle.
  • docs/API.md now describes the aoahid_toggle release rule introduced in
    1.0.0 (usage must be 0 or the pressed Usage).
  • udev/51-aoahid.rules comments describe the accessory-mode VID/PID range
    that aoahid_accessory_start produces; the rules themselves are unchanged.

Verification status

The new accessory start and Bulk Channels are tested only against the
deterministic fake libusb backend (including ThreadSanitizer runs and an
allocation probe of Channel read/write). None of it is hardware-verified: the
ten accessory-mode and Channel hypotheses in docs/TARGET_MATRIX.md,
including re-enumeration, HID in accessory mode, ADB next to HID on one handle
on Linux and Windows, and the first-report STALL behavior without library
retry, are recorded as [unverified on hardware]. No profile's status in
TARGET_MATRIX.md changes: every profile remains not hardware-verified.

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 22 Sep 13:34

libaoahid 1.0.0

Added

  • examples/c/verify/verify_toggle.c and verify_battery.c, joining
    verify_keyboard/verify_touch/verify_mouse/verify_all as
    human-observable real-device verification programs (see
    docs/QUICKSTART.md). verify_toggle fires four Consumer Control Usages
    in turn (Play/Pause, Volume Increment, Mute, "AC New") for a media app to
    react to, deliberately excluding System Control Usages that could suspend
    or power off the phone mid-test. verify_battery sends a low/mid/high
    Battery Strength sequence and the explicit unknown (Null) state; unlike
    every other program here it produces no getevent output by design, so
    confirming it means checking adb shell dumpsys battery and
    /sys/class/power_supply instead.

Fixed

  • aoahid_toggle(node, usage, 0) (release) silently ignored usage
    entirely, always releasing whichever Usage was currently pressed
    regardless of what was passed. A caller that lost track of which Usage it
    had pressed could release the wrong one -- or release nothing, if nothing
    was pressed -- with no indication anything was wrong. usage on release
    must now be either 0 (release whichever Usage is pressed, for a caller
    that never tracked it -- the prior behavior, kept as an explicit opt-in)
    or the Usage actually pressed; a different nonzero Usage is rejected with
    AOAHID_ERR_PARAM instead of silently doing the wrong thing.
  • examples/c/verify/verify_toggle.c did not set
    aoahid_toggle_options.expected_linux_event_types/expected_linux_codes,
    two of the four required parallel arrays (see examples/c/profiles/toggle.c
    for the reference shape), so aoahid_spec_create_toggle always failed with
    AOAHID_ERR_UNSET_FIELD and the program could never run.

Verification status

verify_toggle and verify_battery were each run once against one physical
Samsung Android target after the fixes above, confirming both now run to
completion without error; verify_toggle's Play/Pause, Volume Increment, and
Mute were also each observed changing that target's foreground media app.
This falls well short of TARGET_MATRIX.md's "Minimum per-profile cases" for
either profile (every allowed Usage under foreground/background/screen-off,
zero re-arm, and -- for Battery -- the declared minimum/midpoint/maximum plus
power_supply/application-API association), so this release changes no
profile's status in TARGET_MATRIX.md: Toggle and Battery Strength remain
not hardware-verified, same as every other profile. The usage-on-release
fix and both new example programs touch neither the wire format nor the
generated descriptor of any profile.