Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

webusb plugin

this plugin provide access to usb devices from web pages with webusb.

platform support

android ios macos web linux windows
✔️

usage

import 'package:usb_device/usb_device.dart';

final usbdevice usbdevice = usbdevice();

var paireddevices = await usbdevice.paireddevices; // get paired devices
var paireddevice = await usbdevice.requestdevices([devicefilter(vendorid : 0x00, productid: 0x00)]); // par a device 
list<usbconfiguration> availableconfigurations = await usbdevice.getavailableconfigurations(paireddevice); // get device's configurations 
usbdeviceinfo deviceinfo = await usbdevice.getpaireddeviceinfo(paireddevice); // get device's info
await usbdevice.open(paireddevice); // start session
await usbdevice.close(paireddevice); // close session

implementation

usb

  • [x] getdevices() : get paired attached devices
  • [x] requestdevice(filters): pair a device with filter or not

usbdevice

  • [x] get device info with configuration
  • [x] open(): start session
  • [x] close(): close session
  • [x] selectconfiguration(configurationvalue): select a specified configuration
  • [x] claiminterface(interfacenumber): claim an interface for exclusive access
  • [x] releaseinterface(interfacenumber): release a claimed interface
  • [x] controltransferin(setup, length): return result of a command
  • [x] controltransferout(setup, data) : send a command to device
  • [x] transferin(): return data from device
  • [x] transferout(): send data to device
  • [x] clearhalt()
  • [x] reset(): reset device
  • [x] isochronoustransferin()
  • [x] isochronoustransferout()

events

  • [x] onconnect
  • [x] ondisconnect

Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD


Download this source code for
5 USD

Top