17414656a9
- Updated README.md to reflect platform support for iPadOS. - Implemented isDriverAvailable method in FlutterUsbSerialPlugin for DriverKit readiness check. - Added DriverKitSerialClient C source and header files for iPadOS integration. - Created Swift Package for iPadOS support. - Updated pubspec.yaml and flutter_usb_serial.dart to clarify platform compatibility. - Enhanced tests to verify isDriverAvailable functionality. Signed-off-by: Tony <tonylu@tony-cloud.com>
1.4 KiB
1.4 KiB
flutter_usb_serial
Flutter USB serial transport for Android and DriverKit-enabled iPadOS.
Platforms
- Android uses
usb-serial-for-androidand the normal Android USB permission flow. - iPadOS 16+ uses Swift Package Manager and a user client exposed by a USBDriverKit extension embedded in the host app. DriverKit USB support is available only on iPads with an M-series chip.
The package contains the SwiftPM client plugin, not a reusable pre-signed DriverKit extension. Apple provisions USB transport entitlements to the host app and driver for a specific USB vendor. The host app must:
- Embed a DriverKit extension whose
IOUserClassisDaliMasterEspressifUsbDriver, or adapt the client service name. - Add
com.apple.developer.driverkit.communicates-with-driversto the app. - Sign the extension with
com.apple.developer.driverkitand acom.apple.developer.driverkit.transport.usbentitlement approved for its USB vendor ID. - Enable Swift Package Manager integration for Flutter iOS plugins.
Call FlutterUsbSerial.isDriverAvailable() during startup before showing a USB
transport. It returns true only when a compatible driver service is loaded.
The DaliMaster host implementation is deliberately restricted to Espressif
vendor ID 0x303A and the USB Serial/JTAG interface. Serial parameter and modem
line methods are accepted for API compatibility; the ESP USB Serial/JTAG bulk
transport does not use UART baud or line coding.