Coder Social home page Coder Social logo

trendingtechnology / webusb_plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apparence-io/webusb_plugin

0.0 1.0 0.0 230 KB

A flutter webusb plugin

Kotlin 0.13% Ruby 2.74% Swift 1.18% Objective-C 0.04% Dart 48.00% CMake 15.53% C++ 24.87% C 1.41% HTML 3.78% JavaScript 2.31%

webusb_plugin's Introduction

License: MIT pub dev webusb

WebUSB plugin

Apparence.io logo

Developed with ๐Ÿ’™ ย by Apparence.io

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

  • getDevices() : Get paired attached devices
  • requestDevice(filters): pair a device with filter or not

USBDevice

  • Get device info with configuration
  • open(): Start session
  • close(): Close session
  • selectConfiguration(configurationValue): Select a specified configuration
  • claimInterface(interfaceNumber): Claim an interface for exclusive access
  • releaseInterface(interfaceNumber): Release a claimed interface
  • controlTransferIn(setup, length): Return result of a command
  • controlTransferOut(setup, data) : Send a command to device
  • transferIn(): Return data from device
  • transferOut(): Send data to device
  • clearHalt()
  • reset(): Reset device
  • isochronousTransferIn()
  • isochronousTransferOut()

Events

  • OnConnect
  • OnDisconnect

webusb_plugin's People

Contributors

v-apparence avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.