usb_gadget 1.0.1
usb_gadget: ^1.0.1 copied to clipboard
Expose standard or fully custom USB peripherals (gadgets) through a USB device controller (UDC) on Linux.
Changelog #
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog], and this project adheres to [Semantic Versioning].
1.0.1 #
Changed #
- Update
lintsto 6.1.0 and includepackage:lints/recommended.yaml
Fixed #
- Add missing curly braces to control flow statements in
aio_stream.dartandnet.dart - Remove unnecessary
awaiton non-future ingadget/core.dart - Remove redundant
this.qualifier inendpoint/core.dart - Simplify
getConfigAttributesinNetworkFunctionusing null-aware syntax
1.0.0 #
Added #
UsbGadget.remove()to clean up configfs registrations without holding aRegGadgethandle- Integration tests for bulk transfers, ZLP, and endpoint halt via Python USB host driver
Changed #
- BREAKING:
RegGadget.bind()is nowvoid(wasFuture<void>) — call sites no longer needawait - BREAKING: Remove
RegGadget.unbindAll() - Move
gadget.register()insidetryblock; usegadget.remove()infinallyfor simplified lifecycle - Move USB Chapter 9 definitions (
descriptors,speeds,types) tolib/src/usb/ch9/sub-package - Simplify
Future.delayedcalls — remove redundant<void>type arguments - Simplify doc comments in
ErrnoandFunctionFs
Fixed #
- HID endpoint poll and report intervals corrected to 8ms for High-Speed USB compatibility (was 10ms, which is invalid for HS)
UDCbinding error now includes the target UDC name in the log message
0.7.0 #
Added #
writeWhilemethod for continuous AIO writesisDummyUDCproperty on UDCusb-gadgetCLI tool for managing Linux USB gadgets- Comprehensive UVC frame and control configuration support
- Expanded UAC1 and UAC2 audio function attributes
devicePath()method toHIDFunction- Unit and integration tests for kernel USB functions
- Integration tests for bulk transfers, ZLP, and endpoint halt
Changed #
- Rename
ffsmodule touserland - Rename
GadgetFunctionTypetoFunctionType - Rename
USBDeviceStatetoDeviceState - Rename
USBHIDDescriptortoHIDDescriptor - Remove legacy
USBSpeedtypedef - Overhaul gadget and configuration management
- Delegate UDC state management and simplify Gadget API
- Improve
Id,Class, andConfigAPI stability and validation - Introduce
FunctionFsInterfaceand improve descriptor handling - Introduce
ConfigFsTreefor robust gadget teardown - Make
prepare()asynchronous - Make
write()asynchronous and implement backpressure - Make
onDisablea synchronous method on HID - Replace
Comparableimplementation with comparison operators inSpeedenum - Tune AIO buffer sizing
- Update examples to use
writeWhileand improve lifecycle handling - Rewrite ping/pong example to support large transfers and benchmarking
Fixed #
- Add state checks to
write()andflush() - Ignore
EINVALin read loop and include stack traces - Support zero-length packets in
AioStream - Default HID endpoint intervals for high-speed compatibility
- Use numeric value for
MaxPowerattribute in gadget configfs
0.6.0 #
Added #
- FFI bindings and
Epollwrapper for Linuxepollandeventfdsystem calls, supporting I/O multiplexing withcreate,add,modify,delete, andwait, pluseventfdnotification helpers
Changed #
- Restructure kernel AIO bindings — rename
platform/aiotoplatform/libaio, introduce aLibaiowrapper with scratch arrays to minimize allocations, and add anIocbowning wrapper with factory methods for read/write ops - Restructure endpoint directory and simplify AIO initialization
- Relocate
AioStreamandBufferPooltolib/src/endpoint/aio/; remove seek offsets and ensure data is copied from native buffers before pool return to prevent use-after-free - Remove
AioSink, oldAioContext, and other high-level AIO abstractions in favor of the more directlibaiointerface - Rename
DeviceClass.compositetoperInterface - Use
DynamicLibrary.process()to access libc in errno handling
Fixed #
- Refresh OUT endpoints on enable to recover from host de-configuration,
replacing dead
AioStreaminstances without requiring consumers to re-subscribe - Rename
restart()torefresh()on FunctionFS
0.5.0 - 2026-03-03 #
Changed #
- Use
release()instead ofclose()for endpoint lifecycle - Move
Releasablemixin andrelease()toEndpointFilebase class - Remove
droppedWritestracking fromAioSink
Fixed #
- Add disabled state and fix
onDisabletransition in FunctionFS - Await
_releaseEndpointsto prevent concurrent map modification - Do not release endpoints on disable or release in HID
- Prevent removing from empty write queue in
AioSink - Await close during resource release in
AioSink - Handle writing to closed sink gracefully in
AioSink