https://github.com/woodemi/libusb.dart
Dart wrapper via dart:ffi for https://github.com/libusb/libusb
https://github.com/woodemi/libusb.dart
dart flutter libusb
Last synced: 4 months ago
JSON representation
Dart wrapper via dart:ffi for https://github.com/libusb/libusb
- Host: GitHub
- URL: https://github.com/woodemi/libusb.dart
- Owner: woodemi
- License: bsd-3-clause
- Created: 2021-02-06T01:43:30.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-08-22T16:02:20.000Z (almost 4 years ago)
- Last Synced: 2023-08-20T22:29:58.807Z (almost 3 years ago)
- Topics: dart, flutter, libusb
- Language: Dart
- Homepage:
- Size: 1.55 MB
- Stars: 34
- Watchers: 3
- Forks: 13
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# libusb
Dart wrapper via `dart:ffi` for https://github.com/libusb/libusb
## Environment
- Windows(10)
- macOS
- Linux(Ubuntu 18.04 LTS)
## Usage
Checkout example
## Features and bugs
Please file feature requests and bugs at the [issue tracker][tracker].
[tracker]: http://example.com/issues/replaceme
## Build
### Prepare llvm(9+)
- Windows: `winget install -e --id LLVM.LLVM`
- macOS: `brew install llvm`
- Linux: `sudo apt install libclang-10-dev`
### Build libusb_xxx.dart
- Windows/Linux:
```
pub run ffigen
move lib/libusb.dart lib/libusb64.dart
```
Refactor `timeval` to `timeval64`
- macOS:
```
pub run ffigen
mv lib/libusb.dart lib/libusb32.dart
```
Refactor `timeval` to `timeval32`
## Contribute
### Prepare libusb.h
Download `xxx` verion from `https://github.com/libusb/libusb/releases` and extract `libusb.h`
### Prepare libusb-1.0 dynamic library
- Windows:
Download `xxx` version from https://github.com/libusb/libusb/releases and extract
```
copy libusb-1.0.23\MS64\dll\libusb-1.0.dll libusb-1.0\
```
- macOS:
Download `xxx` version from https://homebrew.bintray.com/bottles/libusb-1.0.23.catalina.bottle.tar.gz and extract
```
cp libusb/1.0.23/lib/libusb-1.0.dylib libusb-1.0/
```
- Linux:
Download `xxx` version from http://old.kali.org/kali/pool/main/libu/libusb-1.0/ and install
```
cp /lib/x86_64-linux-gnu/libusb-1.0.so.0.xxx libusb-1.0/libusb-1.0.so
```