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>
32 lines
1.4 KiB
Markdown
32 lines
1.4 KiB
Markdown
# flutter_usb_serial
|
|
|
|
Flutter USB serial transport for Android and DriverKit-enabled iPadOS.
|
|
|
|
## Platforms
|
|
|
|
- Android uses `usb-serial-for-android` and 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:
|
|
|
|
1. Embed a DriverKit extension whose `IOUserClass` is
|
|
`DaliMasterEspressifUsbDriver`, or adapt the client service name.
|
|
2. Add `com.apple.developer.driverkit.communicates-with-drivers` to the app.
|
|
3. Sign the extension with `com.apple.developer.driverkit` and a
|
|
`com.apple.developer.driverkit.transport.usb` entitlement approved for its
|
|
USB vendor ID.
|
|
4. 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.
|