Added support for Streamdeck Pedal and updated UI to better fit the Packed UI style

This commit is contained in:
2026-02-27 22:47:08 +01:00
committed by erik
parent 5a70f775f1
commit 93faae5cc8
1463 changed files with 306917 additions and 0 deletions

27
node_modules/node-hid/LICENSE-bsd.txt generated vendored Normal file
View File

@@ -0,0 +1,27 @@
Copyright Hans Huebner and contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Signal 11 Software nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

804
node_modules/node-hid/README.md generated vendored Normal file
View File

@@ -0,0 +1,804 @@
# node-hid - Access USB HID devices from Node.js
[![npm](https://img.shields.io/npm/dm/node-hid.svg?maxAge=2592000)](http://npmjs.com/package/node-hid)
[![Prebuild](https://github.com/node-hid/node-hid/actions/workflows/build.yml/badge.svg)](https://github.com/node-hid/node-hid/actions/workflows/build.yml)
- [node-hid - Access USB HID devices from Node.js](#node-hid---access-usb-hid-devices-from-nodejs)
- [Platform Support](#platform-support)
- [Supported Platforms](#supported-platforms)
- [Supported Node versions](#supported-node-versions)
- [Supported Electron versions](#supported-electron-versions)
- [Installation](#installation)
- [Installation Special Cases](#installation-special-cases)
- [Examples](#examples)
- [Async API Usage](#async-api-usage)
- [Sync API Usage](#sync-api-usage)
- [Complete Async API](#complete-async-api)
- [Complete Sync API](#complete-sync-api)
- [General notes:](#general-notes)
- [Thread safety, Worker threads, Context-aware modules](#thread-safety-worker-threads-context-aware-modules)
- [Devices node-hid cannot read](#devices-node-hid-cannot-read)
- [Mac notes](#mac-notes)
- [Windows notes](#windows-notes)
- [Xbox 360 Controller on Windows 10](#xbox-360-controller-on-windows-10)
- [Linux notes](#linux-notes)
- [udev device permissions](#udev-device-permissions)
- [Selecting driver type](#selecting-driver-type)
- [Compiling from source](#compiling-from-source)
- [Linux (kernel 2.6 ) : (install examples shown for Debian/Ubuntu)](#linux-kernel-26--install-examples-shown-for-debianubuntu)
- [FreeBSD](#freebsd)
- [Mac OS X 10.8 ](#mac-os-x-108)
- [Windows 7, 8, 10](#windows-7-8-10)
- [Building node-hid from source, for your projects](#building-node-hid-from-source-for-your-projects)
- [Build node-hid for <code>node-hid</code> development](#build-node-hid-for-node-hid-development)
- [Building node-hid for cross-compiling](#building-node-hid-for-cross-compiling)
- [Electron projects using node-hid](#electron-projects-using-node-hid)
- [NW.js projects using node-hid](#nwjs-projects-using-node-hid)
- [Support](#support)
## Platform Support
`node-hid` currently supports Node.js v10 and upwards. For versions before that, you will need to use an older version.
The platforms, architectures and node versions `node-hid` supports are the following.
In general we try to provide pre-built native library binaries for the most common platforms, Node and Electron versions.
We strive to make `node-hid` cross-platform so there's a good chance any
combination not listed here will compile and work.
### Supported Platforms
- Windows x86 (32-bit)
- Windows x64 (64-bit)
- Mac OSX 10.9+
- Linux x64 (²)
- Linux x86 (¹)
- Linux ARM / Raspberry Pi / Various SBC (²)
- Linux ARM64 / Various SBC (²)
- Linux MIPSel (¹)
- Linux PPC64 (¹)
¹ prebuilt-binaries not provided for these platforms
² prebuilt binary built on Debian 10 Buster
### Supported Node versions
- Node v10 to
- Node v20
### Supported Electron versions
- Electron v3 to
- Electron v24
Future versions of Node or Electron should work with no extra work, since `node-hid` is now based on NAPI.
## Installation
For most "standard" use cases (macOS, Windows, Linux x86), `node-hid` will install like a standard npm package:
```
npm install node-hid
```
If you install globally, the test program `src/show-devices.js` is installed as `hid-showdevices`. On Linux you can use it to try the difference between `hidraw` and `libusb` driverTypes:
```
$ npm install -g node-hid
$ hid-showdevices libusb
$ hid-showdevices hidraw
```
### Installation Special Cases
We are using [prebuild](https://github.com/mafintosh/prebuild) to compile and post binaries of the library for most common use cases (Linux, MacOS, Windows on standard processor platforms). If a prebuild is not available, `node-hid` will work, but `npm install node-hid` will compile the binary when you install. For more details on compiler setup, see [Compling from source](#compiling-from-source) below.
## Examples
In the `src/` directory, various JavaScript programs can be found
that talk to specific devices in some way. Some interesting ones:
- [`show-devices.js`](./src/show-devices.js) - display all HID devices in the system
- [`test-ps3-rumbleled.js`](./src/test-ps3-rumbleled.js) - Read PS3 joystick and control its LED & rumblers
- [`test-powermate.js`](./src/test-powermate.js) - Read Griffin PowerMate knob and change its LED
- [`test-blink1.js`](./src/test-blink1.js) - Fade colors on blink(1) RGB LED
- [`test-bigredbutton.js`](./src/test-bigredbutton.js) - Read Dreamcheeky Big Red Button
- [`test-teensyrawhid.js`](./src/test-teensyrawhid.js) - Read/write Teensy running RawHID "Basic" Arduino sketch
To try them out, run them with `node src/showdevices.js` from within the node-hid directory.
---
## Async vs sync API
Since 3.0.0, `node-hid` supports both the old synchronous api, and a newer async api.
It is recommended to use the async api to avoid `node-hid` from blocking your code from executing. For prototyping or tiny applications, this likely will not matter, but for npm libraries or larger applications it can be problematic.
Additionally, the sync api is limited to only beind able to read up to the `UV_THREADPOOL_SIZE` (default is 4) number of devices at once. Reading from multiple could degrade performance of your application, as there will be fewer than expected uv workers available for nodejs and other libraries to use for other tasks.
The async API is identical to the sync API described below, except every method returns a `Promise` that must be handled. Any unhandled promise can crash your application.
It is safe to use the sync api for some devices in an application, and the async api for other devices. The thread safety of `hidapi` is handled for you here to avoid crashes.
## Cost of `HID.devices()`, `HID.devicesAsync()`, `new HID.HID()` and `HIDAsync.open()` for detecting device plug/unplug
All of `HID.devices()`, `HID.devicesAsync()`, `new HID.HID()` and `HIDAsync.open()` are relatively costly, each causing a USB (and potentially Bluetooth) enumeration. This takes time and OS resources. Doing either can slow down the read/write that you do in parallel with a device, and cause other USB devices to slow down too. This is how USB works.
If you are polling `HID.devices()` or `HID.devicesAsync()` or other inefficient methods to detect device plug / unplug, consider instead using [node-usb](https://github.com/node-usb/node-usb#usbdetection). `node-usb` uses OS-specific, non-bus enumeration ways to detect device plug / unplug.
## Async API Usage
### List all HID devices connected
```js
var HID = require("node-hid");
var devices = await HID.devicesAsync();
```
`devices` will contain an array of objects, one for each HID device
available. Of particular interest are the `vendorId` and
`productId`, as they uniquely identify a device, and the
`path`, which is needed to open a particular device.
Sample output:
```js
await HID.devicesAsync();
{ vendorId: 10168,
productId: 493,
path: 'IOService:/AppleACPIPl...HIDDevice@14210000,0',
serialNumber: '20002E8C',
manufacturer: 'ThingM',
product: 'blink(1) mk2',
release: 2,
interface: -1,
usagePage: 65280,
usage: 1 },
{ vendorId: 1452,
productId: 610,
path: 'IOService:/AppleACPIPl...Keyboard@14400000,0',
serialNumber: '',
manufacturer: 'Apple Inc.',
product: 'Apple Internal Keyboard / Trackpad',
release: 549,
interface: -1,
usagePage: 1,
usage: 6 },
<and more>
```
### Opening a device
Before a device can be read from or written to, it must be opened.
Use either the `path` from the list returned by a prior call to `HID.devicesAsync()`:
```js
var device = await HID.HIDAsync.open(path);
```
or open the first device matching a VID/PID pair:
```js
var device = await HID.HIDAsync.open(vid, pid);
```
**On MacOs** if set to true the `nonExclusive` property allows the device to be opened in non-exclusive mode.
For the other plaforms the flag has no impact.
If the flag is not set the behaviour will default to that of the specific os.
```js
// With path
var device = await HID.HIDAsync.open(path, { nonExclusive: true });
// With vid, pid
var device = await HID.HIDAsync.open(vid, pid, { nonExclusive: true });
```
The `device` variable will contain a handle to the device.
If an error occurs opening the device, an exception will be thrown.
A `node-hid` device is an `EventEmitter`.
While it shares some method names and usage patterns with
`Readable` and `Writable` streams, it is not a stream and the semantics vary.
For example, `device.write` does not take encoding or callback args and
`device.pause` does not do the same thing as `readable.pause`.
There is also no `pipe` method.
### Reading from a device
To receive FEATURE reports, use `await device.getFeatureReport()`.
To receive INPUT reports, use `device.on("data",...)`.
A `node-hid` device is an EventEmitter.
Reading from a device is performed by registering a "data" event handler:
```js
device.on("data", function (data) {});
```
You can also listen for errors like this:
```js
device.on("error", function (err) {});
```
For FEATURE reports:
```js
var buf = await device.getFeatureReport(reportId, reportLength);
```
Notes:
- Reads via `device.on("data")` are asynchronous
- To remove an event handler, close the device with `device.close()`
- When there is not yet a data handler or no data handler exists,
data is not read at all -- there is no buffer.
### Writing to a device
To send FEATURE reports, use `device.sendFeatureReport()`.
To send OUTPUT reports, use `device.write()`.
The ReportId is the first byte of the array sent to `device.sendFeatureReport()` or `device.write()`, meaning the array should be one byte bigger than your report.
If your device does NOT use numbered reports, set the first byte of the 0x00.
```js
device.write([0x00, 0x01, 0x01, 0x05, 0xff, 0xff]);
```
```js
device.sendFeatureReport([0x01, "c", 0, 0xff, 0x33, 0x00, 70, 0, 0]);
```
Notes:
- All writes and other operations performed with the HIDAsync device are done in a work-queue, so will happen in the order you issue them with the returned `Promise` resolving once the operation is completed
- You must send the exact number of bytes for your chosen OUTPUT or FEATURE report.
- Both `device.write()` and `device.sendFeatureReport()` return a Promise containing the number of bytes written + 1.
- For devices using Report Ids, the first byte of the array to `write()` or `sendFeatureReport()` must be the Report Id.
## Sync API Usage
### List all HID devices connected
```js
var HID = require("node-hid");
var devices = HID.devices();
```
`devices` will contain an array of objects, one for each HID device
available. Of particular interest are the `vendorId` and
`productId`, as they uniquely identify a device, and the
`path`, which is needed to open a particular device.
Sample output:
```js
HID.devices();
{ vendorId: 10168,
productId: 493,
path: 'IOService:/AppleACPIPl...HIDDevice@14210000,0',
serialNumber: '20002E8C',
manufacturer: 'ThingM',
product: 'blink(1) mk2',
release: 2,
interface: -1,
usagePage: 65280,
usage: 1 },
{ vendorId: 1452,
productId: 610,
path: 'IOService:/AppleACPIPl...Keyboard@14400000,0',
serialNumber: '',
manufacturer: 'Apple Inc.',
product: 'Apple Internal Keyboard / Trackpad',
release: 549,
interface: -1,
usagePage: 1,
usage: 6 },
<and more>
```
### Opening a device
Before a device can be read from or written to, it must be opened.
Use either the `path` from the list returned by a prior call to `HID.devices()`:
```js
var device = new HID.HID(path);
```
or open the first device matching a VID/PID pair:
```js
var device = new HID.HID(vid, pid);
```
**On MacOs** if set to true the `nonExclusive` property allows the device to be opened in non-exclusive mode.
For the other plaforms the flag has no impact.
If the flag is not set the behaviour will default to that of the specific os.
```js
// With path
var device = await HID.HID(path, { nonExclusive: true });
// With vid, pid
var device = await HID.HID(vid, pid, { nonExclusive: true });
```
The `device` variable will contain a handle to the device.
If an error occurs opening the device, an exception will be thrown.
A `node-hid` device is an `EventEmitter`.
While it shares some method names and usage patterns with
`Readable` and `Writable` streams, it is not a stream and the semantics vary.
For example, `device.write` does not take encoding or callback args and
`device.pause` does not do the same thing as `readable.pause`.
There is also no `pipe` method.
### Picking a device from the device list
If you need to filter down the `HID.devices()` list, you can use
standard Javascript array techniques:
```js
var devices = HID.devices();
var deviceInfo = devices.find(function (d) {
var isTeensy = d.vendorId === 0x16c0 && d.productId === 0x0486;
return isTeensy && d.usagePage === 0xffab && d.usage === 0x200;
});
if (deviceInfo) {
var device = new HID.HID(deviceInfo.path);
// ... use device
}
```
You can also find device of interest by passing VID and PID
```js
//return all the devices that match specified VID and PID
var devices = HID.devices(0x16c0, 0x0486);
```
### Reading from a device
To receive FEATURE reports, use `device.getFeatureReport()`.
To receive INPUT reports, use `device.on("data",...)`.
A `node-hid` device is an EventEmitter.
Reading from a device is performed by registering a "data" event handler:
```js
device.on("data", function (data) {});
```
You can also listen for errors like this:
```js
device.on("error", function (err) {});
```
For FEATURE reports:
```js
var buf = device.getFeatureReport(reportId, reportLength);
```
Notes:
- Reads via `device.on("data")` are asynchronous
- Reads via `device.getFeatureReport()` are synchronous
- To remove an event handler, close the device with `device.close()`
- When there is not yet a data handler or no data handler exists,
data is not read at all -- there is no buffer.
### Writing to a device
To send FEATURE reports, use `device.sendFeatureReport()`.
To send OUTPUT reports, use `device.write()`.
All writing is synchronous.
The ReportId is the first byte of the array sent to `device.sendFeatureReport()` or `device.write()`, meaning the array should be one byte bigger than your report.
If your device does NOT use numbered reports, set the first byte of the 0x00.
```js
device.write([0x00, 0x01, 0x01, 0x05, 0xff, 0xff]);
```
```js
device.sendFeatureReport([0x01, "c", 0, 0xff, 0x33, 0x00, 70, 0, 0]);
```
Notes:
- You must send the exact number of bytes for your chosen OUTPUT or FEATURE report.
- Both `device.write()` and `device.sendFeatureReport()` return
number of bytes written + 1.
- For devices using Report Ids, the first byte of the array to `write()` or
`sendFeatureReport()` must be the Report Id.
## Complete Async API
### `devices = await HID.devicesAsync()`
- Return array listing all connected HID devices
### `devices = await HID.devicesAsync(vid,pid)`
- Return array listing all connected HID devices with specific VendorId and ProductId
### `device = await HID.HIDAsync.open(path,options?:{nonExclusive?:boolean})`
- Open a HID device at the specified platform-specific path
### `device = await HID.HIDAsync.open(vid,pid,options?:{nonExclusive?:boolean})`
- Open first HID device with specific VendorId and ProductId
### `device.on('data', function(data) {} )`
- `data` - Buffer - the data read from the device
### `device.on('error, function(error) {} )`
- `error` - The error Object emitted
### `device.write(data)`
- `data` - the data to be synchronously written to the device,
first byte is Report Id or 0x00 if not using numbered reports.
- Returns number of bytes actually written
### `device.close()`
- Closes the device. Subsequent reads will raise an error.
### `device.pause()`
- Pauses reading and the emission of `data` events.
This means the underlying device is _silenced_ until resumption --
it is not like pausing a stream, where data continues to accumulate.
### `device.resume()`
- This method will cause the HID device to resume emmitting `data` events.
If no listeners are registered for the `data` event, data will be lost.
- When a `data` event is registered for this HID device, this method will
be automatically called.
### `device.read(time_out)`
- (optional) `time_out` - timeout in milliseconds
- Low-level function call to initiate an asynchronous read from the device.
- Returns a Promise containing a Buffer or the Promise will reject upon error.
- This can only be used when `device.on('data', () => {})` is not being used. It will fail if a data handler is registered
### `device.sendFeatureReport(data)`
- `data` - data of HID feature report, with 0th byte being report_id (`[report_id,...]`)
- Returns number of bytes actually written
### `device.getFeatureReport(report_id, report_length)`
- `report_id` - HID feature report id to get
- `report_length` - length of report
### `device.setNonBlocking(no_block)`
- `no_block` - boolean. Set to `true` to enable non-blocking reads
- exactly mirrors `hid_set_nonblocking()` in [`hidapi`](https://github.com/libusb/hidapi)
## Complete Sync API
### `devices = HID.devices()`
- Return array listing all connected HID devices
### `devices = HID.devices(vid,pid)`
- Return array listing all connected HID devices with specific VendorId and ProductId
### `HID.setDriverType(type)`
- Linux only
- Sets underlying HID driver type
- `type` can be `"hidraw"` or `"libusb"`, defaults to `"hidraw"`
### `device = new HID.HID(path,options?:{nonExclusive?:boolean})`
- Open a HID device at the specified platform-specific path
### `device = new HID.HID(vid,pid,options?:{nonExclusive?:boolean})`
- Open first HID device with specific VendorId and ProductId
### `device.on('data', function(data) {} )`
- `data` - Buffer - the data read from the device
### `device.on('error', function(error) {} )`
- `error` - The error Object emitted
### `device.write(data)`
- `data` - the data to be synchronously written to the device,
first byte is Report Id or 0x00 if not using numbered reports.
- Returns number of bytes actually written
### `device.close()`
- Closes the device. Subsequent reads will raise an error.
### `device.pause()`
- Pauses reading and the emission of `data` events.
This means the underlying device is _silenced_ until resumption --
it is not like pausing a stream, where data continues to accumulate.
### `device.resume()`
- This method will cause the HID device to resume emmitting `data` events.
If no listeners are registered for the `data` event, data will be lost.
- When a `data` event is registered for this HID device, this method will
be automatically called.
### `device.read(callback)`
- Low-level function call to initiate an asynchronous read from the device.
- `callback` is of the form `callback(err, data)`
### `device.readSync()`
- Return an array of numbers data. If an error occurs, an exception will be thrown.
### `device.readTimeout(time_out)`
- `time_out` - timeout in milliseconds
- Return an array of numbers data. If an error occurs, an exception will be thrown.
### `device.sendFeatureReport(data)`
- `data` - data of HID feature report, with 0th byte being report_id (`[report_id,...]`)
- Returns number of bytes actually written
### `device.getFeatureReport(report_id, report_length)`
- `report_id` - HID feature report id to get
- `report_length` - length of report
### `device.setNonBlocking(no_block)`
- `no_block` - boolean. Set to `true` to enable non-blocking reads
- exactly mirrors `hid_set_nonblocking()` in [`hidapi`](https://github.com/libusb/hidapi)
---
## General notes:
### Thread safety, Worker threads, Context-aware modules
In general `node-hid` is thread-safe even though the underlying C-library it wraps (`hidapi`) is not entirely thread-safe.
To mitigate this we are doing locking to ensure operations are performed safely. If you are using the sync api from multiple worker_threads, this will result in them waiting on each other at times.
### Devices `node-hid` cannot read
The following devices are unavailable to `node-hid` because the OS owns them:
- Keyboards
- Mice
- Barcode readers (in USB HID keyboard mode)
- RFID scanners (in USB HID keyboard mode)
- Postage Scales (in USB HID keyboard mode)
Most OSes will prevent USB HID keyboards or mice, or devices that appear as a keyboard to the OS.
This includes many RFID scanners, barcode readers, USB HID scales, and many other devices.
This is a security precaution. Otherwise, it would be trivial to build keyloggers.
Some keyboard-pretending devices like barcode or RFID readers can be configured to be in
"HID data" mode or "Serial / UART" mode. If in "HID Data" mode then `node-hid` can access them,
if in "Serial / UART" mode, you should use `node-serialport` instead.
## Mac notes
See General notes above Keyboards with the exception if you open a device in nonExclusive mode.
In that case the os will request permission from the user to read the device.
If permission is given `node-hid` will be able to read data coming from the device normally.
## Windows notes
See General notes above about Keyboards
### Xbox 360 Controller on Windows 10
For reasons similar to mice & keyboards it appears you can't access this controller on Windows 10.
## Linux notes
See General notes above about Keyboards
### udev device permissions
Most Linux distros use `udev` to manage access to physical devices,
and USB HID devices are normally owned by the `root` user.
To allow non-root access, you must create a udev rule for the device,
based on the devices vendorId and productId.
This rule is a text file placed in `/etc/udev/rules.d`.
For an example HID device (say a blink(1) light with vendorId = 0x27b8 and productId = 0x01ed,
the rules file to support both `hidraw` and `libusb` would look like:
```
SUBSYSTEM=="input", GROUP="input", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="27b8", ATTRS{idProduct}=="01ed", MODE:="666", GROUP="plugdev"
KERNEL=="hidraw*", ATTRS{idVendor}=="27b8", ATTRS{idProduct}=="01ed", MODE="0666", GROUP="plugdev"
```
Note that the values for idVendor and idProduct must be in hex and lower-case.
Save this file as `/etc/udev/rules.d/51-blink1.rules`, unplug the HID device,
and reload the rules with:
```
sudo udevadm control --reload-rules
```
For a complete example, see the
[blink1 udev rules](https://github.com/todbot/blink1/blob/master/linux/51-blink1.rules).
### Selecting driver type
By default as of `node-hid@0.7.0`, the [hidraw](https://www.kernel.org/doc/Documentation/hid/hidraw.txt) driver is used to talk to HID devices. Before `node-hid@0.7.0`, the more older but less capable [libusb](http://libusb.info/) driver was used. With `hidraw` Linux apps can now see `usage` and `usagePage` attributes of devices.
If you would still like to use the `libusb` driver, then you can do either:
During runtime, you can use `HID.setDriverType('libusb')` immediately after require()-ing `node-hid`:
```js
var HID = require("node-hid");
HID.setDriverType("libusb");
```
If you must have the libusb version and cannot use `setDriverType()`,
you can install older node-hid or build from source:
```
npm install node-hid@0.5.7
```
or:
```
npm install node-hid --build-from-source --driver=libusb
```
## Compiling from source
To compile & develop locally or if `prebuild` cannot download a pre-built
binary for you, you will need the following compiler tools and libraries:
### Linux (kernel 2.6+) : (install examples shown for Debian/Ubuntu)
- Compilation tools: `apt install build-essential git pkg-config`
- libudev-dev: `apt install libudev-dev` (Debian/Ubuntu) /
`yum install libusbx-devel` (Fedora)
- libusb-1.0-0 w/headers:`apt install libusb-1.0-0 libusb-1.0-0-dev`
### FreeBSD
- Compilation tools: `pkg install git gcc gmake libiconv node npm`
### Mac OS X 10.8+
- [Xcode](https://itunes.apple.com/us/app/xcode/id497799835?mt=12)
### Windows 7, 8, 10
The below is slightly stale. The 2021 solution is to use the official NodeJs Windows installer
and pick "install native module tools"
- Visual C++ compiler and Python 2.7
- either:
- `npm install --global windows-build-tools`
- add `%USERPROFILE%\.windows-build-tools\python27` to `PATH`,
like PowerShell: `$env:Path += ";$env:USERPROFILE\.windows-build-tools\python27"`
- or:
- [Python 2.7](https://www.python.org/downloads/windows/)
- [Visual Studio Express 2013 for Desktop](https://www.visualstudio.com/downloads/download-visual-studio-vs#d-2013-express)
### Building `node-hid` from source, for your projects
```
npm install node-hid --build-from-source
```
### Build `node-hid` for `node-hid` development
- check out a copy of this repo
- change into its directory
- update the submodules
- build the node package
For example:
```
git clone https://github.com/node-hid/node-hid.git
cd node-hid # must change into node-hid directory
npm install -g rimraf # just so it doesn't get 'clean'ed
npm run prepublishOnly # get the needed hidapi submodule
npm install --build-from-source # rebuilds the module with C code
npm run showdevices # list connected HID devices
node ./src/show-devices.js # same as above
```
You may see some warnings from the C compiler as it compiles
[hidapi](https://github.com/libusb/hidapi) (the underlying C library `node-hid` uses).
This is expected.
For ease of development, there are also the scripts:
```
npm run gypclean # "node-gyp clean" clean gyp build directory
npm run gypconfigure # "node-gyp configure" configure makefiles
npm run gypbuild # "node-gyp build" build native code
```
### Building `node-hid` for cross-compiling
When cross-compiling you need to override `node-hid`'s normal behavior
of using Linux `pkg-config` to determine CLFAGS and LDFLAGS for `libusb`.
To do this, you can use the `node-gyp` variable `node_hid_no_pkg_config`
and then invoke a `node-hid` rebuild with either:
```
node-gyp rebuild --node_hid_no_pkg_config=1
```
or
```
npm gyprebuild --node_hid_no_pkg_config=1
```
## Electron projects using `node-hid`
If using `node-hid` with `webpack` or similar bundler, you may need to exclude
`node-hid` and other libraries with native code. In webpack, you say which
`externals` you have in your `webpack-config.js`:
```
externals: {
"node-hid": 'commonjs node-hid'
}
```
Examples of `node-hid` in Electron:
- [electron-hid-test](https://github.com/todbot/electron-hid-test) - Simple example of using `node-hid`, should track latest Electron release
- [electron-hid-test-erb](https://github.com/todbot/electron-hid-test-erb) - Simple example of using `node-hid` using [electron-react-boilerplate](https://github.com/electron-react-boilerplate/electron-react-boilerplate/)
- [electron-hid-toy](https://github.com/todbot/electron-hid-toy) - Simple example of using `node-hid`, showing packaging and signing
- [Blink1Control2](https://github.com/todbot/Blink1Control2/) - a complete application, using webpack (e.g. see its [webpack-config.js](https://github.com/todbot/Blink1Control2/blob/master/webpack.config.js))
## NW.js projects using `node-hid`
Without knowing much about NW.js, a quick hacky solution that works is:
```
cd my-nwjs-app
npm install node-hid --save
npm install -g nw-gyp
cd node_modules/node-hid
nw-gyp rebuild --target=0.42.3 --arch=x64 // or whatever NW.js version you have
cd ../..
nwjs .
```
## Support
Please use the [node-hid github issues page](https://github.com/node-hid/node-hid/issues)
for support questions and issues.

4
node_modules/node-hid/binding-options.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
module.exports = {
name: 'HID',
napi_versions: [4],
}

182
node_modules/node-hid/binding.gyp generated vendored Normal file
View File

@@ -0,0 +1,182 @@
{
'variables': {
'driver%': 'libusb',
'node_hid_no_pkg_config%': '0'
},
'targets': [
{
'target_name': 'HID',
'sources': [
'src/exports.cc',
'src/HID.cc',
'src/HIDAsync.cc',
'src/devices.cc',
'src/read.cc',
'src/util.cc'
],
'dependencies': ['hidapi'],
'defines': [
'_LARGEFILE_SOURCE',
'_FILE_OFFSET_BITS=64',
],
'conditions': [
[ 'OS=="mac"', {
'LDFLAGS': [
'-framework IOKit',
'-framework CoreFoundation',
'-framework AppKit'
],
'xcode_settings': {
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.9',
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'OTHER_LDFLAGS': [
'-framework IOKit',
'-framework CoreFoundation',
'-framework AppKit'
],
}
}], # OS==mac
[ 'OS=="linux"', {
'conditions': [
[ 'driver=="libusb"', {
'libraries': ['-lusb-1.0']
}],
[ 'driver=="hidraw"', {
'libraries': ['-ludev','-lusb-1.0']
}]
],
}], # OS==linux
[ 'OS=="freebsd"', {
'libraries': ['-lusb']
}], # OS==freebsd
[ 'OS=="win"', {
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': '2', # /EHsc
'DisableSpecificWarnings': [ '4290', '4530', '4267' ],
},
'VCLinkerTool': {
'AdditionalDependencies': ['setupapi.lib']
}
}
}] # OS==win
],
'cflags!': ['-ansi', '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'cflags': ['-g', '-exceptions'],
'cflags_cc': ['-g', '-exceptions']
}, # target HID
{
'target_name': 'hidapi',
'type': 'static_library',
'conditions': [
[ 'OS=="mac"', {
'sources': [ 'hidapi/mac/hid.c' ],
'include_dirs+': ['/usr/include/libusb-1.0/'],
'xcode_settings': {
'OTHER_CFLAGS': ['-Wno-sign-compare'],
'MACOSX_DEPLOYMENT_TARGET': '10.9',
}
}],
[ 'OS=="freebsd"', {
'sources': [ 'hidapi/libusb/hid.c' ],
}],
[ 'OS=="linux"', {
'conditions': [
[ 'driver=="libusb"', {
'sources': [ 'hidapi/libusb/hid.c' ],
'conditions': [
['node_hid_no_pkg_config != 1', {
'include_dirs+': ['<!@(pkg-config libusb-1.0 --cflags-only-I | sed s/-I//g)']
}]
]
}],
[ 'driver=="hidraw"', {
'sources': [ 'hidapi/linux/hid.c' ]
}]
]
}],
[ 'OS=="win"', {
'sources': [ 'hidapi/windows/hid.c' ],
'msvs_settings': {
'VCCLCompilerTool': {
'ExceptionHandling': '2', # /EHsc
'DisableSpecificWarnings': [ '4290', '4530', '4267' ],
},
'VCLinkerTool': {
'AdditionalDependencies': ['setupapi.lib']
}
}
}]
],
'direct_dependent_settings': {
'include_dirs': [
'hidapi/hidapi',
"<!@(node -p \"require('node-addon-api').include\")"
]
},
'include_dirs': ['hidapi/hidapi'],
'defines': [
'_LARGEFILE_SOURCE',
'_FILE_OFFSET_BITS=64',
],
'cflags': ['-g'],
'cflags!': ['-ansi']
}, # target hidapi
],
'conditions': [
[ 'OS=="linux"', {
'targets': [
{
'target_name': 'HID_hidraw',
'sources': [
'src/exports.cc',
'src/HID.cc',
'src/HIDAsync.cc',
'src/devices.cc',
'src/read.cc',
'src/util.cc'
],
'dependencies': ['hidapi-linux-hidraw'],
'defines': [
'_LARGEFILE_SOURCE',
'_FILE_OFFSET_BITS=64',
],
'libraries': [
'-ludev',
'-lusb-1.0'
],
'cflags!': ['-ansi', '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'cflags': ['-g', '-exceptions'],
'cflags_cc': ['-g', '-exceptions']
}, # target 'HID-hidraw'
{
'target_name': 'hidapi-linux-hidraw',
'type': 'static_library',
'sources': [ 'hidapi/linux/hid.c' ],
'direct_dependent_settings': {
'include_dirs': [
'hidapi/hidapi',
"<!@(node -p \"require('node-addon-api').include\")"
]
},
'include_dirs': ['hidapi/hidapi' ],
'defines': [
'_LARGEFILE_SOURCE',
'_FILE_OFFSET_BITS=64',
],
'cflags': ['-g'],
'cflags!': ['-ansi']
}, # target 'hidapi-linux-hidraw'
] # targets linux
}], # OS==linux
] # conditions
}

192
node_modules/node-hid/build/HID.target.mk generated vendored Normal file
View File

@@ -0,0 +1,192 @@
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := HID
DEFS_Debug := \
'-DNODE_GYP_MODULE_NAME=HID' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-DELECTRON_ENSURE_CONFIG_GYPI' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DUSING_ELECTRON_CONFIG_GYPI' \
'-DV8_COMPRESS_POINTERS' \
'-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' \
'-DV8_ENABLE_SANDBOX' \
'-DV8_31BIT_SMIS_ON_64BIT_ARCH' \
'-D__STDC_FORMAT_MACROS' \
'-DOPENSSL_NO_PINSHARED' \
'-DOPENSSL_THREADS' \
'-DOPENSSL_NO_ASM' \
'-DBUILDING_NODE_EXTENSION' \
'-DDEBUG' \
'-D_DEBUG' \
'-DV8_ENABLE_CHECKS'
# Flags passed to all source files.
CFLAGS_Debug := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-g \
-exceptions \
-m64 \
-g \
-O0
# Flags passed to only C files.
CFLAGS_C_Debug :=
# Flags passed to only C++ files.
CFLAGS_CC_Debug := \
-fno-rtti \
-std=gnu++17 \
-g \
-exceptions
INCS_Debug := \
-I/home/erik/.electron-gyp/28.3.3/include/node \
-I/home/erik/.electron-gyp/28.3.3/src \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/config \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include \
-I/home/erik/.electron-gyp/28.3.3/deps/uv/include \
-I/home/erik/.electron-gyp/28.3.3/deps/zlib \
-I/home/erik/.electron-gyp/28.3.3/deps/v8/include \
-I$(srcdir)/hidapi/hidapi \
-I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api
DEFS_Release := \
'-DNODE_GYP_MODULE_NAME=HID' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-DELECTRON_ENSURE_CONFIG_GYPI' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DUSING_ELECTRON_CONFIG_GYPI' \
'-DV8_COMPRESS_POINTERS' \
'-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' \
'-DV8_ENABLE_SANDBOX' \
'-DV8_31BIT_SMIS_ON_64BIT_ARCH' \
'-D__STDC_FORMAT_MACROS' \
'-DOPENSSL_NO_PINSHARED' \
'-DOPENSSL_THREADS' \
'-DOPENSSL_NO_ASM' \
'-DBUILDING_NODE_EXTENSION'
# Flags passed to all source files.
CFLAGS_Release := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-g \
-exceptions \
-m64 \
-O3 \
-fno-omit-frame-pointer
# Flags passed to only C files.
CFLAGS_C_Release :=
# Flags passed to only C++ files.
CFLAGS_CC_Release := \
-fno-rtti \
-std=gnu++17 \
-g \
-exceptions
INCS_Release := \
-I/home/erik/.electron-gyp/28.3.3/include/node \
-I/home/erik/.electron-gyp/28.3.3/src \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/config \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include \
-I/home/erik/.electron-gyp/28.3.3/deps/uv/include \
-I/home/erik/.electron-gyp/28.3.3/deps/zlib \
-I/home/erik/.electron-gyp/28.3.3/deps/v8/include \
-I$(srcdir)/hidapi/hidapi \
-I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api
OBJS := \
$(obj).target/$(TARGET)/src/exports.o \
$(obj).target/$(TARGET)/src/HID.o \
$(obj).target/$(TARGET)/src/HIDAsync.o \
$(obj).target/$(TARGET)/src/devices.o \
$(obj).target/$(TARGET)/src/read.o \
$(obj).target/$(TARGET)/src/util.o
# Add to the list of files we specially track dependencies for.
all_deps += $(OBJS)
# Make sure our dependencies are built before any of us.
$(OBJS): | $(builddir)/hidapi.a $(obj).target/hidapi.a
# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.
$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# End of this set of suffix rules
### Rules for final target.
LDFLAGS_Debug := \
-pthread \
-rdynamic \
-m64
LDFLAGS_Release := \
-pthread \
-rdynamic \
-m64
LIBS := \
-lusb-1.0
$(obj).target/HID.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(obj).target/HID.node: LIBS := $(LIBS)
$(obj).target/HID.node: TOOLSET := $(TOOLSET)
$(obj).target/HID.node: $(OBJS) $(obj).target/hidapi.a FORCE_DO_CMD
$(call do_cmd,solink_module)
all_deps += $(obj).target/HID.node
# Add target alias
.PHONY: HID
HID: $(builddir)/HID.node
# Copy this to the executable output path.
$(builddir)/HID.node: TOOLSET := $(TOOLSET)
$(builddir)/HID.node: $(obj).target/HID.node FORCE_DO_CMD
$(call do_cmd,copy)
all_deps += $(builddir)/HID.node
# Short alias for building this executable.
.PHONY: HID.node
HID.node: $(obj).target/HID.node $(builddir)/HID.node
# Add executable to "all" target.
.PHONY: all
all: $(builddir)/HID.node

193
node_modules/node-hid/build/HID_hidraw.target.mk generated vendored Normal file
View File

@@ -0,0 +1,193 @@
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := HID_hidraw
DEFS_Debug := \
'-DNODE_GYP_MODULE_NAME=HID_hidraw' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-DELECTRON_ENSURE_CONFIG_GYPI' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DUSING_ELECTRON_CONFIG_GYPI' \
'-DV8_COMPRESS_POINTERS' \
'-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' \
'-DV8_ENABLE_SANDBOX' \
'-DV8_31BIT_SMIS_ON_64BIT_ARCH' \
'-D__STDC_FORMAT_MACROS' \
'-DOPENSSL_NO_PINSHARED' \
'-DOPENSSL_THREADS' \
'-DOPENSSL_NO_ASM' \
'-DBUILDING_NODE_EXTENSION' \
'-DDEBUG' \
'-D_DEBUG' \
'-DV8_ENABLE_CHECKS'
# Flags passed to all source files.
CFLAGS_Debug := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-g \
-exceptions \
-m64 \
-g \
-O0
# Flags passed to only C files.
CFLAGS_C_Debug :=
# Flags passed to only C++ files.
CFLAGS_CC_Debug := \
-fno-rtti \
-std=gnu++17 \
-g \
-exceptions
INCS_Debug := \
-I/home/erik/.electron-gyp/28.3.3/include/node \
-I/home/erik/.electron-gyp/28.3.3/src \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/config \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include \
-I/home/erik/.electron-gyp/28.3.3/deps/uv/include \
-I/home/erik/.electron-gyp/28.3.3/deps/zlib \
-I/home/erik/.electron-gyp/28.3.3/deps/v8/include \
-I$(srcdir)/hidapi/hidapi \
-I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api
DEFS_Release := \
'-DNODE_GYP_MODULE_NAME=HID_hidraw' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-DELECTRON_ENSURE_CONFIG_GYPI' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DUSING_ELECTRON_CONFIG_GYPI' \
'-DV8_COMPRESS_POINTERS' \
'-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' \
'-DV8_ENABLE_SANDBOX' \
'-DV8_31BIT_SMIS_ON_64BIT_ARCH' \
'-D__STDC_FORMAT_MACROS' \
'-DOPENSSL_NO_PINSHARED' \
'-DOPENSSL_THREADS' \
'-DOPENSSL_NO_ASM' \
'-DBUILDING_NODE_EXTENSION'
# Flags passed to all source files.
CFLAGS_Release := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-g \
-exceptions \
-m64 \
-O3 \
-fno-omit-frame-pointer
# Flags passed to only C files.
CFLAGS_C_Release :=
# Flags passed to only C++ files.
CFLAGS_CC_Release := \
-fno-rtti \
-std=gnu++17 \
-g \
-exceptions
INCS_Release := \
-I/home/erik/.electron-gyp/28.3.3/include/node \
-I/home/erik/.electron-gyp/28.3.3/src \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/config \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include \
-I/home/erik/.electron-gyp/28.3.3/deps/uv/include \
-I/home/erik/.electron-gyp/28.3.3/deps/zlib \
-I/home/erik/.electron-gyp/28.3.3/deps/v8/include \
-I$(srcdir)/hidapi/hidapi \
-I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api
OBJS := \
$(obj).target/$(TARGET)/src/exports.o \
$(obj).target/$(TARGET)/src/HID.o \
$(obj).target/$(TARGET)/src/HIDAsync.o \
$(obj).target/$(TARGET)/src/devices.o \
$(obj).target/$(TARGET)/src/read.o \
$(obj).target/$(TARGET)/src/util.o
# Add to the list of files we specially track dependencies for.
all_deps += $(OBJS)
# Make sure our dependencies are built before any of us.
$(OBJS): | $(builddir)/hidapi-linux-hidraw.a $(obj).target/hidapi-linux-hidraw.a
# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.
$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
# End of this set of suffix rules
### Rules for final target.
LDFLAGS_Debug := \
-pthread \
-rdynamic \
-m64
LDFLAGS_Release := \
-pthread \
-rdynamic \
-m64
LIBS := \
-ludev \
-lusb-1.0
$(obj).target/HID_hidraw.node: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(obj).target/HID_hidraw.node: LIBS := $(LIBS)
$(obj).target/HID_hidraw.node: TOOLSET := $(TOOLSET)
$(obj).target/HID_hidraw.node: $(OBJS) $(obj).target/hidapi-linux-hidraw.a FORCE_DO_CMD
$(call do_cmd,solink_module)
all_deps += $(obj).target/HID_hidraw.node
# Add target alias
.PHONY: HID_hidraw
HID_hidraw: $(builddir)/HID_hidraw.node
# Copy this to the executable output path.
$(builddir)/HID_hidraw.node: TOOLSET := $(TOOLSET)
$(builddir)/HID_hidraw.node: $(obj).target/HID_hidraw.node FORCE_DO_CMD
$(call do_cmd,copy)
all_deps += $(builddir)/HID_hidraw.node
# Short alias for building this executable.
.PHONY: HID_hidraw.node
HID_hidraw.node: $(obj).target/HID_hidraw.node $(builddir)/HID_hidraw.node
# Add executable to "all" target.
.PHONY: all
all: $(builddir)/HID_hidraw.node

369
node_modules/node-hid/build/Makefile generated vendored Normal file
View File

@@ -0,0 +1,369 @@
# We borrow heavily from the kernel build setup, though we are simpler since
# we don't have Kconfig tweaking settings on us.
# The implicit make rules have it looking for RCS files, among other things.
# We instead explicitly write all the rules we care about.
# It's even quicker (saves ~200ms) to pass -r on the command line.
MAKEFLAGS=-r
# The source directory tree.
srcdir := ..
abs_srcdir := $(abspath $(srcdir))
# The name of the builddir.
builddir_name ?= .
# The V=1 flag on command line makes us verbosely print command lines.
ifdef V
quiet=
else
quiet=quiet_
endif
# Specify BUILDTYPE=Release on the command line for a release build.
BUILDTYPE ?= Release
# Directory all our build output goes into.
# Note that this must be two directories beneath src/ for unit tests to pass,
# as they reach into the src/ directory for data with relative paths.
builddir ?= $(builddir_name)/$(BUILDTYPE)
abs_builddir := $(abspath $(builddir))
depsdir := $(builddir)/.deps
# Object output directory.
obj := $(builddir)/obj
abs_obj := $(abspath $(obj))
# We build up a list of every single one of the targets so we can slurp in the
# generated dependency rule Makefiles in one pass.
all_deps :=
CC.target ?= $(CC)
CFLAGS.target ?= $(CPPFLAGS) $(CFLAGS)
CXX.target ?= $(CXX)
CXXFLAGS.target ?= $(CPPFLAGS) $(CXXFLAGS)
LINK.target ?= $(LINK)
LDFLAGS.target ?= $(LDFLAGS)
AR.target ?= $(AR)
PLI.target ?= pli
# C++ apps need to be linked with g++.
LINK ?= $(CXX.target)
# TODO(evan): move all cross-compilation logic to gyp-time so we don't need
# to replicate this environment fallback in make as well.
CC.host ?= gcc
CFLAGS.host ?= $(CPPFLAGS_host) $(CFLAGS_host)
CXX.host ?= g++
CXXFLAGS.host ?= $(CPPFLAGS_host) $(CXXFLAGS_host)
LINK.host ?= $(CXX.host)
LDFLAGS.host ?= $(LDFLAGS_host)
AR.host ?= ar
PLI.host ?= pli
# Define a dir function that can handle spaces.
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions
# "leading spaces cannot appear in the text of the first argument as written.
# These characters can be put into the argument value by variable substitution."
empty :=
space := $(empty) $(empty)
# http://stackoverflow.com/questions/1189781/using-make-dir-or-notdir-on-a-path-with-spaces
replace_spaces = $(subst $(space),?,$1)
unreplace_spaces = $(subst ?,$(space),$1)
dirx = $(call unreplace_spaces,$(dir $(call replace_spaces,$1)))
# Flags to make gcc output dependency info. Note that you need to be
# careful here to use the flags that ccache and distcc can understand.
# We write to a dep file on the side first and then rename at the end
# so we can't end up with a broken dep file.
depfile = $(depsdir)/$(call replace_spaces,$@).d
DEPFLAGS = -MMD -MF $(depfile).raw
# We have to fixup the deps output in a few ways.
# (1) the file output should mention the proper .o file.
# ccache or distcc lose the path to the target, so we convert a rule of
# the form:
# foobar.o: DEP1 DEP2
# into
# path/to/foobar.o: DEP1 DEP2
# (2) we want missing files not to cause us to fail to build.
# We want to rewrite
# foobar.o: DEP1 DEP2 \
# DEP3
# to
# DEP1:
# DEP2:
# DEP3:
# so if the files are missing, they're just considered phony rules.
# We have to do some pretty insane escaping to get those backslashes
# and dollar signs past make, the shell, and sed at the same time.
# Doesn't work with spaces, but that's fine: .d files have spaces in
# their names replaced with other characters.
define fixup_dep
# The depfile may not exist if the input file didn't have any #includes.
touch $(depfile).raw
# Fixup path as in (1).
sed -e "s|^$(notdir $@)|$@|" $(depfile).raw >> $(depfile)
# Add extra rules as in (2).
# We remove slashes and replace spaces with new lines;
# remove blank lines;
# delete the first line and append a colon to the remaining lines.
sed -e 's|\\||' -e 'y| |\n|' $(depfile).raw |\
grep -v '^$$' |\
sed -e 1d -e 's|$$|:|' \
>> $(depfile)
rm $(depfile).raw
endef
# Command definitions:
# - cmd_foo is the actual command to run;
# - quiet_cmd_foo is the brief-output summary of the command.
quiet_cmd_cc = CC($(TOOLSET)) $@
cmd_cc = $(CC.$(TOOLSET)) -o $@ $< $(GYP_CFLAGS) $(DEPFLAGS) $(CFLAGS.$(TOOLSET)) -c
quiet_cmd_cxx = CXX($(TOOLSET)) $@
cmd_cxx = $(CXX.$(TOOLSET)) -o $@ $< $(GYP_CXXFLAGS) $(DEPFLAGS) $(CXXFLAGS.$(TOOLSET)) -c
quiet_cmd_touch = TOUCH $@
cmd_touch = touch $@
quiet_cmd_copy = COPY $@
# send stderr to /dev/null to ignore messages when linking directories.
cmd_copy = ln -f "$<" "$@" 2>/dev/null || (rm -rf "$@" && cp -af "$<" "$@")
quiet_cmd_symlink = SYMLINK $@
cmd_symlink = ln -sf "$<" "$@"
quiet_cmd_alink = AR($(TOOLSET)) $@
cmd_alink = rm -f $@ && $(AR.$(TOOLSET)) crs $@ $(filter %.o,$^)
quiet_cmd_alink_thin = AR($(TOOLSET)) $@
cmd_alink_thin = rm -f $@ && $(AR.$(TOOLSET)) crsT $@ $(filter %.o,$^)
# Due to circular dependencies between libraries :(, we wrap the
# special "figure out circular dependencies" flags around the entire
# input list during linking.
quiet_cmd_link = LINK($(TOOLSET)) $@
cmd_link = $(LINK.$(TOOLSET)) -o $@ $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group
# Note: this does not handle spaces in paths
define xargs
$(1) $(word 1,$(2))
$(if $(word 2,$(2)),$(call xargs,$(1),$(wordlist 2,$(words $(2)),$(2))))
endef
define write-to-file
@: >$(1)
$(call xargs,@printf "%s\n" >>$(1),$(2))
endef
OBJ_FILE_LIST := ar-file-list
define create_archive
rm -f $(1) $(1).$(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
$(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
$(AR.$(TOOLSET)) crs $(1) @$(1).$(OBJ_FILE_LIST)
endef
define create_thin_archive
rm -f $(1) $(OBJ_FILE_LIST); mkdir -p `dirname $(1)`
$(call write-to-file,$(1).$(OBJ_FILE_LIST),$(filter %.o,$(2)))
$(AR.$(TOOLSET)) crsT $(1) @$(1).$(OBJ_FILE_LIST)
endef
# We support two kinds of shared objects (.so):
# 1) shared_library, which is just bundling together many dependent libraries
# into a link line.
# 2) loadable_module, which is generating a module intended for dlopen().
#
# They differ only slightly:
# In the former case, we want to package all dependent code into the .so.
# In the latter case, we want to package just the API exposed by the
# outermost module.
# This means shared_library uses --whole-archive, while loadable_module doesn't.
# (Note that --whole-archive is incompatible with the --start-group used in
# normal linking.)
# Other shared-object link notes:
# - Set SONAME to the library filename so our binaries don't reference
# the local, absolute paths used on the link command-line.
quiet_cmd_solink = SOLINK($(TOOLSET)) $@
cmd_solink = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--whole-archive $(LD_INPUTS) -Wl,--no-whole-archive $(LIBS)
quiet_cmd_solink_module = SOLINK_MODULE($(TOOLSET)) $@
cmd_solink_module = $(LINK.$(TOOLSET)) -o $@ -shared $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -Wl,-soname=$(@F) -Wl,--start-group $(filter-out FORCE_DO_CMD, $^) -Wl,--end-group $(LIBS)
# Define an escape_quotes function to escape single quotes.
# This allows us to handle quotes properly as long as we always use
# use single quotes and escape_quotes.
escape_quotes = $(subst ','\'',$(1))
# This comment is here just to include a ' to unconfuse syntax highlighting.
# Define an escape_vars function to escape '$' variable syntax.
# This allows us to read/write command lines with shell variables (e.g.
# $LD_LIBRARY_PATH), without triggering make substitution.
escape_vars = $(subst $$,$$$$,$(1))
# Helper that expands to a shell command to echo a string exactly as it is in
# make. This uses printf instead of echo because printf's behaviour with respect
# to escape sequences is more portable than echo's across different shells
# (e.g., dash, bash).
exact_echo = printf '%s\n' '$(call escape_quotes,$(1))'
# Helper to compare the command we're about to run against the command
# we logged the last time we ran the command. Produces an empty
# string (false) when the commands match.
# Tricky point: Make has no string-equality test function.
# The kernel uses the following, but it seems like it would have false
# positives, where one string reordered its arguments.
# arg_check = $(strip $(filter-out $(cmd_$(1)), $(cmd_$@)) \
# $(filter-out $(cmd_$@), $(cmd_$(1))))
# We instead substitute each for the empty string into the other, and
# say they're equal if both substitutions produce the empty string.
# .d files contain ? instead of spaces, take that into account.
command_changed = $(or $(subst $(cmd_$(1)),,$(cmd_$(call replace_spaces,$@))),\
$(subst $(cmd_$(call replace_spaces,$@)),,$(cmd_$(1))))
# Helper that is non-empty when a prerequisite changes.
# Normally make does this implicitly, but we force rules to always run
# so we can check their command lines.
# $? -- new prerequisites
# $| -- order-only dependencies
prereq_changed = $(filter-out FORCE_DO_CMD,$(filter-out $|,$?))
# Helper that executes all postbuilds until one fails.
define do_postbuilds
@E=0;\
for p in $(POSTBUILDS); do\
eval $$p;\
E=$$?;\
if [ $$E -ne 0 ]; then\
break;\
fi;\
done;\
if [ $$E -ne 0 ]; then\
rm -rf "$@";\
exit $$E;\
fi
endef
# do_cmd: run a command via the above cmd_foo names, if necessary.
# Should always run for a given target to handle command-line changes.
# Second argument, if non-zero, makes it do asm/C/C++ dependency munging.
# Third argument, if non-zero, makes it do POSTBUILDS processing.
# Note: We intentionally do NOT call dirx for depfile, since it contains ? for
# spaces already and dirx strips the ? characters.
define do_cmd
$(if $(or $(command_changed),$(prereq_changed)),
@$(call exact_echo, $($(quiet)cmd_$(1)))
@mkdir -p "$(call dirx,$@)" "$(dir $(depfile))"
$(if $(findstring flock,$(word 1,$(cmd_$1))),
@$(cmd_$(1))
@echo " $(quiet_cmd_$(1)): Finished",
@$(cmd_$(1))
)
@$(call exact_echo,$(call escape_vars,cmd_$(call replace_spaces,$@) := $(cmd_$(1)))) > $(depfile)
@$(if $(2),$(fixup_dep))
$(if $(and $(3), $(POSTBUILDS)),
$(call do_postbuilds)
)
)
endef
# Declare the "all" target first so it is the default,
# even though we don't have the deps yet.
.PHONY: all
all:
# make looks for ways to re-generate included makefiles, but in our case, we
# don't have a direct way. Explicitly telling make that it has nothing to do
# for them makes it go faster.
%.d: ;
# Use FORCE_DO_CMD to force a target to run. Should be coupled with
# do_cmd.
.PHONY: FORCE_DO_CMD
FORCE_DO_CMD:
TOOLSET := target
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(srcdir)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj).$(TOOLSET)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cc FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cpp FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.cxx FORCE_DO_CMD
@$(call do_cmd,cxx,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.s FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/%.o: $(obj)/%.S FORCE_DO_CMD
@$(call do_cmd,cc,1)
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
$(findstring $(join ^,$(prefix)),\
$(join ^,HID.target.mk)))),)
include HID.target.mk
endif
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
$(findstring $(join ^,$(prefix)),\
$(join ^,HID_hidraw.target.mk)))),)
include HID_hidraw.target.mk
endif
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
$(findstring $(join ^,$(prefix)),\
$(join ^,hidapi-linux-hidraw.target.mk)))),)
include hidapi-linux-hidraw.target.mk
endif
ifeq ($(strip $(foreach prefix,$(NO_LOAD),\
$(findstring $(join ^,$(prefix)),\
$(join ^,hidapi.target.mk)))),)
include hidapi.target.mk
endif
quiet_cmd_regen_makefile = ACTION Regenerating $@
cmd_regen_makefile = cd $(srcdir); /usr/lib/node_modules/node-gyp/gyp/gyp_main.py -fmake --ignore-environment "-Dlibrary=shared_library" "-Dvisibility=default" "-Dnode_root_dir=/home/erik/.electron-gyp/28.3.3" "-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp" "-Dnode_lib_file=/home/erik/.electron-gyp/28.3.3/<(target_arch)/node.lib" "-Dmodule_root_dir=/home/erik/Git/PackControl/node_modules/node-hid" "-Dnode_engine=v8" "--depth=." "-Goutput_dir=." "--generator-output=build" -I/home/erik/Git/PackControl/node_modules/node-hid/build/config.gypi -I/usr/lib/node_modules/node-gyp/addon.gypi -I/home/erik/.electron-gyp/28.3.3/include/node/common.gypi "--toplevel-dir=." binding.gyp
Makefile: $(srcdir)/../../../../../../usr/lib/node_modules/node-gyp/addon.gypi $(srcdir)/../../../../.electron-gyp/28.3.3/include/node/common.gypi $(srcdir)/binding.gyp $(srcdir)/build/config.gypi
$(call do_cmd,regen_makefile)
# "all" is a concatenation of the "all" targets from all the included
# sub-makefiles. This is just here to clarify.
all:
# Add in dependency-tracking rules. $(all_deps) is the list of every single
# target in our tree. Only consider the ones with .d (dependency) info:
d_files := $(wildcard $(foreach f,$(all_deps),$(depsdir)/$(f).d))
ifneq ($(d_files),)
include $(d_files)
endif

View File

@@ -0,0 +1 @@
cmd_Release/HID.node := ln -f "Release/obj.target/HID.node" "Release/HID.node" 2>/dev/null || (rm -rf "Release/HID.node" && cp -af "Release/obj.target/HID.node" "Release/HID.node")

View File

@@ -0,0 +1 @@
cmd_Release/HID_hidraw.node := ln -f "Release/obj.target/HID_hidraw.node" "Release/HID_hidraw.node" 2>/dev/null || (rm -rf "Release/HID_hidraw.node" && cp -af "Release/obj.target/HID_hidraw.node" "Release/HID_hidraw.node")

View File

@@ -0,0 +1 @@
cmd_Release/hidapi-linux-hidraw.a := ln -f "Release/obj.target/hidapi-linux-hidraw.a" "Release/hidapi-linux-hidraw.a" 2>/dev/null || (rm -rf "Release/hidapi-linux-hidraw.a" && cp -af "Release/obj.target/hidapi-linux-hidraw.a" "Release/hidapi-linux-hidraw.a")

View File

@@ -0,0 +1 @@
cmd_Release/hidapi.a := ln -f "Release/obj.target/hidapi.a" "Release/hidapi.a" 2>/dev/null || (rm -rf "Release/hidapi.a" && cp -af "Release/obj.target/hidapi.a" "Release/hidapi.a")

View File

@@ -0,0 +1 @@
cmd_Release/obj.target/HID.node := g++ -o Release/obj.target/HID.node -shared -pthread -rdynamic -m64 -Wl,-soname=HID.node -Wl,--start-group Release/obj.target/HID/src/exports.o Release/obj.target/HID/src/HID.o Release/obj.target/HID/src/HIDAsync.o Release/obj.target/HID/src/devices.o Release/obj.target/HID/src/read.o Release/obj.target/HID/src/util.o Release/obj.target/hidapi.a -Wl,--end-group -lusb-1.0

View File

@@ -0,0 +1,23 @@
cmd_Release/obj.target/HID/src/HID.o := g++ -o Release/obj.target/HID/src/HID.o ../src/HID.cc '-DNODE_GYP_MODULE_NAME=HID' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID/src/HID.o.d.raw -c
Release/obj.target/HID/src/HID.o: ../src/HID.cc ../src/devices.h \
../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h ../src/HID.h
../src/HID.cc:
../src/devices.h:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:
../src/HID.h:

View File

@@ -0,0 +1,24 @@
cmd_Release/obj.target/HID/src/HIDAsync.o := g++ -o Release/obj.target/HID/src/HIDAsync.o ../src/HIDAsync.cc '-DNODE_GYP_MODULE_NAME=HID' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID/src/HIDAsync.o.d.raw -c
Release/obj.target/HID/src/HIDAsync.o: ../src/HIDAsync.cc \
../src/devices.h ../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h ../src/HIDAsync.h ../src/read.h
../src/HIDAsync.cc:
../src/devices.h:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:
../src/HIDAsync.h:
../src/read.h:

View File

@@ -0,0 +1,22 @@
cmd_Release/obj.target/HID/src/devices.o := g++ -o Release/obj.target/HID/src/devices.o ../src/devices.cc '-DNODE_GYP_MODULE_NAME=HID' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID/src/devices.o.d.raw -c
Release/obj.target/HID/src/devices.o: ../src/devices.cc ../src/devices.h \
../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h
../src/devices.cc:
../src/devices.h:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:

View File

@@ -0,0 +1,25 @@
cmd_Release/obj.target/HID/src/exports.o := g++ -o Release/obj.target/HID/src/exports.o ../src/exports.cc '-DNODE_GYP_MODULE_NAME=HID' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID/src/exports.o.d.raw -c
Release/obj.target/HID/src/exports.o: ../src/exports.cc ../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h ../src/HID.h ../src/HIDAsync.h ../src/read.h \
../src/devices.h
../src/exports.cc:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:
../src/HID.h:
../src/HIDAsync.h:
../src/read.h:
../src/devices.h:

View File

@@ -0,0 +1,22 @@
cmd_Release/obj.target/HID/src/read.o := g++ -o Release/obj.target/HID/src/read.o ../src/read.cc '-DNODE_GYP_MODULE_NAME=HID' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID/src/read.o.d.raw -c
Release/obj.target/HID/src/read.o: ../src/read.cc ../src/read.h \
../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h
../src/read.cc:
../src/read.h:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:

View File

@@ -0,0 +1,20 @@
cmd_Release/obj.target/HID/src/util.o := g++ -o Release/obj.target/HID/src/util.o ../src/util.cc '-DNODE_GYP_MODULE_NAME=HID' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID/src/util.o.d.raw -c
Release/obj.target/HID/src/util.o: ../src/util.cc ../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h
../src/util.cc:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:

View File

@@ -0,0 +1 @@
cmd_Release/obj.target/HID_hidraw.node := g++ -o Release/obj.target/HID_hidraw.node -shared -pthread -rdynamic -m64 -Wl,-soname=HID_hidraw.node -Wl,--start-group Release/obj.target/HID_hidraw/src/exports.o Release/obj.target/HID_hidraw/src/HID.o Release/obj.target/HID_hidraw/src/HIDAsync.o Release/obj.target/HID_hidraw/src/devices.o Release/obj.target/HID_hidraw/src/read.o Release/obj.target/HID_hidraw/src/util.o Release/obj.target/hidapi-linux-hidraw.a -Wl,--end-group -ludev -lusb-1.0

View File

@@ -0,0 +1,23 @@
cmd_Release/obj.target/HID_hidraw/src/HID.o := g++ -o Release/obj.target/HID_hidraw/src/HID.o ../src/HID.cc '-DNODE_GYP_MODULE_NAME=HID_hidraw' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID_hidraw/src/HID.o.d.raw -c
Release/obj.target/HID_hidraw/src/HID.o: ../src/HID.cc ../src/devices.h \
../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h ../src/HID.h
../src/HID.cc:
../src/devices.h:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:
../src/HID.h:

View File

@@ -0,0 +1,24 @@
cmd_Release/obj.target/HID_hidraw/src/HIDAsync.o := g++ -o Release/obj.target/HID_hidraw/src/HIDAsync.o ../src/HIDAsync.cc '-DNODE_GYP_MODULE_NAME=HID_hidraw' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID_hidraw/src/HIDAsync.o.d.raw -c
Release/obj.target/HID_hidraw/src/HIDAsync.o: ../src/HIDAsync.cc \
../src/devices.h ../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h ../src/HIDAsync.h ../src/read.h
../src/HIDAsync.cc:
../src/devices.h:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:
../src/HIDAsync.h:
../src/read.h:

View File

@@ -0,0 +1,22 @@
cmd_Release/obj.target/HID_hidraw/src/devices.o := g++ -o Release/obj.target/HID_hidraw/src/devices.o ../src/devices.cc '-DNODE_GYP_MODULE_NAME=HID_hidraw' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID_hidraw/src/devices.o.d.raw -c
Release/obj.target/HID_hidraw/src/devices.o: ../src/devices.cc \
../src/devices.h ../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h
../src/devices.cc:
../src/devices.h:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:

View File

@@ -0,0 +1,26 @@
cmd_Release/obj.target/HID_hidraw/src/exports.o := g++ -o Release/obj.target/HID_hidraw/src/exports.o ../src/exports.cc '-DNODE_GYP_MODULE_NAME=HID_hidraw' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID_hidraw/src/exports.o.d.raw -c
Release/obj.target/HID_hidraw/src/exports.o: ../src/exports.cc \
../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h ../src/HID.h ../src/HIDAsync.h ../src/read.h \
../src/devices.h
../src/exports.cc:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:
../src/HID.h:
../src/HIDAsync.h:
../src/read.h:
../src/devices.h:

View File

@@ -0,0 +1,22 @@
cmd_Release/obj.target/HID_hidraw/src/read.o := g++ -o Release/obj.target/HID_hidraw/src/read.o ../src/read.cc '-DNODE_GYP_MODULE_NAME=HID_hidraw' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID_hidraw/src/read.o.d.raw -c
Release/obj.target/HID_hidraw/src/read.o: ../src/read.cc ../src/read.h \
../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h
../src/read.cc:
../src/read.h:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:

View File

@@ -0,0 +1,20 @@
cmd_Release/obj.target/HID_hidraw/src/util.o := g++ -o Release/obj.target/HID_hidraw/src/util.o ../src/util.cc '-DNODE_GYP_MODULE_NAME=HID_hidraw' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' '-DBUILDING_NODE_EXTENSION' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -exceptions -m64 -O3 -fno-omit-frame-pointer -fno-rtti -std=gnu++17 -g -exceptions -MMD -MF ./Release/.deps/Release/obj.target/HID_hidraw/src/util.o.d.raw -c
Release/obj.target/HID_hidraw/src/util.o: ../src/util.cc ../src/util.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h \
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h \
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h \
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h \
../hidapi/hidapi/hidapi.h
../src/util.cc:
../src/util.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api.h:
/home/erik/.electron-gyp/28.3.3/include/node/js_native_api_types.h:
/home/erik/.electron-gyp/28.3.3/include/node/node_api_types.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.h:
/home/erik/Git/PackControl/node_modules/node-hid/node_modules/node-addon-api/napi-inl.deprecated.h:
../hidapi/hidapi/hidapi.h:

View File

@@ -0,0 +1,5 @@
cmd_Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o := cc -o Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o ../hidapi/linux/hid.c '-DNODE_GYP_MODULE_NAME=hidapi-linux-hidraw' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -m64 -O3 -fno-omit-frame-pointer -MMD -MF ./Release/.deps/Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o.d.raw -c
Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o: \
../hidapi/linux/hid.c ../hidapi/hidapi/hidapi.h
../hidapi/linux/hid.c:
../hidapi/hidapi/hidapi.h:

View File

@@ -0,0 +1,9 @@
cmd_Release/obj.target/hidapi/hidapi/libusb/hid.o := cc -o Release/obj.target/hidapi/hidapi/libusb/hid.o ../hidapi/libusb/hid.c '-DNODE_GYP_MODULE_NAME=hidapi' '-DUSING_UV_SHARED=1' '-DUSING_V8_SHARED=1' '-DV8_DEPRECATION_WARNINGS=1' '-DV8_DEPRECATION_WARNINGS' '-DV8_IMMINENT_DEPRECATION_WARNINGS' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DELECTRON_ENSURE_CONFIG_GYPI' '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' '-DUSING_ELECTRON_CONFIG_GYPI' '-DV8_COMPRESS_POINTERS' '-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' '-DV8_ENABLE_SANDBOX' '-DV8_31BIT_SMIS_ON_64BIT_ARCH' '-D__STDC_FORMAT_MACROS' '-DOPENSSL_NO_PINSHARED' '-DOPENSSL_THREADS' '-DOPENSSL_NO_ASM' -I/home/erik/.electron-gyp/28.3.3/include/node -I/home/erik/.electron-gyp/28.3.3/src -I/home/erik/.electron-gyp/28.3.3/deps/openssl/config -I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include -I/home/erik/.electron-gyp/28.3.3/deps/uv/include -I/home/erik/.electron-gyp/28.3.3/deps/zlib -I/home/erik/.electron-gyp/28.3.3/deps/v8/include -I../hidapi/hidapi -I/usr/include/libusb-1.0 -fPIC -pthread -Wall -Wextra -Wno-unused-parameter -g -m64 -O3 -fno-omit-frame-pointer -MMD -MF ./Release/.deps/Release/obj.target/hidapi/hidapi/libusb/hid.o.d.raw -c
Release/obj.target/hidapi/hidapi/libusb/hid.o: ../hidapi/libusb/hid.c \
/usr/include/libusb-1.0/libusb.h ../hidapi/libusb/hidapi_libusb.h \
../hidapi/hidapi/hidapi.h ../hidapi/libusb/hidapi_thread_pthread.h
../hidapi/libusb/hid.c:
/usr/include/libusb-1.0/libusb.h:
../hidapi/libusb/hidapi_libusb.h:
../hidapi/hidapi/hidapi.h:
../hidapi/libusb/hidapi_thread_pthread.h:

BIN
node_modules/node-hid/build/Release/HID.node generated vendored Executable file

Binary file not shown.

BIN
node_modules/node-hid/build/Release/HID_hidraw.node generated vendored Executable file

Binary file not shown.

Binary file not shown.

BIN
node_modules/node-hid/build/Release/hidapi.a generated vendored Normal file

Binary file not shown.

BIN
node_modules/node-hid/build/Release/obj.target/HID.node generated vendored Executable file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1 @@
Release/obj.target/hidapi-linux-hidraw/hidapi/linux/hid.o

BIN
node_modules/node-hid/build/Release/obj.target/hidapi.a generated vendored Normal file

Binary file not shown.

View File

@@ -0,0 +1 @@
Release/obj.target/hidapi/hidapi/libusb/hid.o

Binary file not shown.

6
node_modules/node-hid/build/binding.Makefile generated vendored Normal file
View File

@@ -0,0 +1,6 @@
# This file is generated by gyp; do not edit.
export builddir_name ?= ./build/.
.PHONY: all
all:
$(MAKE) hidapi-linux-hidraw HID_hidraw hidapi HID

428
node_modules/node-hid/build/config.gypi generated vendored Normal file
View File

@@ -0,0 +1,428 @@
# Do not edit. File was generated by node-gyp's "configure" step
{
"target_defaults": {
"cflags": [],
"default_configuration": "Release",
"defines": [],
"include_dirs": [],
"libraries": []
},
"variables": {
"asan": 0,
"build_v8_with_gn": "false",
"built_with_electron": 1,
"coverage": "false",
"dcheck_always_on": 0,
"debug_nghttp2": "false",
"debug_node": "false",
"enable_lto": "false",
"enable_pgo_generate": "false",
"enable_pgo_use": "false",
"error_on_warn": "false",
"force_dynamic_crt": 0,
"host_arch": "x64",
"icu_data_in": "..\\..\\deps\\icu-tmp\\icudt73l.dat",
"icu_endianness": "l",
"icu_gyp_path": "tools/icu/icu-generic.gyp",
"icu_path": "deps/icu-small",
"icu_small": "false",
"icu_ver_major": "73",
"is_debug": 0,
"libdir": "lib",
"llvm_version": "0.0",
"napi_build_version": "9",
"node_builtin_shareable_builtins": [
"deps/cjs-module-lexer/lexer.js",
"deps/cjs-module-lexer/dist/lexer.js",
"deps/undici/undici.js"
],
"node_byteorder": "little",
"node_debug_lib": "false",
"node_enable_d8": "false",
"node_enable_v8_vtunejit": "false",
"node_fipsinstall": "false",
"node_install_corepack": "true",
"node_install_npm": "true",
"node_library_files": [
"lib/_http_agent.js",
"lib/_http_client.js",
"lib/_http_common.js",
"lib/_http_incoming.js",
"lib/_http_outgoing.js",
"lib/_http_server.js",
"lib/_stream_duplex.js",
"lib/_stream_passthrough.js",
"lib/_stream_readable.js",
"lib/_stream_transform.js",
"lib/_stream_wrap.js",
"lib/_stream_writable.js",
"lib/_tls_common.js",
"lib/_tls_wrap.js",
"lib/assert.js",
"lib/assert/strict.js",
"lib/async_hooks.js",
"lib/buffer.js",
"lib/child_process.js",
"lib/cluster.js",
"lib/console.js",
"lib/constants.js",
"lib/crypto.js",
"lib/dgram.js",
"lib/diagnostics_channel.js",
"lib/dns.js",
"lib/dns/promises.js",
"lib/domain.js",
"lib/events.js",
"lib/fs.js",
"lib/fs/promises.js",
"lib/http.js",
"lib/http2.js",
"lib/https.js",
"lib/inspector.js",
"lib/internal/abort_controller.js",
"lib/internal/assert.js",
"lib/internal/assert/assertion_error.js",
"lib/internal/assert/calltracker.js",
"lib/internal/async_hooks.js",
"lib/internal/blob.js",
"lib/internal/blocklist.js",
"lib/internal/bootstrap/browser.js",
"lib/internal/bootstrap/loaders.js",
"lib/internal/bootstrap/node.js",
"lib/internal/bootstrap/switches/does_not_own_process_state.js",
"lib/internal/bootstrap/switches/does_own_process_state.js",
"lib/internal/bootstrap/switches/is_main_thread.js",
"lib/internal/bootstrap/switches/is_not_main_thread.js",
"lib/internal/buffer.js",
"lib/internal/child_process.js",
"lib/internal/child_process/serialization.js",
"lib/internal/cli_table.js",
"lib/internal/cluster/child.js",
"lib/internal/cluster/primary.js",
"lib/internal/cluster/round_robin_handle.js",
"lib/internal/cluster/shared_handle.js",
"lib/internal/cluster/utils.js",
"lib/internal/cluster/worker.js",
"lib/internal/console/constructor.js",
"lib/internal/console/global.js",
"lib/internal/constants.js",
"lib/internal/crypto/aes.js",
"lib/internal/crypto/certificate.js",
"lib/internal/crypto/cfrg.js",
"lib/internal/crypto/cipher.js",
"lib/internal/crypto/diffiehellman.js",
"lib/internal/crypto/ec.js",
"lib/internal/crypto/hash.js",
"lib/internal/crypto/hashnames.js",
"lib/internal/crypto/hkdf.js",
"lib/internal/crypto/keygen.js",
"lib/internal/crypto/keys.js",
"lib/internal/crypto/mac.js",
"lib/internal/crypto/pbkdf2.js",
"lib/internal/crypto/random.js",
"lib/internal/crypto/rsa.js",
"lib/internal/crypto/scrypt.js",
"lib/internal/crypto/sig.js",
"lib/internal/crypto/util.js",
"lib/internal/crypto/webcrypto.js",
"lib/internal/crypto/webidl.js",
"lib/internal/crypto/x509.js",
"lib/internal/debugger/inspect.js",
"lib/internal/debugger/inspect_client.js",
"lib/internal/debugger/inspect_repl.js",
"lib/internal/dgram.js",
"lib/internal/dns/callback_resolver.js",
"lib/internal/dns/promises.js",
"lib/internal/dns/utils.js",
"lib/internal/dtrace.js",
"lib/internal/encoding.js",
"lib/internal/error_serdes.js",
"lib/internal/errors.js",
"lib/internal/event_target.js",
"lib/internal/file.js",
"lib/internal/fixed_queue.js",
"lib/internal/freelist.js",
"lib/internal/freeze_intrinsics.js",
"lib/internal/fs/cp/cp-sync.js",
"lib/internal/fs/cp/cp.js",
"lib/internal/fs/dir.js",
"lib/internal/fs/promises.js",
"lib/internal/fs/read_file_context.js",
"lib/internal/fs/recursive_watch.js",
"lib/internal/fs/rimraf.js",
"lib/internal/fs/streams.js",
"lib/internal/fs/sync_write_stream.js",
"lib/internal/fs/utils.js",
"lib/internal/fs/watchers.js",
"lib/internal/heap_utils.js",
"lib/internal/histogram.js",
"lib/internal/http.js",
"lib/internal/http2/compat.js",
"lib/internal/http2/core.js",
"lib/internal/http2/util.js",
"lib/internal/idna.js",
"lib/internal/inspector_async_hook.js",
"lib/internal/js_stream_socket.js",
"lib/internal/legacy/processbinding.js",
"lib/internal/linkedlist.js",
"lib/internal/main/check_syntax.js",
"lib/internal/main/environment.js",
"lib/internal/main/eval_stdin.js",
"lib/internal/main/eval_string.js",
"lib/internal/main/inspect.js",
"lib/internal/main/mksnapshot.js",
"lib/internal/main/print_help.js",
"lib/internal/main/prof_process.js",
"lib/internal/main/repl.js",
"lib/internal/main/run_main_module.js",
"lib/internal/main/single_executable_application.js",
"lib/internal/main/test_runner.js",
"lib/internal/main/watch_mode.js",
"lib/internal/main/worker_thread.js",
"lib/internal/mime.js",
"lib/internal/modules/cjs/helpers.js",
"lib/internal/modules/cjs/loader.js",
"lib/internal/modules/esm/assert.js",
"lib/internal/modules/esm/create_dynamic_module.js",
"lib/internal/modules/esm/fetch_module.js",
"lib/internal/modules/esm/formats.js",
"lib/internal/modules/esm/get_format.js",
"lib/internal/modules/esm/handle_process_exit.js",
"lib/internal/modules/esm/initialize_import_meta.js",
"lib/internal/modules/esm/load.js",
"lib/internal/modules/esm/loader.js",
"lib/internal/modules/esm/module_job.js",
"lib/internal/modules/esm/module_map.js",
"lib/internal/modules/esm/package_config.js",
"lib/internal/modules/esm/resolve.js",
"lib/internal/modules/esm/translators.js",
"lib/internal/modules/esm/utils.js",
"lib/internal/modules/package_json_reader.js",
"lib/internal/modules/run_main.js",
"lib/internal/net.js",
"lib/internal/options.js",
"lib/internal/per_context/domexception.js",
"lib/internal/per_context/messageport.js",
"lib/internal/per_context/primordials.js",
"lib/internal/perf/event_loop_delay.js",
"lib/internal/perf/event_loop_utilization.js",
"lib/internal/perf/nodetiming.js",
"lib/internal/perf/observe.js",
"lib/internal/perf/performance.js",
"lib/internal/perf/performance_entry.js",
"lib/internal/perf/resource_timing.js",
"lib/internal/perf/timerify.js",
"lib/internal/perf/usertiming.js",
"lib/internal/perf/utils.js",
"lib/internal/policy/manifest.js",
"lib/internal/policy/sri.js",
"lib/internal/priority_queue.js",
"lib/internal/process/esm_loader.js",
"lib/internal/process/execution.js",
"lib/internal/process/per_thread.js",
"lib/internal/process/policy.js",
"lib/internal/process/pre_execution.js",
"lib/internal/process/promises.js",
"lib/internal/process/report.js",
"lib/internal/process/signal.js",
"lib/internal/process/task_queues.js",
"lib/internal/process/warning.js",
"lib/internal/process/worker_thread_only.js",
"lib/internal/promise_hooks.js",
"lib/internal/querystring.js",
"lib/internal/readline/callbacks.js",
"lib/internal/readline/emitKeypressEvents.js",
"lib/internal/readline/interface.js",
"lib/internal/readline/promises.js",
"lib/internal/readline/utils.js",
"lib/internal/repl.js",
"lib/internal/repl/await.js",
"lib/internal/repl/history.js",
"lib/internal/repl/utils.js",
"lib/internal/socket_list.js",
"lib/internal/socketaddress.js",
"lib/internal/source_map/prepare_stack_trace.js",
"lib/internal/source_map/source_map.js",
"lib/internal/source_map/source_map_cache.js",
"lib/internal/stream_base_commons.js",
"lib/internal/streams/add-abort-signal.js",
"lib/internal/streams/buffer_list.js",
"lib/internal/streams/compose.js",
"lib/internal/streams/destroy.js",
"lib/internal/streams/duplex.js",
"lib/internal/streams/duplexify.js",
"lib/internal/streams/end-of-stream.js",
"lib/internal/streams/from.js",
"lib/internal/streams/lazy_transform.js",
"lib/internal/streams/legacy.js",
"lib/internal/streams/operators.js",
"lib/internal/streams/passthrough.js",
"lib/internal/streams/pipeline.js",
"lib/internal/streams/readable.js",
"lib/internal/streams/state.js",
"lib/internal/streams/transform.js",
"lib/internal/streams/utils.js",
"lib/internal/streams/writable.js",
"lib/internal/structured_clone.js",
"lib/internal/test/binding.js",
"lib/internal/test/transfer.js",
"lib/internal/test_runner/coverage.js",
"lib/internal/test_runner/harness.js",
"lib/internal/test_runner/mock.js",
"lib/internal/test_runner/reporter/dot.js",
"lib/internal/test_runner/reporter/spec.js",
"lib/internal/test_runner/reporter/tap.js",
"lib/internal/test_runner/reporter/v8-serializer.js",
"lib/internal/test_runner/runner.js",
"lib/internal/test_runner/test.js",
"lib/internal/test_runner/tests_stream.js",
"lib/internal/test_runner/utils.js",
"lib/internal/timers.js",
"lib/internal/tls/secure-context.js",
"lib/internal/tls/secure-pair.js",
"lib/internal/trace_events_async_hooks.js",
"lib/internal/tty.js",
"lib/internal/url.js",
"lib/internal/util.js",
"lib/internal/util/colors.js",
"lib/internal/util/comparisons.js",
"lib/internal/util/debuglog.js",
"lib/internal/util/inspect.js",
"lib/internal/util/inspector.js",
"lib/internal/util/iterable_weak_map.js",
"lib/internal/util/parse_args/parse_args.js",
"lib/internal/util/parse_args/utils.js",
"lib/internal/util/types.js",
"lib/internal/v8/startup_snapshot.js",
"lib/internal/v8_prof_polyfill.js",
"lib/internal/v8_prof_processor.js",
"lib/internal/validators.js",
"lib/internal/vm.js",
"lib/internal/vm/module.js",
"lib/internal/wasm_web_api.js",
"lib/internal/watch_mode/files_watcher.js",
"lib/internal/watchdog.js",
"lib/internal/webidl.js",
"lib/internal/webstreams/adapters.js",
"lib/internal/webstreams/compression.js",
"lib/internal/webstreams/encoding.js",
"lib/internal/webstreams/queuingstrategies.js",
"lib/internal/webstreams/readablestream.js",
"lib/internal/webstreams/transfer.js",
"lib/internal/webstreams/transformstream.js",
"lib/internal/webstreams/util.js",
"lib/internal/webstreams/writablestream.js",
"lib/internal/worker.js",
"lib/internal/worker/io.js",
"lib/internal/worker/js_transferable.js",
"lib/module.js",
"lib/net.js",
"lib/os.js",
"lib/path.js",
"lib/path/posix.js",
"lib/path/win32.js",
"lib/perf_hooks.js",
"lib/process.js",
"lib/punycode.js",
"lib/querystring.js",
"lib/readline.js",
"lib/readline/promises.js",
"lib/repl.js",
"lib/stream.js",
"lib/stream/consumers.js",
"lib/stream/promises.js",
"lib/stream/web.js",
"lib/string_decoder.js",
"lib/sys.js",
"lib/test.js",
"lib/test/reporters.js",
"lib/timers.js",
"lib/timers/promises.js",
"lib/tls.js",
"lib/trace_events.js",
"lib/tty.js",
"lib/url.js",
"lib/util.js",
"lib/util/types.js",
"lib/v8.js",
"lib/vm.js",
"lib/wasi.js",
"lib/worker_threads.js",
"lib/zlib.js"
],
"node_module_version": 119,
"node_no_browser_globals": "false",
"node_prefix": "\\usr\\local",
"node_release_urlbase": "",
"node_shared": "false",
"node_shared_brotli": "false",
"node_shared_cares": "false",
"node_shared_http_parser": "false",
"node_shared_libuv": "false",
"node_shared_nghttp2": "false",
"node_shared_nghttp3": "false",
"node_shared_ngtcp2": "false",
"node_shared_openssl": "false",
"node_shared_zlib": "false",
"node_tag": "",
"node_target_type": "executable",
"node_use_bundled_v8": "true",
"node_use_dtrace": "false",
"node_use_etw": "true",
"node_use_node_code_cache": "true",
"node_use_node_snapshot": "true",
"node_use_openssl": "true",
"node_use_v8_platform": "true",
"node_with_ltcg": "true",
"node_without_node_options": "false",
"openssl_is_fips": "false",
"openssl_no_asm": 1,
"openssl_quic": "true",
"ossfuzz": "false",
"shlib_suffix": "so.108",
"single_executable_application": "true",
"target_arch": "x64",
"using_electron_config_gypi": 1,
"v8_enable_31bit_smis_on_64bit_arch": 1,
"v8_enable_gdbjit": 0,
"v8_enable_hugepage": 0,
"v8_enable_i18n_support": 1,
"v8_enable_inspector": 1,
"v8_enable_javascript_promise_hooks": 1,
"v8_enable_lite_mode": 0,
"v8_enable_object_print": 1,
"v8_enable_pointer_compression": 1,
"v8_enable_sandbox": 1,
"v8_enable_shared_ro_heap": 0,
"v8_enable_short_builtin_calls": 1,
"v8_enable_webassembly": 1,
"v8_no_strict_aliasing": 1,
"v8_optimized_debug": 1,
"v8_promise_internal_field_count": 1,
"v8_random_seed": 0,
"v8_trace_maps": 0,
"v8_use_siphash": 1,
"want_separate_host_toolset": 0,
"nodedir": "/home/erik/.electron-gyp/28.3.3",
"python": "/usr/bin/python3",
"standalone_static_library": 1,
"global_prefix": "/usr",
"disturl": "https://electronjs.org/headers",
"node_gyp": "/usr/lib/node_modules/node-gyp/bin/node-gyp.js",
"target": "28.3.3",
"platform": "linux",
"user_agent": "npm/11.10.1 node/v25.6.1 linux x64 workspaces/false",
"fallback_to_build": "true",
"update_binary": "true",
"prefix": "/usr",
"npm_version": "11.10.1",
"runtime": "electron",
"target_platform": "linux",
"init_module": "/home/erik/.npm-init.js",
"globalconfig": "/etc/npmrc",
"build_from_source": "false",
"local_prefix": "/home/erik/Git/PackControl",
"cache": "/home/erik/.npm",
"userconfig": "/home/erik/.npmrc"
}
}

View File

@@ -0,0 +1,182 @@
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := hidapi-linux-hidraw
DEFS_Debug := \
'-DNODE_GYP_MODULE_NAME=hidapi-linux-hidraw' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-DELECTRON_ENSURE_CONFIG_GYPI' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DUSING_ELECTRON_CONFIG_GYPI' \
'-DV8_COMPRESS_POINTERS' \
'-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' \
'-DV8_ENABLE_SANDBOX' \
'-DV8_31BIT_SMIS_ON_64BIT_ARCH' \
'-D__STDC_FORMAT_MACROS' \
'-DOPENSSL_NO_PINSHARED' \
'-DOPENSSL_THREADS' \
'-DOPENSSL_NO_ASM' \
'-DDEBUG' \
'-D_DEBUG' \
'-DV8_ENABLE_CHECKS'
# Flags passed to all source files.
CFLAGS_Debug := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-g \
-m64 \
-g \
-O0
# Flags passed to only C files.
CFLAGS_C_Debug :=
# Flags passed to only C++ files.
CFLAGS_CC_Debug := \
-fno-rtti \
-fno-exceptions \
-std=gnu++17
INCS_Debug := \
-I/home/erik/.electron-gyp/28.3.3/include/node \
-I/home/erik/.electron-gyp/28.3.3/src \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/config \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include \
-I/home/erik/.electron-gyp/28.3.3/deps/uv/include \
-I/home/erik/.electron-gyp/28.3.3/deps/zlib \
-I/home/erik/.electron-gyp/28.3.3/deps/v8/include \
-I$(srcdir)/hidapi/hidapi
DEFS_Release := \
'-DNODE_GYP_MODULE_NAME=hidapi-linux-hidraw' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-DELECTRON_ENSURE_CONFIG_GYPI' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DUSING_ELECTRON_CONFIG_GYPI' \
'-DV8_COMPRESS_POINTERS' \
'-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' \
'-DV8_ENABLE_SANDBOX' \
'-DV8_31BIT_SMIS_ON_64BIT_ARCH' \
'-D__STDC_FORMAT_MACROS' \
'-DOPENSSL_NO_PINSHARED' \
'-DOPENSSL_THREADS' \
'-DOPENSSL_NO_ASM'
# Flags passed to all source files.
CFLAGS_Release := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-g \
-m64 \
-O3 \
-fno-omit-frame-pointer
# Flags passed to only C files.
CFLAGS_C_Release :=
# Flags passed to only C++ files.
CFLAGS_CC_Release := \
-fno-rtti \
-fno-exceptions \
-std=gnu++17
INCS_Release := \
-I/home/erik/.electron-gyp/28.3.3/include/node \
-I/home/erik/.electron-gyp/28.3.3/src \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/config \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include \
-I/home/erik/.electron-gyp/28.3.3/deps/uv/include \
-I/home/erik/.electron-gyp/28.3.3/deps/zlib \
-I/home/erik/.electron-gyp/28.3.3/deps/v8/include \
-I$(srcdir)/hidapi/hidapi
OBJS := \
$(obj).target/$(TARGET)/hidapi/linux/hid.o
# Add to the list of files we specially track dependencies for.
all_deps += $(OBJS)
# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.
$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
# End of this set of suffix rules
### Rules for final target.
LDFLAGS_Debug := \
-pthread \
-rdynamic \
-m64
LDFLAGS_Release := \
-pthread \
-rdynamic \
-m64
LIBS :=
$(obj).target/hidapi-linux-hidraw.a: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(obj).target/hidapi-linux-hidraw.a: LIBS := $(LIBS)
$(obj).target/hidapi-linux-hidraw.a: TOOLSET := $(TOOLSET)
$(obj).target/hidapi-linux-hidraw.a: $(OBJS)
$(call create_archive,$@,$^)
# Add target alias
.PHONY: hidapi-linux-hidraw
hidapi-linux-hidraw: $(obj).target/hidapi-linux-hidraw.a
# Add target alias to "all" target.
.PHONY: all
all: hidapi-linux-hidraw
# Add target alias
.PHONY: hidapi-linux-hidraw
hidapi-linux-hidraw: $(builddir)/hidapi-linux-hidraw.a
# Copy this to the static library output path.
$(builddir)/hidapi-linux-hidraw.a: TOOLSET := $(TOOLSET)
$(builddir)/hidapi-linux-hidraw.a: $(obj).target/hidapi-linux-hidraw.a FORCE_DO_CMD
$(call do_cmd,copy)
all_deps += $(builddir)/hidapi-linux-hidraw.a
# Short alias for building this static library.
.PHONY: hidapi-linux-hidraw.a
hidapi-linux-hidraw.a: $(obj).target/hidapi-linux-hidraw.a $(builddir)/hidapi-linux-hidraw.a
# Add static library to "all" target.
.PHONY: all
all: $(builddir)/hidapi-linux-hidraw.a

184
node_modules/node-hid/build/hidapi.target.mk generated vendored Normal file
View File

@@ -0,0 +1,184 @@
# This file is generated by gyp; do not edit.
TOOLSET := target
TARGET := hidapi
DEFS_Debug := \
'-DNODE_GYP_MODULE_NAME=hidapi' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-DELECTRON_ENSURE_CONFIG_GYPI' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DUSING_ELECTRON_CONFIG_GYPI' \
'-DV8_COMPRESS_POINTERS' \
'-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' \
'-DV8_ENABLE_SANDBOX' \
'-DV8_31BIT_SMIS_ON_64BIT_ARCH' \
'-D__STDC_FORMAT_MACROS' \
'-DOPENSSL_NO_PINSHARED' \
'-DOPENSSL_THREADS' \
'-DOPENSSL_NO_ASM' \
'-DDEBUG' \
'-D_DEBUG' \
'-DV8_ENABLE_CHECKS'
# Flags passed to all source files.
CFLAGS_Debug := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-g \
-m64 \
-g \
-O0
# Flags passed to only C files.
CFLAGS_C_Debug :=
# Flags passed to only C++ files.
CFLAGS_CC_Debug := \
-fno-rtti \
-fno-exceptions \
-std=gnu++17
INCS_Debug := \
-I/home/erik/.electron-gyp/28.3.3/include/node \
-I/home/erik/.electron-gyp/28.3.3/src \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/config \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include \
-I/home/erik/.electron-gyp/28.3.3/deps/uv/include \
-I/home/erik/.electron-gyp/28.3.3/deps/zlib \
-I/home/erik/.electron-gyp/28.3.3/deps/v8/include \
-I$(srcdir)/hidapi/hidapi \
-I/usr/include/libusb-1.0
DEFS_Release := \
'-DNODE_GYP_MODULE_NAME=hidapi' \
'-DUSING_UV_SHARED=1' \
'-DUSING_V8_SHARED=1' \
'-DV8_DEPRECATION_WARNINGS=1' \
'-DV8_DEPRECATION_WARNINGS' \
'-DV8_IMMINENT_DEPRECATION_WARNINGS' \
'-D_GLIBCXX_USE_CXX11_ABI=1' \
'-DELECTRON_ENSURE_CONFIG_GYPI' \
'-D_LARGEFILE_SOURCE' \
'-D_FILE_OFFSET_BITS=64' \
'-DUSING_ELECTRON_CONFIG_GYPI' \
'-DV8_COMPRESS_POINTERS' \
'-DV8_COMPRESS_POINTERS_IN_SHARED_CAGE' \
'-DV8_ENABLE_SANDBOX' \
'-DV8_31BIT_SMIS_ON_64BIT_ARCH' \
'-D__STDC_FORMAT_MACROS' \
'-DOPENSSL_NO_PINSHARED' \
'-DOPENSSL_THREADS' \
'-DOPENSSL_NO_ASM'
# Flags passed to all source files.
CFLAGS_Release := \
-fPIC \
-pthread \
-Wall \
-Wextra \
-Wno-unused-parameter \
-g \
-m64 \
-O3 \
-fno-omit-frame-pointer
# Flags passed to only C files.
CFLAGS_C_Release :=
# Flags passed to only C++ files.
CFLAGS_CC_Release := \
-fno-rtti \
-fno-exceptions \
-std=gnu++17
INCS_Release := \
-I/home/erik/.electron-gyp/28.3.3/include/node \
-I/home/erik/.electron-gyp/28.3.3/src \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/config \
-I/home/erik/.electron-gyp/28.3.3/deps/openssl/openssl/include \
-I/home/erik/.electron-gyp/28.3.3/deps/uv/include \
-I/home/erik/.electron-gyp/28.3.3/deps/zlib \
-I/home/erik/.electron-gyp/28.3.3/deps/v8/include \
-I$(srcdir)/hidapi/hidapi \
-I/usr/include/libusb-1.0
OBJS := \
$(obj).target/$(TARGET)/hidapi/libusb/hid.o
# Add to the list of files we specially track dependencies for.
all_deps += $(OBJS)
# CFLAGS et al overrides must be target-local.
# See "Target-specific Variable Values" in the GNU Make manual.
$(OBJS): TOOLSET := $(TOOLSET)
$(OBJS): GYP_CFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_C_$(BUILDTYPE))
$(OBJS): GYP_CXXFLAGS := $(DEFS_$(BUILDTYPE)) $(INCS_$(BUILDTYPE)) $(CFLAGS_$(BUILDTYPE)) $(CFLAGS_CC_$(BUILDTYPE))
# Suffix rules, putting all outputs into $(obj).
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(srcdir)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
# Try building from generated source, too.
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj).$(TOOLSET)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
$(obj).$(TOOLSET)/$(TARGET)/%.o: $(obj)/%.c FORCE_DO_CMD
@$(call do_cmd,cc,1)
# End of this set of suffix rules
### Rules for final target.
LDFLAGS_Debug := \
-pthread \
-rdynamic \
-m64
LDFLAGS_Release := \
-pthread \
-rdynamic \
-m64
LIBS :=
$(obj).target/hidapi.a: GYP_LDFLAGS := $(LDFLAGS_$(BUILDTYPE))
$(obj).target/hidapi.a: LIBS := $(LIBS)
$(obj).target/hidapi.a: TOOLSET := $(TOOLSET)
$(obj).target/hidapi.a: $(OBJS)
$(call create_archive,$@,$^)
# Add target alias
.PHONY: hidapi
hidapi: $(obj).target/hidapi.a
# Add target alias to "all" target.
.PHONY: all
all: hidapi
# Add target alias
.PHONY: hidapi
hidapi: $(builddir)/hidapi.a
# Copy this to the static library output path.
$(builddir)/hidapi.a: TOOLSET := $(TOOLSET)
$(builddir)/hidapi.a: $(obj).target/hidapi.a FORCE_DO_CMD
$(call do_cmd,copy)
all_deps += $(builddir)/hidapi.a
# Short alias for building this static library.
.PHONY: hidapi.a
hidapi.a: $(obj).target/hidapi.a $(builddir)/hidapi.a
# Add static library to "all" target.
.PHONY: all
all: $(builddir)/hidapi.a

31
node_modules/node-hid/hidapi/.appveyor.yml generated vendored Normal file
View File

@@ -0,0 +1,31 @@
environment:
matrix:
- BUILD_ENV: msbuild
arch: x64
- BUILD_ENV: msbuild
arch: Win32
- BUILD_ENV: cygwin
for:
-
matrix:
only:
- BUILD_ENV: msbuild
os: Visual Studio 2015
build_script:
- cmd: msbuild .\windows\hidapi.sln /p:Configuration=Release /p:Platform=%arch% /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
-
matrix:
only:
- BUILD_ENV: cygwin
os: Visual Studio 2022
install:
- cmd: C:\cygwin64\setup-x86_64.exe --quiet-mode --no-shortcuts --upgrade-also --packages autoconf,automake
build_script:
- cmd: C:\cygwin64\bin\bash -exlc "cd $APPVEYOR_BUILD_FOLDER; ./bootstrap; ./configure; make"

34
node_modules/node-hid/hidapi/.builds/freebsd.yml generated vendored Normal file
View File

@@ -0,0 +1,34 @@
image: freebsd/latest
packages:
- autoconf
- automake
- gmake
- libiconv
- libtool
- pkgconf
- cmake
- ninja
sources:
- https://github.com/libusb/hidapi
tasks:
- configure: |
cd hidapi
echo Configure Autotools build
./bootstrap
./configure
echo Configure CMake build
mkdir -p build install_cmake
cmake -GNinja -B build -S . -DCMAKE_INSTALL_PREFIX=install_cmake
- build-autotools: |
cd hidapi
make
make DESTDIR=$PWD/root install
make clean
- build-cmake: |
cd hidapi/build
ninja
ninja install
ninja clean
- build-manual: |
cd hidapi/libusb
gmake -f Makefile-manual

18
node_modules/node-hid/hidapi/.builds/netbsd.yml generated vendored Normal file
View File

@@ -0,0 +1,18 @@
image: netbsd/latest
packages:
- cmake
- pkgconf
- libusb1
- libiconv
sources:
- https://github.com/libusb/hidapi
tasks:
- configure: |
cd hidapi
mkdir -p build install
cmake -B build -S . -DCMAKE_INSTALL_PREFIX=install
- build: |
cd hidapi/build
make
make install
make clean

19
node_modules/node-hid/hidapi/.builds/openbsd.yml generated vendored Normal file
View File

@@ -0,0 +1,19 @@
image: openbsd/latest
packages:
- cmake
- pkgconf
- libusb1--
- libiconv
- ninja
sources:
- https://github.com/libusb/hidapi
tasks:
- configure: |
cd hidapi
mkdir -p build install
cmake -GNinja -B build -S . -DCMAKE_INSTALL_PREFIX=install
- build: |
cd hidapi/build
ninja
ninja install
ninja clean

33
node_modules/node-hid/hidapi/.cirrus.yml generated vendored Normal file
View File

@@ -0,0 +1,33 @@
alpine_task:
container:
image: alpine:latest
install_script: apk add autoconf automake g++ gcc libusb-dev libtool linux-headers eudev-dev make musl-dev
script:
- ./bootstrap
- ./configure || { cat config.log; exit 1; }
- make
- make install
freebsd11_task:
freebsd_instance:
image: freebsd-11-2-release-amd64
install_script:
- pkg install -y
autoconf automake libiconv libtool pkgconf
script:
- ./bootstrap
- ./configure || { cat config.log; exit 1; }
- make
- make install
freebsd12_task:
freebsd_instance:
image: freebsd-12-1-release-amd64
install_script:
- pkg install -y
autoconf automake libiconv libtool pkgconf
script:
- ./bootstrap
- ./configure || { cat config.log; exit 1; }
- make
- make install

7
node_modules/node-hid/hidapi/.gitattributes generated vendored Normal file
View File

@@ -0,0 +1,7 @@
* text=auto
*.sln text eol=crlf
*.vcproj text eol=crlf
bootstrap text eol=lf
configure.ac text eol=lf

View File

@@ -0,0 +1,580 @@
name: GitHub Builds
on: [push, pull_request]
env:
NIX_COMPILE_FLAGS: -Wall -Wextra -pedantic -Werror
GNU_COMPILE_FLAGS: -Wall -Wextra -pedantic -Werror -Wformat-signedness
MSVC_COMPILE_FLAGS: /W4 /WX
jobs:
macos-automake:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install build tools
run: brew install autoconf automake libtool
- name: Configure Automake
run: |
./bootstrap
./configure --prefix=$(pwd)/install
- name: Build Automake
run: |
make
make install
- name: Clean build
run: make clean
- name: Build Manual makefile
working-directory: mac
run: make -f Makefile-manual
macos-cmake:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
with:
path: hidapisrc
- name: Install dependencies
run: brew install meson ninja
- name: Configure CMake
run: |
rm -rf build install
cmake -B build/shared -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install/shared -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
cmake -B build/static -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install/static -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
cmake -B build/framework -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install/framework -DCMAKE_FRAMEWORK=ON -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
- name: Build CMake Shared
working-directory: build/shared
run: make install
- name: Build CMake Static
working-directory: build/static
run: make install
- name: Build CMake Framework
working-directory: build/framework
run: make install
- name: Check artifacts
uses: andstor/file-existence-action@v2
with:
files: "install/shared/lib/libhidapi.dylib, \
install/shared/include/hidapi/hidapi.h, \
install/shared/include/hidapi/hidapi_darwin.h, \
install/static/lib/libhidapi.a, \
install/static/include/hidapi/hidapi.h, \
install/static/include/hidapi/hidapi_darwin.h, \
install/framework/lib/hidapi.framework/hidapi, \
install/framework/lib/hidapi.framework/Headers/hidapi.h, \
install/framework/lib/hidapi.framework/Headers/hidapi_darwin.h"
fail: true
- name: Check CMake Export Package Shared
run: |
cmake \
-B build/shared_test \
-S hidapisrc/hidtest \
-Dhidapi_ROOT=install/shared \
-DCMAKE_INSTALL_PREFIX=install/shared_test \
"-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
cd build/shared_test
make install
- name: Check CMake Export Package Static
run: |
cmake \
-B build/static_test \
-S hidapisrc/hidtest \
-Dhidapi_ROOT=install/static \
-DCMAKE_INSTALL_PREFIX=install/static_test \
"-DCMAKE_C_FLAGS=${NIX_COMPILE_FLAGS}"
cd build/static_test
make install
- name: Check Meson build
run: |
meson setup build_meson hidapisrc
cd build_meson
ninja
ubuntu-cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: hidapisrc
- name: Install dependencies
run: |
sudo apt update
sudo apt install libudev-dev libusb-1.0-0-dev python3-pip ninja-build
sudo -H pip3 install meson
- name: Configure CMake
run: |
rm -rf build install
cmake -B build/shared -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install/shared -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
cmake -B build/static -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install/static -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
- name: Build CMake Shared
working-directory: build/shared
run: make install
- name: Build CMake Static
working-directory: build/static
run: make install
- name: Check artifacts
uses: andstor/file-existence-action@v2
with:
files: "install/shared/lib/libhidapi-libusb.so, \
install/shared/lib/libhidapi-hidraw.so, \
install/shared/include/hidapi/hidapi.h, \
install/shared/include/hidapi/hidapi_libusb.h, \
install/static/lib/libhidapi-libusb.a, \
install/static/lib/libhidapi-hidraw.a, \
install/static/include/hidapi/hidapi.h, \
install/static/include/hidapi/hidapi_libusb.h"
fail: true
- name: Check CMake Export Package Shared
run: |
cmake \
-B build/shared_test \
-S hidapisrc/hidtest \
-Dhidapi_ROOT=install/shared \
-DCMAKE_INSTALL_PREFIX=install/shared_test \
"-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
cd build/shared_test
make install
- name: Check CMake Export Package Static
run: |
cmake \
-B build/static_test \
-S hidapisrc/hidtest \
-Dhidapi_ROOT=install/static \
-DCMAKE_INSTALL_PREFIX=install/static_test \
"-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
cd build/static_test
make install
- name: Check Meson build
run: |
meson setup build_meson hidapisrc
cd build_meson
ninja
windows-cmake:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
path: hidapisrc
- name: Install dependencies
shell: cmd
run: |
choco install ninja
pip3 install meson
refreshenv
- name: Configure CMake MSVC
shell: cmd
run: |
cmake -B build\msvc -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_PP_DATA_DUMP=ON -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install\msvc -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
- name: Build CMake MSVC
working-directory: build/msvc
run: cmake --build . --config RelWithDebInfo --target install
- name: Check artifacts CMake MSVC
uses: andstor/file-existence-action@v2
with:
files: "install/msvc/lib/hidapi.lib, \
install/msvc/bin/hidapi.dll, \
install/msvc/include/hidapi/hidapi.h, \
install/msvc/include/hidapi/hidapi_winapi.h"
fail: true
- name: Check CMake MSVC Export Package
shell: cmd
run: |
cmake ^
-B build\msvc_test ^
-S hidapisrc\hidtest ^
-Dhidapi_ROOT=install\msvc ^
-DCMAKE_INSTALL_PREFIX=install\msvc_test ^
"-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
cd build\msvc_test
cmake --build . --target install
- name: Run CTest MSVC
shell: cmd
working-directory: build/msvc
run: ctest -C RelWithDebInfo --no-compress-output --output-on-failure
- name: Configure CMake NMake MSVC
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake -G"NMake Makefiles" -B build\nmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_PP_DATA_DUMP=ON -DHIDAPI_ENABLE_ASAN=ON -DCMAKE_INSTALL_PREFIX=install\nmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
- name: Build CMake NMake MSVC
working-directory: build\nmake
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
nmake install
- name: Check artifacts CMake NMake MSVC
uses: andstor/file-existence-action@v2
with:
files: "install/nmake/lib/hidapi.lib, \
install/nmake/bin/hidapi.dll, \
install/nmake/include/hidapi/hidapi.h, \
install/nmake/include/hidapi/hidapi_winapi.h"
fail: true
- name: Check CMake NMake MSVC Export Package
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake ^
-G"NMake Makefiles" ^
-B build\nmake_test ^
-S hidapisrc\hidtest ^
-Dhidapi_ROOT=install\nmake ^
-DCMAKE_INSTALL_PREFIX=install\nmake_test ^
"-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
cd build\nmake_test
nmake install
- name: Run CTest NMake MSVC
working-directory: build\nmake
run: ctest --no-compress-output --output-on-failure
- name: Configure CMake NMake ClangCL
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake -G"NMake Makefiles" -B build\clang_cl -S hidapisrc -D CMAKE_C_COMPILER=clang-cl -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_PP_DATA_DUMP=ON -DHIDAPI_ENABLE_ASAN=OFF -DCMAKE_INSTALL_PREFIX=install\clang_cl -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
- name: Build CMake NMake ClangCL
working-directory: build\clang_cl
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
nmake install
- name: Check artifacts CMake NMake ClangCL
uses: andstor/file-existence-action@v2
with:
files: "install/clang_cl/lib/hidapi.lib, \
install/clang_cl/bin/hidapi.dll, \
install/clang_cl/include/hidapi/hidapi.h, \
install/clang_cl/include/hidapi/hidapi_winapi.h"
fail: true
- name: Check CMake NMake ClangCL Export Package
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cmake ^
-G"NMake Makefiles" ^
-B build\clang_cl_test ^
-S hidapisrc\hidtest ^
-D CMAKE_C_COMPILER=clang-cl ^
-Dhidapi_ROOT=install\clang_cl ^
-DCMAKE_INSTALL_PREFIX=install\clang_cl_test ^
"-DCMAKE_C_FLAGS=%MSVC_COMPILE_FLAGS%"
cd build\clang_cl_test
cmake --build . --target install
- name: Run CTest NMake ClangCL
shell: cmd
working-directory: build/clang_cl
run: ctest -C RelWithDebInfo --no-compress-output --output-on-failure
- name: Configure CMake MinGW
shell: cmd
run: |
cmake -G"MinGW Makefiles" -B build\mingw -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_PP_DATA_DUMP=ON -DCMAKE_INSTALL_PREFIX=install\mingw -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=%GNU_COMPILE_FLAGS%"
- name: Build CMake MinGW
working-directory: build\mingw
run: cmake --build . --target install
- name: Check artifacts MinGW
uses: andstor/file-existence-action@v2
with:
files: "install/mingw/lib/libhidapi.dll.a, \
install/mingw/bin/libhidapi.dll, \
install/mingw/include/hidapi/hidapi.h, \
install/mingw/include/hidapi/hidapi_winapi.h"
fail: true
- name: Check CMake Export Package MinGW
shell: cmd
run: |
cmake ^
-G"MinGW Makefiles" ^
-B build\mingw_test ^
-S hidapisrc\hidtest ^
-Dhidapi_ROOT=install\mingw ^
-DCMAKE_INSTALL_PREFIX=install\mingw_test ^
"-DCMAKE_C_FLAGS=%GNU_COMPILE_FLAGS%"
cd build\mingw_test
cmake --build . --target install
- name: Run CTest MinGW
working-directory: build\mingw
run: ctest --no-compress-output --output-on-failure
- name: Check Meson build
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
meson setup build_meson hidapisrc
cd build_meson
ninja
windows-msbuild:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: microsoft/setup-msbuild@v1.1
- name: MSBuild x86 MSVC
run: msbuild windows\hidapi.sln /p:Configuration=Release /p:Platform=Win32
- name: Check artifacts x86
uses: andstor/file-existence-action@v2
with:
files: "windows/Release/hidapi.dll, windows/Release/hidapi.lib, windows/Release/hidapi.pdb"
fail: true
- name: MSBuild x64 MSVC
run: msbuild windows\hidapi.sln /p:Configuration=Release /p:Platform=x64
- name: Check artifacts x64
uses: andstor/file-existence-action@v2
with:
files: "windows/x64/Release/hidapi.dll, windows/x64/Release/hidapi.lib, windows/x64/Release/hidapi.pdb"
fail: true
- name: Gather artifacts
run: |
md artifacts
md artifacts\x86
md artifacts\x64
md artifacts\include
Copy-Item "windows\Release\hidapi.dll","windows\Release\hidapi.lib","windows\Release\hidapi.pdb" -Destination "artifacts\x86"
Copy-Item "windows\x64\Release\hidapi.dll","windows\x64\Release\hidapi.lib","windows\x64\Release\hidapi.pdb" -Destination "artifacts\x64"
Copy-Item "hidapi\hidapi.h","windows\hidapi_winapi.h" -Destination "artifacts\include"
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: hidapi-win
path: artifacts/
retention-days: ${{ (github.event_name == 'pull_request' || github.ref_name != 'master') && 7 || 90 }}
fedora-mingw:
runs-on: ubuntu-latest
container: fedora:latest
steps:
- uses: actions/checkout@v3
with:
path: hidapisrc
- name: Install dependencies
run: sudo dnf install -y autoconf automake libtool gawk mingw64-gcc cmake ninja-build make
- name: Configure CMake
run: |
rm -rf build install
mingw64-cmake -B build/shared-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
mingw64-cmake -B build/static-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
- name: Configure Automake
working-directory: hidapisrc
run: |
./bootstrap
mingw64-configure
- name: Build CMake Shared
working-directory: build/shared-cmake
run: ninja install
- name: Build CMake Static
working-directory: build/static-cmake
run: ninja install
- name: Build Automake
working-directory: hidapisrc
run: |
make
make DESTDIR=$PWD/../install/automake install
make clean
- name: Build manual Makefile
working-directory: hidapisrc/windows
run: make -f Makefile-manual OS=MINGW CC=x86_64-w64-mingw32-gcc
- name: Check artifacts
uses: andstor/file-existence-action@v2
with:
files: "install/shared-cmake/bin/libhidapi.dll, \
install/shared-cmake/lib/libhidapi.dll.a, \
install/shared-cmake/include/hidapi/hidapi.h, \
install/shared-cmake/include/hidapi/hidapi_winapi.h, \
install/static-cmake/lib/libhidapi.a, \
install/static-cmake/include/hidapi/hidapi.h, \
install/static-cmake/include/hidapi/hidapi_winapi.h"
fail: true
- name: Check CMake Export Package Shared
run: |
mingw64-cmake \
-GNinja \
-B build/shared_test \
-S hidapisrc/hidtest \
-Dhidapi_DIR=$PWD/install/shared-cmake/lib/cmake/hidapi \
-DCMAKE_INSTALL_PREFIX=install/shared_test \
"-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
cd build/shared_test
ninja install
- name: Check CMake Export Package Static
run: |
mingw64-cmake \
-GNinja \
-B build/static_test \
-S hidapisrc/hidtest \
-Dhidapi_DIR=$PWD/install/static-cmake/lib/cmake/hidapi \
-DCMAKE_INSTALL_PREFIX=install/static_test \
"-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
cd build/static_test
ninja install
archlinux:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- uses: actions/checkout@v3
with:
path: hidapisrc
- name: Install dependencies
run: |
pacman -Sy
pacman -S --noconfirm glibc lib32-glibc gcc pkg-config autoconf automake libtool libusb libudev0 cmake make
- name: Configure CMake
run: |
rm -rf build install
cmake -B build/shared-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
cmake -B build/static-cmake -S hidapisrc -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
- name: Configure Automake
working-directory: hidapisrc
run: |
./bootstrap
./configure
- name: Build CMake Shared
working-directory: build/shared-cmake
run: make install
- name: Build CMake Static
working-directory: build/static-cmake
run: make install
- name: Build Automake
working-directory: hidapisrc
run: |
make
make DESTDIR=$PWD/../install/automake install
make clean
- name: Build manual Makefile
run: |
cd hidapisrc/linux
make -f Makefile-manual
cd ../libusb
make -f Makefile-manual
- name: Check artifacts
uses: andstor/file-existence-action@v2
with:
files: "install/shared-cmake/lib/libhidapi-libusb.so, \
install/shared-cmake/lib/libhidapi-hidraw.so, \
install/shared-cmake/include/hidapi/hidapi.h, \
install/shared-cmake/include/hidapi/hidapi_libusb.h, \
install/static-cmake/lib/libhidapi-libusb.a, \
install/static-cmake/lib/libhidapi-hidraw.a, \
install/static-cmake/include/hidapi/hidapi.h, \
install/static-cmake/include/hidapi/hidapi_libusb.h"
fail: true
- name: Check CMake Export Package Shared
run: |
cmake \
-B build/shared_test \
-S hidapisrc/hidtest \
-Dhidapi_ROOT=$(pwd)/install/shared-cmake \
-DCMAKE_INSTALL_PREFIX=install/shared_test \
"-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
cd build/shared_test
make install
- name: Check CMake Export Package Static
run: |
cmake \
-B build/static_test \
-S hidapisrc/hidtest \
-Dhidapi_ROOT=$(pwd)/install/static-cmake \
-DCMAKE_INSTALL_PREFIX=install/static_test \
"-DCMAKE_C_FLAGS=${GNU_COMPILE_FLAGS}"
cd build/static_test
make install
alpine:
runs-on: ubuntu-latest
container: alpine:edge
env:
# A bug in musl: https://www.openwall.com/lists/musl/2020/01/20/2
ALPINE_COMPILE_FLAGS: ${GNU_COMPILE_FLAGS} -Wno-overflow
steps:
- uses: actions/checkout@v3
with:
path: hidapisrc
- name: Install dependencies
run: |
apk add gcc musl-dev autoconf automake libtool eudev-dev libusb-dev linux-headers cmake ninja make
- name: Configure CMake
run: |
rm -rf build install
cmake -B build/shared-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/shared-cmake -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${ALPINE_COMPILE_FLAGS}"
cmake -B build/static-cmake -S hidapisrc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=install/static-cmake -DBUILD_SHARED_LIBS=FALSE -DHIDAPI_BUILD_HIDTEST=ON "-DCMAKE_C_FLAGS=${ALPINE_COMPILE_FLAGS}"
- name: Configure Automake
working-directory: hidapisrc
run: |
./bootstrap
./configure
- name: Build CMake Shared
working-directory: build/shared-cmake
run: ninja install
- name: Build CMake Static
working-directory: build/static-cmake
run: ninja install
- name: Build Automake
working-directory: hidapisrc
run: |
make
make DESTDIR=$PWD/../install/automake install
make clean
- name: Build manual Makefile
run: |
cd hidapisrc/linux
make -f Makefile-manual
cd ../libusb
make -f Makefile-manual
- name: Check artifacts
uses: andstor/file-existence-action@v2
with:
files: "install/shared-cmake/lib/libhidapi-libusb.so, \
install/shared-cmake/lib/libhidapi-hidraw.so, \
install/shared-cmake/include/hidapi/hidapi.h, \
install/shared-cmake/include/hidapi/hidapi_libusb.h, \
install/static-cmake/lib/libhidapi-libusb.a, \
install/static-cmake/lib/libhidapi-hidraw.a, \
install/static-cmake/include/hidapi/hidapi.h, \
install/static-cmake/include/hidapi/hidapi_libusb.h"
fail: true
- name: Check CMake Export Package Shared
run: |
cmake \
-GNinja \
-B build/shared_test \
-S hidapisrc/hidtest \
-Dhidapi_ROOT=install/shared-cmake \
-DCMAKE_INSTALL_PREFIX=install/shared_test \
"-DCMAKE_C_FLAGS=${ALPINE_COMPILE_FLAGS}"
cd build/shared_test
ninja install
- name: Check CMake Export Package Static
run: |
cmake \
-GNinja \
-B build/static_test \
-S hidapisrc/hidtest \
-Dhidapi_ROOT=install/static-cmake \
-DCMAKE_INSTALL_PREFIX=install/static_test \
"-DCMAKE_C_FLAGS=${ALPINE_COMPILE_FLAGS}"
cd build/static_test
ninja install

View File

@@ -0,0 +1,198 @@
name: Checks
run-name: Code checks for '${{ github.ref_name }}'
# General comment:
# Coverity doesn't support merging or including reports from multible machine/platforms (at least not officially).
# But otherwise there is no good way to keep the issues from all platforms at Coverity Scans at once.
# This script uses undocumented (but appears to be working) hack:
# The build logs from one machine/platform gets moved to a next once,
# and "fixed" so that cov-build can append logs from the next platform.
# The "fix" is based on the fact, that Coverity perfectly allows appending logs from multiple builds
# that are done *on the same host* machine.
on:
# On-demand run
workflow_dispatch:
# Weekly run
schedule:
- cron: '30 5 * * 0'
jobs:
coverity-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
path: src
- name: Setup MSVC
uses: TheMrMilchmann/setup-msvc-dev@v2.0.0
with:
arch: x64
- name: Configure
run: |
cmake -B build -S src -G"NMake Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_HIDTEST=ON
- name: Lookup Coverity Build Tool hash
id: coverity-cache-lookup
run: |
$coverity_hash=Invoke-RestMethod -Uri https://scan.coverity.com/download/cxx/win64 -Method Post -Body @{token='${{ secrets.COVERITY_SCAN_TOKEN }}';project='hidapi';md5=1}
echo "coverity_hash=$coverity_hash" >> $Env:GITHUB_OUTPUT
- name: Get cached Coverity Build Tool
id: cov-build-cache
uses: actions/cache@v3
with:
path: cov-root
key: cov-root-cxx-win64-${{ steps.coverity-cache-lookup.outputs.coverity_hash }}
- name: Get and configure Coverity
if: steps.cov-build-cache.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri https://scan.coverity.com/download/cxx/win64 -OutFile coverity.zip -Method Post -Body @{token='${{ secrets.COVERITY_SCAN_TOKEN }}';project='hidapi'}
Remove-Item 'cov-root' -Recurse -Force -ErrorAction SilentlyContinue
Expand-Archive coverity.zip -DestinationPath cov-root
$cov_root=Get-ChildItem -Path 'cov-root'
$Env:PATH += ";$($cov_root.FullName)\bin"
cov-configure -msvc
- name: Make Coverity available in PATH
run: |
$cov_root=Get-ChildItem -Path 'cov-root'
echo "$($cov_root.FullName)\bin" >> $Env:GITHUB_PATH
- name: Build with Coverity
working-directory: build
run: |
cov-build --dir cov-int nmake
Rename-Item ".\cov-int\emit\$(hostname)" hostname
- name: Backup Coverity logs
uses: actions/upload-artifact@v4
with:
name: coverity-logs-windows
path: build/cov-int
retention-days: 7
coverity-macos:
runs-on: macos-13
needs: [coverity-windows]
steps:
- uses: actions/checkout@v3
with:
path: src
- name: Install dependencies
run: brew install ninja
- name: Configure
run: |
cmake -B build -S src -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_HIDTEST=ON -DCMAKE_C_COMPILER=clang
- uses: actions/download-artifact@v4
with:
name: coverity-logs-windows
path: build/cov-int
- name: Fixup cov-int
run: |
rm -f build/cov-int/emit/hostname/emit-db.lock build/cov-int/emit/hostname/emit-db.write-lock
mv build/cov-int/emit/hostname build/cov-int/emit/$(hostname)
- name: Lookup Coverity Build Tool hash
id: coverity-cache-lookup
shell: bash
run: |
hash=$(curl https://scan.coverity.com/download/cxx/Darwin --data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=hidapi&md5=1")
echo "coverity_hash=${hash}" >> $GITHUB_OUTPUT
- name: Get cached Coverity Build Tool
id: cov-build-cache
uses: actions/cache@v3
with:
path: cov-root
key: cov-root-cxx-Darwin-${{ steps.coverity-cache-lookup.outputs.coverity_hash }}
- name: Get and configure Coverity
if: steps.cov-build-cache.outputs.cache-hit != 'true'
run: |
curl https://scan.coverity.com/download/cxx/Darwin --output coverity.dmg --data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=hidapi"
hdiutil attach coverity.dmg -mountroot coverity
export COV_DIR_NAME=$(ls -1 --color=never coverity)
rm -rf cov-root
mkdir cov-root
cp ./coverity/${COV_DIR_NAME}/${COV_DIR_NAME}.sh cov-root/
cd cov-root/
./${COV_DIR_NAME}.sh
./bin/cov-configure --clang
- name: Make Coverity available in PATH
run: echo "$(pwd)/cov-root/bin" >> $GITHUB_PATH
- name: Build with Coverity
working-directory: build
run: |
cov-build --dir cov-int --append-log ninja
mv cov-int/emit/$(hostname) cov-int/emit/hostname
- name: Backup Coverity logs
uses: actions/upload-artifact@v4
with:
name: coverity-logs-windows-macos
path: build/cov-int
retention-days: 7
coverity-ubuntu:
runs-on: ubuntu-latest
needs: [coverity-macos]
steps:
- uses: actions/checkout@v3
with:
path: src
- name: Install dependencies
run: |
sudo apt update
sudo apt install libudev-dev libusb-1.0-0-dev ninja-build
- name: Configure
run: |
cmake -B build -S src -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DHIDAPI_WITH_TESTS=ON -DHIDAPI_BUILD_HIDTEST=ON -DCMAKE_C_COMPILER=gcc
- uses: actions/download-artifact@v4
with:
name: coverity-logs-windows-macos
path: build/cov-int
- name: Fixup cov-int
run: |
rm -f build/cov-int/emit/hostname/emit-db.lock build/cov-int/emit/hostname/emit-db.write-lock
mv build/cov-int/emit/hostname build/cov-int/emit/$(hostname)
- name: Lookup Coverity Build Tool hash
id: coverity-cache-lookup
shell: bash
run: |
hash=$(curl https://scan.coverity.com/download/cxx/linux64 --data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=hidapi&md5=1")
echo "coverity_hash=${hash}" >> $GITHUB_OUTPUT
- name: Get cached Coverity Build Tool
id: cov-build-cache
uses: actions/cache@v3
with:
path: cov-root
key: cov-root-cxx-linux64-${{ steps.coverity-cache-lookup.outputs.coverity_hash }}
- name: Get and configure Coverity
if: steps.cov-build-cache.outputs.cache-hit != 'true'
run: |
curl https://scan.coverity.com/download/cxx/linux64 --output coverity.tar.gz --data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=hidapi"
rm -rf cov-root
mkdir cov-root
tar -xzf coverity.tar.gz --strip 1 -C cov-root
./cov-root/bin/cov-configure --gcc
- name: Make Coverity available in PATH
run: echo "$(pwd)/cov-root/bin" >> $GITHUB_PATH
- name: Build with Coverity
working-directory: build
run: |
cov-build --dir cov-int --append-log ninja
- name: Submit results to Coverity Scan
working-directory: build
run: |
tar -czf cov-int.tar.gz cov-int
curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \
--form email=${{ secrets.COVERITY_SCAN_EMAIL }} \
--form file=@cov-int.tar.gz \
--form version="$GITHUB_SHA" \
--form description="Automatic HIDAPI build" \
https://scan.coverity.com/builds?project=hidapi
mv cov-int/emit/$(hostname) cov-int/emit/hostname
- name: Backup Coverity logs
uses: actions/upload-artifact@v4
with:
name: coverity-logs-windows-macos-linux
path: build/cov-int
retention-days: 7

View File

@@ -0,0 +1,46 @@
name: Docs
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
build:
runs-on: ubuntu-24.04
steps:
- name: Install Doxygen
run: sudo apt satisfy "doxygen (>= 1.9.6)"
- uses: actions/checkout@v4
- run: doxygen
working-directory: doxygen
- name: Save doxygen docs as artifact
uses: actions/upload-artifact@v4
with:
name: HIDAPI_doxygen_docs
path: ${{ github.workspace }}/doxygen/html
deploy-docs:
runs-on: ubuntu-24.04
needs: [build]
if: github.ref_type == 'branch' && github.ref_name == 'master'
concurrency:
group: "github-pages-deploy"
cancel-in-progress: true
steps:
- name: downlod artifact
uses: actions/download-artifact@v4
with:
name: HIDAPI_doxygen_docs
path: docs
- name: upload to github pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
force_orphan: true

18
node_modules/node-hid/hidapi/AUTHORS.txt generated vendored Normal file
View File

@@ -0,0 +1,18 @@
HIDAPI Authors:
Alan Ott <alan@signal11.us>:
Original Author and Maintainer
Linux, Windows, and Mac implementations
Ludovic Rousseau <rousseau@debian.org>:
Formatting for Doxygen documentation
Bug fixes
Correctness fixes
libusb/hidapi Team:
Development/maintenance since June 4th 2019
For a comprehensive list of contributions, see the commit list at github:
https://github.com/libusb/hidapi/graphs/contributors

116
node_modules/node-hid/hidapi/BUILD.autotools.md generated vendored Normal file
View File

@@ -0,0 +1,116 @@
# Building HIDAPI using Autotools (deprecated)
---
**NOTE**: for all intentions and purposes the Autotools build scripts for HIDAPI are _deprecated_ and going to be obsolete in the future.
HIDAPI Team recommends using CMake build for HIDAPI.
If you are already using Autotools build scripts provided by HIDAPI,
consider switching to CMake build scripts as soon as possible.
---
To be able to use Autotools to build HIDAPI, it has to be [installed](#installing-autotools)/available in the system.
Make sure you've checked [prerequisites](BUILD.md#prerequisites) and installed all required dependencies.
## Installing Autotools
HIDAPI uses few specific tools/packages from Autotools: `autoconf`, `automake`, `libtool`.
On different platforms or package managers, those could be named a bit differently or packaged together.
You'll have to check the documentation/package list for your specific package manager.
### Linux
On Ubuntu the tools are available via APT:
```sh
sudo apt install autoconf automake libtool
```
### FreeBSD
FreeBSD Autotools can be installed as:
```sh
pkg_add -r autotools
```
Additionally, on FreeBSD you will need to install GNU make:
```sh
pkg_add -r gmake
```
## Building HIDAPI with Autotools
A simple command list, to build HIDAPI with Autotools as a _shared library_ and install in into your system:
```sh
./bootstrap # this prepares the configure script
mkdir build
cd build # in-source builds are not recommended and known to be broken in some cases (https://github.com/libusb/hidapi/issues/621)
../configure
make # build the library
make install # as root, or using sudo, this will install hidapi into your system
```
`./configure` can take several arguments which control the build. A few commonly used options:
```sh
--enable-testgui
# Enable the build of Foxit-based Test GUI. This requires Fox toolkit to
# be installed/available. See README.md#test-gui for remarks.
--prefix=/usr
# Specify where you want the output headers and libraries to
# be installed. The example above will put the headers in
# /usr/include and the binaries in /usr/lib. The default is to
# install into /usr/local which is fine on most systems.
--disable-shared
# By default, both shared and static libraries are going to be built/installed.
# This option disables shared library build, if only static library is required.
```
## Cross Compiling
This section talks about cross compiling HIDAPI for Linux using Autotools.
This is useful for using HIDAPI on embedded Linux targets. These
instructions assume the most raw kind of embedded Linux build, where all
prerequisites will need to be built first. This process will of course vary
based on your embedded Linux build system if you are using one, such as
OpenEmbedded or Buildroot.
For the purpose of this section, it will be assumed that the following
environment variables are exported.
```sh
$ export STAGING=$HOME/out
$ export HOST=arm-linux
```
`STAGING` and `HOST` can be modified to suit your setup.
### Prerequisites
Depending on what backend you want to cross-compile, you also need to prepare the dependencies:
`libusb` for libusb HIDAPI backend, or `libudev` for hidraw HIDAPI backend.
An example of cross-compiling `libusb`. From `libusb` source directory, run:
```sh
./configure --host=$HOST --prefix=$STAGING
make
make install
```
An example of cross-comping `libudev` is not covered by this section.
Check `libudev`'s documentation for details.
### Building HIDAPI
Build HIDAPI:
```sh
PKG_CONFIG_DIR= \
PKG_CONFIG_LIBDIR=$STAGING/lib/pkgconfig:$STAGING/share/pkgconfig \
PKG_CONFIG_SYSROOT_DIR=$STAGING \
./configure --host=$HOST --prefix=$STAGING
# make / make install - same as for a regular build
```

280
node_modules/node-hid/hidapi/BUILD.cmake.md generated vendored Normal file
View File

@@ -0,0 +1,280 @@
# Building HIDAPI using CMake
To build HIDAPI with CMake, it has to be [installed](#installing-cmake)/available in the system.
Make sure you've checked [prerequisites](BUILD.md#prerequisites) and installed all required dependencies.
HIDAPI CMake build system allows you to build HIDAPI in two generally different ways:
1) As a [standalone package/library](#standalone-package-build);
2) As [part of a larger CMake project](#hidapi-as-a-subdirectory).
**TL;DR**: if you're experienced developer and have been working with CMake projects or have been written some of your own -
most of this document may not be of interest for you; just check variables names, its default values and the target names.
## Installing CMake
CMake can be installed either using your system's package manager,
or by downloading an installer/prebuilt version from the [official website](https://cmake.org/download/).
On most \*nix systems, the preferred way to install CMake is via package manager,
e.g. `sudo apt install cmake`.
On Windows CMake could be provided by your development environment (e.g. by Visual Studio Installer or MinGW installer),
or you may install it system-wise using the installer from the official website.
On macOS CMake may be installed by Homebrew/MacPorts or using the installer from the official website.
## Standalone package build
To build HIDAPI as a standalone package, you follow [general steps](https://cmake.org/runningcmake/) of building any CMake project.
An example of building HIDAPI with CMake:
```sh
# precondition: create a <build dir> somewhere on the filesystem (preferably outside of the HIDAPI source)
# this is the place where all intermediate/build files are going to be located
cd <build dir>
# configure the build
cmake <HIDAPI source dir>
# build it!
cmake --build .
# install library; by default installs into /usr/local/
cmake --build . --target install
# NOTE: you need to run install command as root, to be able to install into /usr/local/
```
Such invocation will use the default (as per CMake magic) compiler/build environment available in your system.
You may pass some additional CMake variables to control the build configuration as `-D<CMake Variable>=value`.
E.g.:
```sh
# install command now would install things into /usr
cmake <HIDAPI source dir> -DCMAKE_INSTALL_PREFIX=/usr
```
<details>
<summary>Using a specific CMake generator</summary>
An example of using `Ninja` as a CMake generator:
```sh
cd <build dir>
# configure the build
cmake -GNinja <HIDAPI source dir>
# we know, that CMake has generated build files for Ninja,
# so we can use `ninja` directly, instead of `cmake --build .`
ninja
# install library
ninja install
```
`-G` here specifies a native build system CMake would generate build files for.
Check [CMake Documentation](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) for a list of available generators (system-specific).
</details><br>
Some of the [standard](https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html) CMake variables you may want to use to configure a build:
- [`CMAKE_INSTALL_PREFIX`](https://cmake.org/cmake/help/latest/variable/CMAKE_INSTALL_PREFIX.html) - prefix where `install` target would install the library(ies);
- [`CMAKE_BUILD_TYPE`](https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) - standard possible values: `Debug`, `Release`, `RelWithDebInfo`, `MinSizeRel`; Defaults to `Release` for HIDAPI, if not specified;
- [`BUILD_SHARED_LIBS`](https://cmake.org/cmake/help/latest/variable/BUILD_SHARED_LIBS.html) - when set to TRUE, HIDAPI is built as a shared library, otherwise build statically; Defaults to `TRUE` for HIDAPI, if not specified;
<details>
<summary>macOS-specific variables</summary>
- [`CMAKE_FRAMEWORK`](https://cmake.org/cmake/help/latest/variable/CMAKE_FRAMEWORK.html) - (since CMake 3.15) when set to TRUE, HIDAPI is built as a framework library, otherwise build as a regular static/shared library; Defaults to `FALSE` for HIDAPI, if not specified;
- [`CMAKE_OSX_DEPLOYMENT_TARGET`](https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_DEPLOYMENT_TARGET.html) - minimum version of the target platform (e.g. macOS or iOS) on which the target binaries are to be deployed; defaults to a maximum supported target platform by currently used XCode/Toolchain;
</details><br>
HIDAPI-specific CMake variables:
- `HIDAPI_BUILD_HIDTEST` - when set to TRUE, build a small test application `hidtest`;
- `HIDAPI_WITH_TESTS` - when set to TRUE, build all (unit-)tests;
currently this option is only available on Windows, since only Windows backend has tests;
<details>
<summary>Linux-specific variables</summary>
- `HIDAPI_WITH_HIDRAW` - when set to TRUE, build HIDRAW-based implementation of HIDAPI (`hidapi-hidraw`), otherwise don't build it; defaults to TRUE;
- `HIDAPI_WITH_LIBUSB` - when set to TRUE, build LIBUSB-based implementation of HIDAPI (`hidapi-libusb`), otherwise don't build it; defaults to TRUE;
**NOTE**: at least one of `HIDAPI_WITH_HIDRAW` or `HIDAPI_WITH_LIBUSB` has to be set to TRUE.
</details><br>
To see all most-useful CMake variables available for HIDAPI, one of the most convenient ways is too use [`cmake-gui`](https://cmake.org/cmake/help/latest/manual/cmake-gui.1.html) tool ([example](https://cmake.org/runningcmake/)).
_NOTE_: HIDAPI packages built by CMake can be used with `pkg-config`, as if built with [Autotools](BUILD.autotools.md).
### MSVC and Ninja
It is possible to build a CMake project (including HIDAPI) using MSVC compiler and Ninja (for medium and larger projects it is so much faster than msbuild).
For that:
1) Open cmd.exe;
2) Setup MSVC build environment variables, e.g.: `vcvarsall.bat x64`, where:
- `vcvarsall.bat` is an environment setup script of your MSVC toolchain installation;<br>For MSVC 2019 Community edition it is located at: `C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\`;
- `x64` -a target architecture to build;
3) Follow general build steps, and use `Ninja` as a generator.
### Using HIDAPI in a CMake project
When HIDAPI is used as a standalone package (either installed into the system or built manually and installed elsewhere), the simplest way to use it is as showed in the example:
```cmake
project(my_application)
add_executable(my_application main.c)
find_package(hidapi REQUIRED)
target_link_libraries(my_application PRIVATE hidapi::hidapi)
```
If HIDAPI isn't installed in your system, or `find_package` cannot find HIDAPI by default for any other reasons,
the recommended way manually specify which HIDAPI package to use is via `hidapi_ROOT` CMake variable, e.g.:
`-Dhidapi_ROOT=<path to HIDAPI installation prefix>`.
_NOTE_: usage of `hidapi_ROOT` is only possible (and recommended) with CMake 3.12 and higher. For older versions of CMake you'd need to specify [`CMAKE_PREFIX_PATH`](https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html#variable:CMAKE_PREFIX_PATH) instead.
Check with [`find_package`](https://cmake.org/cmake/help/latest/command/find_package.html) documentation if you need more details.
Available CMake targets after successful `find_package(hidapi)`:
- `hidapi::hidapi` - indented to be used in most cases;
- `hidapi::include` - if you need only to include `<hidapi.h>` but not link against the library;
- `hidapi::winapi` - same as `hidapi::hidapi` on Windows; available only on Windows;
- `hidapi::darwin` - same as `hidapi::hidapi` on macOS; available only on macOS;
- `hidapi::libusb` - available when libusb backend is used/available;
- `hidapi::hidraw` - available when hidraw backend is used/available on Linux;
**NOTE**: on Linux often both `hidapi::libusb` and `hidapi::hidraw` backends are available; in that case `hidapi::hidapi` is an alias for **`hidapi::hidraw`**. The motivation is that `hidraw` backend is a native Linux kernel implementation of HID protocol, and supports various HID devices (USB, Bluetooth, I2C, etc.). If `hidraw` backend isn't built at all (`hidapi::libusb` is the only target) - `hidapi::hidapi` is an alias for `hidapi::libusb`.
If you're developing a cross-platform application and you are sure you need to use `libusb` backend on Linux, the simple way to achieve this is:
```cmake
if(TARGET hidapi::libusb)
target_link_libraries(my_project PRIVATE hidapi::libusb)
else()
target_link_libraries(my_project PRIVATE hidapi::hidapi)
endif()
```
## HIDAPI as a subdirectory
HIDAPI can be easily used as a subdirectory of a larger CMake project:
```cmake
# root CMakeLists.txt
cmake_minimum_required(VERSION 3.4.3...3.25 FATAL_ERROR)
add_subdirectory(hidapi)
add_subdirectory(my_application)
# my_application/CMakeLists.txt
project(my_application)
add_executable(my_application main.c)
# NOTE: no `find_package` is required, since HIDAPI targets are already a part of the project tree
target_link_libraries(my_application PRIVATE hidapi::hidapi)
```
Lets call this "larger project" a "host project".
All of the variables described in [standalone build](#standalone-package-build) section can be used to control HIDAPI build in case of a subdirectory, e.g.:
```cmake
set(HIDAPI_WITH_LIBUSB FALSE) # surely will be used only on Linux
set(BUILD_SHARED_LIBS FALSE) # HIDAPI as static library on all platforms
add_subdirectory(hidapi)
```
<details>
<summary>NOTE</summary>
If you project happen to use `BUILD_SHARED_LIBS` as a `CACHE` variable globally for you project, setting it as simple variable, as showed above _will have not affect_ up until _CMake 3.13_. See [CMP0077](https://cmake.org/cmake/help/latest/policy/CMP0077.html) for details.
</details><br>
There are several important differences in the behavior of HIDAPI CMake build system when CMake is built as standalone package vs subdirectory build:
1) In _standalone build_ a number of standard and HIDAPI-specific variables are marked as _cache variables_ or _options_.
This is done for convenience: when you're building HIDAPI as a standalone package and using tools like `cmake-gui` - those are highlighted as variables that can be changed and has some short description/documentation. E.g.:
![an example of highlighted variables in cmake-gui](documentation/cmake-gui-highlights.png "cmake-gui highlighted variables")<br>
E.g.2:<br>
![an example of drop-down menu in cmake-gui](documentation/cmake-gui-drop-down.png "cmake-gui drop-down menu")<br>
When HIDAPI is built as a _subdirectory_ - **_none of the variables are marked for cache or as options_** by HIDAPI.
This is done to let the host project's developer decide what is important (what needs to be highlighted) and what's not.
2) The default behavior/default value for some of the variables is a bit different:
- by default, none of HIDAPI targets are [installed](https://cmake.org/cmake/help/latest/command/install.html); if required, HIDAPI targets can be installed by host project _after_ including HIDAPI subdirectory (requires CMake 3.13 or later); **or**, the default installation can be enabled by setting `HIDAPI_INSTALL_TARGETS` variable _before_ including HIDAPI subdirectory.
HIDAPI uses [GNUInstallDirs](https://cmake.org/cmake/help/latest/module/GNUInstallDirs.html) to specify install locations. Variables like `CMAKE_INSTALL_LIBDIR` can be used to control HIDAPI's installation locations. E.g.:
```cmake
# enable the installation if you need it
set(HIDAPI_INSTALL_TARGETS ON)
# (optionally) change default installation locations if it makes sense for your target platform, etc.
set(CMAKE_INSTALL_LIBDIR "lib64")
add_subdirectory(hidapi)
```
- HIDAPI prints its version during the configuration when built as a standalone package; to enable this for subdirectory builds - set `HIDAPI_PRINT_VERSION` to TRUE before including HIDAPI;
3) In a subdirectory build, HIDAPI _doesn't modify or set any of the CMake variables_ that may change the build behavior.
For instance, in a _standalone build_, if CMAKE_BUILD_TYPE or BUILD_SHARED_LIBS variables are not set, those are defaulted to "Release" and "TRUE" explicitly.
In a _subdirectory build_, even if not set, those variables remain unchanged, so a host project's developer has a full control over the HIDAPI build configuration.
Available CMake targets after `add_subdirectory(hidapi)` _are the same as in case of [standalone build](#standalone-package-build)_, and a few additional ones:
- `hidapi_include` - the interface library; `hidapi::include` is an alias of it;
- `hidapi_winapi` - library target on Windows; `hidapi::winapi` is an alias of it;
- `hidapi_darwin` - library target on macOS; `hidapi::darwin` is an alias of it;
- `hidapi_libusb` - library target for libusb backend; `hidapi::libusb` is an alias of it;
- `hidapi_hidraw` - library target for hidraw backend; `hidapi::hidraw` is an alias of it;
- `hidapi-libusb` - an alias of `hidapi_libusb` for compatibility with raw library name;
- `hidapi-hidraw` - an alias of `hidapi_hidraw` for compatibility with raw library name;
- `hidapi` - an alias of `hidapi_winapi` or `hidapi_darwin` on Windows or macOS respectfully.
Advanced:
- Why would I need additional targets described in this section above, if I already have alias targets compatible with `find_package`?
- an example:
```cmake
add_subdirectory(hidapi)
if(TARGET hidapi_libusb)
# see libusb/hid.c for usage of `NO_ICONV`
target_compile_definitions(hidapi_libusb PRIVATE NO_ICONV)
endif()
```
## Both Shared and Static build
If you're a former (or present) user of Autotools build scripts for HIDAPI, or you're a package manager maintainer and you're often working with those - you're likely asking how to build HIDAPI with CMake and get both Shared and Static libraries (as would be done by Autotools: `./configure --enable-static --enable-shared ...`).
CMake doesn't have such option of-the-box and it is decided not to introduce any manual CMake-level workarounds for HIDAPI on this matter.
If you want to mimic the Autotools behavior, it is possible by building/installing first the static version of the library and then shared version of the library. The installation folder (`CMAKE_INSTALL_PREFIX`) should point to the same directory for both variants, that way:
- both static and shared library binaries will be available and usable;
- a single header file(s) for both of them;
- Autotools/pkg-config (`.pc`) files will be generated and usable _as if_ generated by Autotools natively and build configured with both `-enable-static --enable-shared` options;
- CMake package scripts will be generated and fully usable, but _only the last build installed_, i.e. if the last was installed Shared version of the binary - CMake targets found by `find_package(hidapi)` would point to a Shared binaries.
There is a historical discussion, why such solution is simplest/preferable: https://github.com/libusb/hidapi/issues/424
#### TL;DR/Sample
```sh
# First - configure/build
# Static libraries
cmake -S <HIDAPI source dir> -B "<build dir>/static" -DCMAKE_INSTALL_PREFIX=<your installation prefix> -DBUILD_SHARED_LIBS=FALSE
cmake --build "<build dir>/static"
# Shared libraries
cmake -S <HIDAPI source dir> -B "<build dir>/shared" -DCMAKE_INSTALL_PREFIX=<your installation prefix> -DBUILD_SHARED_LIBS=TRUE
cmake --build "<build dir>/shared"
# (Optionally) change the installation destination.
# NOTE1: this is supported by CMake only on UNIX platforms
# See https://cmake.org/cmake/help/latest/envvar/DESTDIR.html
# NOTE2: this is not the same as `CMAKE_INSTALL_PREFIX` set above
# NOTE3: this is only required if you have a staging dir other than the final runtime dir,
# e.g. during cross-compilation
export DESTDIR="$STAGING_DIR"
#
# Install the libraries
# NOTE: order of installation matters - install Shared variant *the last*
# Static libraries
cmake --install "<build dir>/static"
# Shared libraries
cmake --install "<build dir>/shared"
```

127
node_modules/node-hid/hidapi/BUILD.md generated vendored Normal file
View File

@@ -0,0 +1,127 @@
# Building HIDAPI from Source
## Table of content
* [Intro](#intro)
* [Prerequisites](#prerequisites)
* [Linux](#linux)
* [FreeBSD](#freebsd)
* [Mac](#mac)
* [Windows](#windows)
* [Embedding HIDAPI directly into your source tree](#embedding-hidapi-directly-into-your-source-tree)
* [Building the manual way on Unix platforms](#building-the-manual-way-on-unix-platforms)
* [Building on Windows](#building-on-windows)
## Intro
For various reasons, you may need to build HIDAPI on your own.
It can be done in several different ways:
- using [CMake](BUILD.cmake.md);
- using [Autotools](BUILD.autotools.md) (deprecated);
- using [manual makefiles](#building-the-manual-way-on-unix-platforms);
- using `Meson` (requires CMake);
**Autotools** build system is historically the first mature build system for
HIDAPI. The most common usage of it is in its separate README: [BUILD.autotools.md](BUILD.autotools.md).<br/>
NOTE: for all intentions and purposes the Autotools build scripts for HIDAPI are _deprecated_ and going to be obsolete in the future.
HIDAPI Team recommends using CMake build for HIDAPI.
**CMake** build system is de facto an industry standard for many open-source and proprietary projects and solutions.
HIDAPI is one of the projects which use the power of CMake to its advantage.
More documentation is available in its separate README: [BUILD.cmake.md](BUILD.cmake.md).
**Meson** build system for HIDAPI is designed as a [wrapper](https://mesonbuild.com/CMake-module.html) over CMake build script.
It is present for the convenience of Meson users who need to use HIDAPI and need to be sure HIDAPI is built in accordance with officially supported build scripts.<br>
In the Meson script of your project you need a `hidapi = subproject('hidapi')` subproject, and `hidapi.get_variable('hidapi_dep')` as your dependency.
There are also backend/platform-specific dependencies available: `hidapi_winapi`, `hidapi_darwin`, `hidapi_hidraw`, `hidapi_libusb`.
If you don't know where to start to build HIDAPI, we recommend starting with [CMake](BUILD.cmake.md) build.
## Prerequisites:
Regardless of what build system you choose to use, there are specific dependencies for each platform/backend.
### Linux:
Depending on which backend you're going to build, you'll need to install
additional development packages. For `linux/hidraw` backend, you need a
development package for `libudev`. For `libusb` backend, naturally, you need
`libusb` development package.
On Debian/Ubuntu systems these can be installed by running:
```sh
# required only by hidraw backend
sudo apt install libudev-dev
# required only by libusb backend
sudo apt install libusb-1.0-0-dev
```
### FreeBSD:
On FreeBSD, you will need to install libiconv. This is done by running
the following:
```sh
pkg_add -r libiconv
```
### Mac:
Make sure you have XCode installed and its Command Line Tools.
### Windows:
You just need a compiler. You may use Visual Studio or Cygwin/MinGW,
depending on which environment is best for your needs.
## Embedding HIDAPI directly into your source tree
Instead of using one of the provided standalone build systems,
you may want to integrate HIDAPI directly into your source tree.
---
If your project uses CMake as a build system, it is safe to add HIDAPI as a [subdirectory](BUILD.cmake.md#hidapi-as-a-subdirectory).
---
If _the only option_ that works for you is adding HIDAPI sources directly
to your project's build system, then you need:
- include a _single source file_ into your project's build system,
depending on your platform and the backend you want to use:
- [`windows\hid.c`](windows/hid.c);
- [`linux/hid.c`](linux/hid.c);
- [`libusb/hid.c`](libusb/hid.c);
- [`mac/hid.c`](mac/hid.c);
- add a [`hidapi`](hidapi) folder to the include path when building `hid.c`;
- make the platform/backend specific [dependencies](#prerequisites) available during the compilation/linking, when building `hid.c`;
NOTE: the above doesn't guarantee that having a copy of `<backend>/hid.c` and `hidapi/hidapi.h` is enough to build HIDAPI.
The only guarantee that `<backend>/hid.c` includes all necessary sources to compile it as a single file.
Check the manual makefiles for a simple example/reference of what are the dependencies of each specific backend.
## Building the manual way on Unix platforms
Manual Makefiles are provided mostly to give the user an idea what it takes
to build a program which embeds HIDAPI directly inside of it. These should
really be used as examples only. If you want to build a system-wide shared
library, use one of the build systems mentioned above.
To build HIDAPI using the manual Makefiles, change the directory
of your platform and run make. For example, on Linux run:
```sh
cd linux/
make -f Makefile-manual
```
## Building on Windows
To build the HIDAPI DLL on Windows using Visual Studio, build the `.sln` file
in the `windows/` directory.
To build HIDAPI using MinGW or Cygwin using Autotools, use general Autotools
[instruction](BUILD.autotools.md).
Any windows builds (MSVC or MinGW/Cygwin) are also supported by [CMake](BUILD.cmake.md).
If you are looking for information regarding DDK build of HIDAPI:
- the build has been broken for a while and now the support files are obsolete.

108
node_modules/node-hid/hidapi/CMakeLists.txt generated vendored Normal file
View File

@@ -0,0 +1,108 @@
cmake_minimum_required(VERSION 3.1.3...3.25 FATAL_ERROR)
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_subdirectory(src)
# compatibility with find_package() vs add_subdirectory
set(hidapi_VERSION "${hidapi_VERSION}" PARENT_SCOPE)
return()
endif()
# All of the below in this file is meant for a standalone build.
# When building as a subdirectory of a larger project, most of the options may not make sense for it,
# so it is up to developer to configure those, e.g.:
#
# # a subfolder of a master project, e.g.: 3rdparty/hidapi/CMakeLists.txt
#
# set(HIDAPI_WITH_HIDRAW OFF)
# set(CMAKE_FRAMEWORK ON)
# # and keep everything else to their defaults
# add_subdirectory(hidapi)
#
set(DEFAULT_CMAKE_BUILD_TYPES "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
if(NOT DEFINED CMAKE_BUILD_TYPE OR NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "${DEFAULT_CMAKE_BUILD_TYPES}" FORCE)
endif()
# This part is for convenience, when used one of the standard build types with cmake-gui
list(FIND DEFAULT_CMAKE_BUILD_TYPES "${CMAKE_BUILD_TYPE}" _build_type_index)
if(${_build_type_index} GREATER -1)
# set it optionally, so a custom CMAKE_BUILD_TYPE can be used as well, if needed
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${DEFAULT_CMAKE_BUILD_TYPES})
endif()
unset(_build_type_index)
#
project(hidapi LANGUAGES C)
if(APPLE)
if(NOT CMAKE_VERSION VERSION_LESS "3.15")
option(CMAKE_FRAMEWORK "Build macOS/iOS Framework version of the library" OFF)
endif()
elseif(NOT WIN32)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
option(HIDAPI_WITH_HIDRAW "Build HIDRAW-based implementation of HIDAPI" ON)
option(HIDAPI_WITH_LIBUSB "Build LIBUSB-based implementation of HIDAPI" ON)
endif()
if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
option(HIDAPI_WITH_NETBSD "Build NetBSD/UHID implementation of HIDAPI" ON)
endif()
endif()
option(BUILD_SHARED_LIBS "Build shared version of the libraries, otherwise build statically" ON)
set(HIDAPI_INSTALL_TARGETS ON)
set(HIDAPI_PRINT_VERSION ON)
set(IS_DEBUG_BUILD OFF)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(IS_DEBUG_BUILD ON)
endif()
option(HIDAPI_ENABLE_ASAN "Build HIDAPI with ASAN address sanitizer instrumentation" OFF)
if(HIDAPI_ENABLE_ASAN)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
if(MSVC)
# the default is to have "/INCREMENTAL" which causes a warning when "-fsanitize=address" is present
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO")
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} /INCREMENTAL:NO")
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO} /INCREMENTAL:NO")
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO} /INCREMENTAL:NO")
endif()
endif()
if(WIN32)
# so far only Windows has tests
option(HIDAPI_WITH_TESTS "Build HIDAPI (unit-)tests" ${IS_DEBUG_BUILD})
else()
set(HIDAPI_WITH_TESTS OFF)
endif()
if(HIDAPI_WITH_TESTS)
enable_testing()
endif()
if(WIN32)
option(HIDAPI_BUILD_PP_DATA_DUMP "Build small Windows console application pp_data_dump.exe" ${IS_DEBUG_BUILD})
endif()
add_subdirectory(src)
option(HIDAPI_BUILD_HIDTEST "Build small console test application hidtest" ${IS_DEBUG_BUILD})
if(HIDAPI_BUILD_HIDTEST)
add_subdirectory(hidtest)
endif()
if(HIDAPI_ENABLE_ASAN)
if(NOT MSVC)
# MSVC doesn't recognize those options, other compilers - requiring it
foreach(HIDAPI_TARGET hidapi_winapi hidapi_darwin hidapi_hidraw hidapi_libusb hidtest_hidraw hidtest_libusb hidtest)
if(TARGET ${HIDAPI_TARGET})
if(BUILD_SHARED_LIBS)
target_link_options(${HIDAPI_TARGET} PRIVATE -fsanitize=address)
else()
target_link_options(${HIDAPI_TARGET} PUBLIC -fsanitize=address)
endif()
endif()
endforeach()
endif()
endif()

19
node_modules/node-hid/hidapi/HACKING.txt generated vendored Normal file
View File

@@ -0,0 +1,19 @@
This file is mostly for the maintainer.
Updating a Version:
1. Update VERSION file.
2. HID_API_VERSION_MAJOR/HID_API_VERSION_MINOR/HID_API_VERSION_PATCH in hidapi.h.
Before firing a new release:
1. Run the "Checks" Githtub Action
2. Make sure no defects are found at: https://scan.coverity.com/projects/hidapi
3. Fix if any
Firing a new release:
1. Update the Version (if not yet updated).
2. Prepare the Release Notes.
3. Store the Release Notes into a file.
4. Create locally an annotated git tag with release notes attached, e.g.: `git tag -aF ../hidapi_release_notes hidapi-<VERSION>`
5. Push newly created tag: `git push origin hidapi-<VERSION>`
6. Grab the hidapi-win.zip from Summary page of "GitHub Builds" Action for latest master build.
7. Create a Github Release with hidapi-win.zip attached, for newly created tag.

26
node_modules/node-hid/hidapi/LICENSE-bsd.txt generated vendored Normal file
View File

@@ -0,0 +1,26 @@
Copyright (c) 2010, Alan Ott, Signal 11 Software
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Signal 11 Software nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.

674
node_modules/node-hid/hidapi/LICENSE-gpl3.txt generated vendored Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

9
node_modules/node-hid/hidapi/LICENSE-orig.txt generated vendored Normal file
View File

@@ -0,0 +1,9 @@
HIDAPI - Multi-Platform library for
communication with HID devices.
Copyright 2009, Alan Ott, Signal 11 Software.
All Rights Reserved.
This software may be used by anyone for any reason so
long as the copyright notice in the source files
remains intact.

13
node_modules/node-hid/hidapi/LICENSE.txt generated vendored Normal file
View File

@@ -0,0 +1,13 @@
HIDAPI can be used under one of three licenses.
1. The GNU General Public License, version 3.0, in LICENSE-gpl3.txt
2. A BSD-Style License, in LICENSE-bsd.txt.
3. The more liberal original HIDAPI license. LICENSE-orig.txt
The license chosen is at the discretion of the user of HIDAPI. For example:
1. An author of GPL software would likely use HIDAPI under the terms of the
GPL.
2. An author of commercial closed-source software would likely use HIDAPI
under the terms of the BSD-style license or the original HIDAPI license.

85
node_modules/node-hid/hidapi/Makefile.am generated vendored Normal file
View File

@@ -0,0 +1,85 @@
ACLOCAL_AMFLAGS = -I m4
if OS_FREEBSD
pkgconfigdir=$(prefix)/libdata/pkgconfig
else
pkgconfigdir=$(libdir)/pkgconfig
endif
if OS_LINUX
pkgconfig_DATA=pc/hidapi-hidraw.pc pc/hidapi-libusb.pc
else
pkgconfig_DATA=pc/hidapi.pc
endif
SUBDIRS=
if OS_LINUX
SUBDIRS += linux libusb
endif
if OS_DARWIN
SUBDIRS += mac
endif
if OS_FREEBSD
SUBDIRS += libusb
endif
if OS_KFREEBSD
SUBDIRS += libusb
endif
if OS_HAIKU
SUBDIRS += libusb
endif
if OS_WINDOWS
SUBDIRS += windows
endif
SUBDIRS += hidtest
if BUILD_TESTGUI
SUBDIRS += testgui
endif
EXTRA_DIST = udev doxygen
dist_doc_DATA = \
README.md \
AUTHORS.txt \
LICENSE-bsd.txt \
LICENSE-gpl3.txt \
LICENSE-orig.txt \
LICENSE.txt
SCMCLEAN_TARGETS= \
aclocal.m4 \
config.guess \
config.sub \
configure \
config.h.in \
depcomp \
install-sh \
ltmain.sh \
missing \
mac/Makefile.in \
testgui/Makefile.in \
libusb/Makefile.in \
Makefile.in \
linux/Makefile.in \
windows/Makefile.in \
m4/libtool.m4 \
m4/lt~obsolete.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4
SCMCLEAN_DIR_TARGETS = \
autom4te.cache
scm-clean: distclean
rm -f $(SCMCLEAN_TARGETS)
rm -Rf $(SCMCLEAN_DIR_TARGETS)

196
node_modules/node-hid/hidapi/README.md generated vendored Normal file
View File

@@ -0,0 +1,196 @@
## HIDAPI library for Windows, Linux, FreeBSD and macOS
| CI instance | Status |
|----------------------|--------|
| `Linux/macOS/Windows (master)` | [![GitHub Builds](https://github.com/libusb/hidapi/actions/workflows/builds.yml/badge.svg?branch=master)](https://github.com/libusb/hidapi/actions/workflows/builds.yml?query=branch%3Amaster) |
| `Windows (master)` | [![Build status](https://ci.appveyor.com/api/projects/status/xfmr5fo8w0re8ded/branch/master?svg=true)](https://ci.appveyor.com/project/libusb/hidapi/branch/master) |
| `BSD, last build (branch/PR)` | [![builds.sr.ht status](https://builds.sr.ht/~z3ntu/hidapi.svg)](https://builds.sr.ht/~z3ntu/hidapi) |
| `Coverity Scan (last)` | [![Coverity Scan](https://scan.coverity.com/projects/583/badge.svg)](https://scan.coverity.com/projects/hidapi) |
HIDAPI is a multi-platform library which allows an application to interface
with USB and Bluetooth HID-Class devices on Windows, Linux, FreeBSD, and macOS.
HIDAPI can be either built as a shared library (`.so`, `.dll` or `.dylib`) or
can be embedded directly into a target application by adding a _single source_
file (per platform) and a single header.<br>
See [remarks](BUILD.md#embedding-hidapi-directly-into-your-source-tree) on embedding _directly_ into your build system.
HIDAPI library was originally developed by Alan Ott ([signal11](https://github.com/signal11)).
It was moved to [libusb/hidapi](https://github.com/libusb/hidapi) on June 4th, 2019, in order to merge important bugfixes and continue development of the library.
## Table of Contents
* [About](#about)
* [Test GUI](#test-gui)
* [Console Test App](#console-test-app)
* [What Does the API Look Like?](#what-does-the-api-look-like)
* [License](#license)
* [Installing HIDAPI](#installing-hidapi)
* [Build from Source](#build-from-source)
## About
### HIDAPI has four back-ends:
* Windows (using `hid.dll`)
* Linux/hidraw (using the Kernel's hidraw driver)
* libusb (using libusb-1.0 - Linux/BSD/other UNIX-like systems)
* macOS (using IOHidManager)
On Linux, either the hidraw or the libusb back-end can be used. There are
tradeoffs, and the functionality supported is slightly different. Both are
built by default. It is up to the application linking to hidapi to choose
the backend at link time by linking to either `libhidapi-libusb` or
`libhidapi-hidraw`.
Note that you will need to install an udev rule file with your application
for unprivileged users to be able to access HID devices with hidapi. Refer
to the [69-hid.rules](udev/69-hid.rules) file in the `udev` directory
for an example.
#### __Linux/hidraw__ (`linux/hid.c`):
This back-end uses the hidraw interface in the Linux kernel, and supports
both USB and Bluetooth HID devices. It requires kernel version at least 2.6.39
to build. In addition, it will only communicate with devices which have hidraw
nodes associated with them.
Keyboards, mice, and some other devices which are blacklisted from having
hidraw nodes will not work. Fortunately, for nearly all the uses of hidraw,
this is not a problem.
#### __Linux/FreeBSD/libusb__ (`libusb/hid.c`):
This back-end uses libusb-1.0 to communicate directly to a USB device. This
back-end will of course not work with Bluetooth devices.
### Test GUI
HIDAPI also comes with a Test GUI. The Test GUI is cross-platform and uses
Fox Toolkit <http://www.fox-toolkit.org>. It will build on every platform
which HIDAPI supports. Since it relies on a 3rd party library, building it
is optional but it is useful when debugging hardware.
NOTE: Test GUI based on Fox Toolkit is not actively developed nor supported
by HIDAPI team. It is kept as a historical artifact. It may even work sometime
or on some platforms, but it is not going to get any new features or bugfixes.
Instructions for installing Fox-Toolkit on each platform is not provided.
Make sure to use Fox-Toolkit v1.6 if you choose to use it.
### Console Test App
If you want to play around with your HID device before starting
any development with HIDAPI and using a GUI app is not an option for you, you may try [`hidapitester`](https://github.com/todbot/hidapitester).
This app has a console interface for most of the features supported
by HIDAPI library.
## What Does the API Look Like?
The API provides the most commonly used HID functions including sending
and receiving of input, output, and feature reports. The sample program,
which communicates with a heavily hacked up version of the Microchip USB
Generic HID sample looks like this (with error checking removed for
simplicity):
**Warning: Only run the code you understand, and only when it conforms to the
device spec. Writing data (`hid_write`) at random to your HID devices can break them.**
```c
#include <stdio.h> // printf
#include <wchar.h> // wchar_t
#include <hidapi.h>
#define MAX_STR 255
int main(int argc, char* argv[])
{
int res;
unsigned char buf[65];
wchar_t wstr[MAX_STR];
hid_device *handle;
int i;
// Initialize the hidapi library
res = hid_init();
// Open the device using the VID, PID,
// and optionally the Serial number.
handle = hid_open(0x4d8, 0x3f, NULL);
if (!handle) {
printf("Unable to open device\n");
hid_exit();
return 1;
}
// Read the Manufacturer String
res = hid_get_manufacturer_string(handle, wstr, MAX_STR);
printf("Manufacturer String: %ls\n", wstr);
// Read the Product String
res = hid_get_product_string(handle, wstr, MAX_STR);
printf("Product String: %ls\n", wstr);
// Read the Serial Number String
res = hid_get_serial_number_string(handle, wstr, MAX_STR);
printf("Serial Number String: (%d) %ls\n", wstr[0], wstr);
// Read Indexed String 1
res = hid_get_indexed_string(handle, 1, wstr, MAX_STR);
printf("Indexed String 1: %ls\n", wstr);
// Toggle LED (cmd 0x80). The first byte is the report number (0x0).
buf[0] = 0x0;
buf[1] = 0x80;
res = hid_write(handle, buf, 65);
// Request state (cmd 0x81). The first byte is the report number (0x0).
buf[0] = 0x0;
buf[1] = 0x81;
res = hid_write(handle, buf, 65);
// Read requested state
res = hid_read(handle, buf, 65);
// Print out the returned buffer.
for (i = 0; i < 4; i++)
printf("buf[%d]: %d\n", i, buf[i]);
// Close the device
hid_close(handle);
// Finalize the hidapi library
res = hid_exit();
return 0;
}
```
You can also use [hidtest/test.c](hidtest/test.c)
as a starting point for your applications.
## License
HIDAPI may be used by one of three licenses as outlined in [LICENSE.txt](LICENSE.txt).
## Installing HIDAPI
If you want to build your own application that uses HID devices with HIDAPI,
you need to get HIDAPI development package.
Depending on what your development environment is, HIDAPI likely to be provided
by your package manager.
For instance on Ubuntu, HIDAPI is available via APT:
```sh
sudo apt install libhidapi-dev
```
HIDAPI package name for other systems/package managers may differ.
Check the documentation/package list of your package manager.
## Build from Source
Check [BUILD.md](BUILD.md) for details.

1
node_modules/node-hid/hidapi/VERSION generated vendored Normal file
View File

@@ -0,0 +1 @@
0.15.0

19
node_modules/node-hid/hidapi/android/jni/Android.mk generated vendored Normal file
View File

@@ -0,0 +1,19 @@
LOCAL_PATH:= $(call my-dir)
HIDAPI_ROOT_REL:= ../..
HIDAPI_ROOT_ABS:= $(LOCAL_PATH)/../..
include $(CLEAR_VARS)
LOCAL_SRC_FILES := \
$(HIDAPI_ROOT_REL)/libusb/hid.c
LOCAL_C_INCLUDES += \
$(HIDAPI_ROOT_ABS)/hidapi \
$(HIDAPI_ROOT_ABS)/android
LOCAL_SHARED_LIBRARIES := libusb1.0
LOCAL_MODULE := libhidapi
include $(BUILD_SHARED_LIBRARY)

2
node_modules/node-hid/hidapi/bootstrap generated vendored Executable file
View File

@@ -0,0 +1,2 @@
#!/bin/sh -x
autoreconf --install --verbose --force

256
node_modules/node-hid/hidapi/configure.ac generated vendored Normal file
View File

@@ -0,0 +1,256 @@
AC_PREREQ(2.63)
AC_INIT([hidapi],[m4_normalize(m4_builtin([include], VERSION))],[https://github.com/libusb/hidapi/issues])
echo "This build script for HIDAPI is deprecated."
echo "Consider using CMake instead."
# Library soname version
# Follow the following rules (particularly the ones in the second link):
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# http://sourceware.org/autobook/autobook/autobook_91.html
lt_current="0"
lt_revision="0"
lt_age="0"
LTLDFLAGS="-version-info ${lt_current}:${lt_revision}:${lt_age}"
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT
AC_PROG_CC
AC_PROG_CXX
AC_PROG_OBJC
PKG_PROG_PKG_CONFIG
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
hidapi_lib_error() {
echo ""
echo " Library $1 was not found on this system."
echo " Please install it and re-run ./configure"
echo ""
exit 1
}
hidapi_prog_error() {
echo ""
echo " Program $1 was not found on this system."
echo " This program is part of $2."
echo " Please install it and re-run ./configure"
echo ""
exit 1
}
AC_MSG_CHECKING([operating system])
AC_MSG_RESULT($host)
case $host in
*-linux*)
AC_MSG_RESULT([ (Linux back-end)])
AC_DEFINE(OS_LINUX, 1, [Linux implementations])
AC_SUBST(OS_LINUX)
backend="linux"
os="linux"
threads="pthreads"
# HIDAPI/hidraw libs
PKG_CHECK_MODULES([libudev], [libudev], true, [hidapi_lib_error libudev])
LIBS_HIDRAW_PR="${LIBS_HIDRAW_PR} $libudev_LIBS"
CFLAGS_HIDRAW="${CFLAGS_HIDRAW} $libudev_CFLAGS"
# HIDAPI/libusb libs
AC_CHECK_LIB([rt], [clock_gettime], [LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} -lrt"], [hidapi_lib_error librt])
PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9], true, [hidapi_lib_error libusb-1.0])
LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} $libusb_LIBS"
CFLAGS_LIBUSB="${CFLAGS_LIBUSB} $libusb_CFLAGS"
;;
*-darwin*)
AC_MSG_RESULT([ (Mac OS X back-end)])
AC_DEFINE(OS_DARWIN, 1, [Mac implementation])
AC_SUBST(OS_DARWIN)
backend="mac"
os="darwin"
threads="pthreads"
LIBS="${LIBS} -framework IOKit -framework CoreFoundation"
;;
*-freebsd*)
AC_MSG_RESULT([ (FreeBSD back-end)])
AC_DEFINE(OS_FREEBSD, 1, [FreeBSD implementation])
AC_SUBST(OS_FREEBSD)
backend="libusb"
os="freebsd"
threads="pthreads"
CFLAGS="$CFLAGS -I/usr/local/include"
LDFLAGS="$LDFLAGS -L/usr/local/lib"
LIBS="${LIBS}"
PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9], true, [hidapi_lib_error libusb-1.0])
LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} $libusb_LIBS"
CFLAGS_LIBUSB="${CFLAGS_LIBUSB} $libusb_CFLAGS"
AC_CHECK_LIB([iconv], [iconv_open], [LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} -liconv"], [hidapi_lib_error libiconv])
;;
*-kfreebsd*)
AC_MSG_RESULT([ (kFreeBSD back-end)])
AC_DEFINE(OS_KFREEBSD, 1, [kFreeBSD implementation])
AC_SUBST(OS_KFREEBSD)
backend="libusb"
os="kfreebsd"
threads="pthreads"
PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9], true, [hidapi_lib_error libusb-1.0])
LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} $libusb_LIBS"
CFLAGS_LIBUSB="${CFLAGS_LIBUSB} $libusb_CFLAGS"
;;
*-*-haiku)
AC_MSG_RESULT([ (Haiku back-end)])
AC_DEFINE(OS_HAIKU, 1, [Haiku implementation])
AC_SUBST(OS_HAIKU)
backend="libusb"
os="haiku"
threads="pthreads"
PKG_CHECK_MODULES([libusb], [libusb-1.0 >= 1.0.9], true, [hidapi_lib_error libusb-1.0])
LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} $libusb_LIBS"
CFLAGS_LIBUSB="${CFLAGS_LIBUSB} $libusb_CFLAGS"
AC_CHECK_LIB([iconv], [libiconv_open], [LIBS_LIBUSB_PRIVATE="${LIBS_LIBUSB_PRIVATE} -liconv"], [hidapi_lib_error libiconv])
;;
*-mingw*)
AC_MSG_RESULT([ (Windows back-end, using MinGW)])
backend="windows"
os="windows"
threads="windows"
win_implementation="mingw"
LDFLAGS="${LDFLAGS} -static-libgcc"
;;
*-msys*)
AC_MSG_RESULT([ (Windows back-end, using MSYS2)])
backend="windows"
os="windows"
threads="windows"
win_implementation="mingw"
LDFLAGS="${LDFLAGS} -static-libgcc"
;;
*-cygwin*)
AC_MSG_RESULT([ (Windows back-end, using Cygwin)])
backend="windows"
os="windows"
threads="windows"
win_implementation="cygwin"
;;
*)
AC_MSG_ERROR([HIDAPI is not supported on your operating system yet])
esac
LIBS_HIDRAW="${LIBS} ${LIBS_HIDRAW_PR}"
LIBS_LIBUSB="${LIBS} ${LIBS_LIBUSB_PRIVATE}"
AC_SUBST([LIBS_HIDRAW])
AC_SUBST([LIBS_LIBUSB])
AC_SUBST([CFLAGS_LIBUSB])
AC_SUBST([CFLAGS_HIDRAW])
if test "x$os" = xwindows; then
AC_DEFINE(OS_WINDOWS, 1, [Windows implementations])
AC_SUBST(OS_WINDOWS)
LDFLAGS="${LDFLAGS} -no-undefined"
LIBS="${LIBS}"
fi
if test "x$threads" = xpthreads; then
AX_PTHREAD([found_pthreads=yes], [found_pthreads=no])
if test "x$found_pthreads" = xyes; then
if test "x$os" = xlinux; then
# Only use pthreads for libusb implementation on Linux.
LIBS_LIBUSB="$PTHREAD_LIBS $LIBS_LIBUSB"
CFLAGS_LIBUSB="$CFLAGS_LIBUSB $PTHREAD_CFLAGS"
# There's no separate CC on Linux for threading,
# so it's ok that both implementations use $PTHREAD_CC
CC="$PTHREAD_CC"
else
LIBS="$PTHREAD_LIBS $LIBS"
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
CC="$PTHREAD_CC"
fi
fi
fi
# Test GUI
AC_ARG_ENABLE([testgui],
[AS_HELP_STRING([--enable-testgui],
[enable building of test GUI (default n)])],
[testgui_enabled=$enableval],
[testgui_enabled='no'])
AM_CONDITIONAL([BUILD_TESTGUI], [test "x$testgui_enabled" != "xno"])
# Configure the MacOS TestGUI app bundle
rm -Rf testgui/TestGUI.app
mkdir -p testgui/TestGUI.app
cp -R ${srcdir}/testgui/TestGUI.app.in/* testgui/TestGUI.app
chmod -R u+w testgui/TestGUI.app
mkdir testgui/TestGUI.app/Contents/MacOS/
if test "x$testgui_enabled" != "xno"; then
if test "x$os" = xdarwin; then
# On Mac OS, do not use pkg-config.
AC_CHECK_PROG([foxconfig], [fox-config], [fox-config], false)
if test "x$foxconfig" = "xfalse"; then
hidapi_prog_error fox-config "FOX Toolkit"
fi
LIBS_TESTGUI="${LIBS_TESTGUI} `$foxconfig --libs`"
LIBS_TESTGUI="${LIBS_TESTGUI} -framework Cocoa -L/usr/X11R6/lib"
CFLAGS_TESTGUI="${CFLAGS_TESTGUI} `$foxconfig --cflags`"
OBJCFLAGS="${OBJCFLAGS} -x objective-c++"
elif test "x$os" = xwindows; then
# On Windows, just set the paths for Fox toolkit
if test "x$win_implementation" = xmingw; then
CFLAGS_TESTGUI="-I\$(srcdir)/../../hidapi-externals/fox/include -g -c"
LIBS_TESTGUI=" -mwindows \$(srcdir)/../../hidapi-externals/fox/lib/libFOX-1.6.a -lgdi32 -Wl,--enable-auto-import -static-libgcc -static-libstdc++ -lkernel32"
else
# Cygwin
CFLAGS_TESTGUI="-DWIN32 -I\$(srcdir)/../../hidapi-externals/fox/include -g -c"
LIBS_TESTGUI="\$(srcdir)/../../hidapi-externals/fox/lib/libFOX-cygwin-1.6.a -lgdi32 -Wl,--enable-auto-import -static-libgcc -static-libstdc++ -lkernel32"
fi
else
# On Linux and FreeBSD platforms, use pkg-config to find fox.
PKG_CHECK_MODULES([fox], [fox17], [], [PKG_CHECK_MODULES([fox], [fox])])
LIBS_TESTGUI="${LIBS_TESTGUI} $fox_LIBS"
if test "x$os" = xfreebsd; then
LIBS_TESTGUI="${LIBS_TESTGUI} -L/usr/local/lib"
fi
CFLAGS_TESTGUI="${CFLAGS_TESTGUI} $fox_CFLAGS"
fi
fi
AC_SUBST([LIBS_TESTGUI])
AC_SUBST([CFLAGS_TESTGUI])
AC_SUBST([backend])
# OS info for Automake
AM_CONDITIONAL(OS_LINUX, test "x$os" = xlinux)
AM_CONDITIONAL(OS_DARWIN, test "x$os" = xdarwin)
AM_CONDITIONAL(OS_FREEBSD, test "x$os" = xfreebsd)
AM_CONDITIONAL(OS_KFREEBSD, test "x$os" = xkfreebsd)
AM_CONDITIONAL(OS_HAIKU, test "x$os" = xhaiku)
AM_CONDITIONAL(OS_WINDOWS, test "x$os" = xwindows)
AC_CONFIG_HEADERS([config.h])
if test "x$os" = "xlinux"; then
AC_CONFIG_FILES([pc/hidapi-hidraw.pc])
AC_CONFIG_FILES([pc/hidapi-libusb.pc])
else
AC_CONFIG_FILES([pc/hidapi.pc])
fi
AC_SUBST(LTLDFLAGS)
AC_CONFIG_FILES([Makefile \
hidtest/Makefile \
libusb/Makefile \
linux/Makefile \
mac/Makefile \
testgui/Makefile \
windows/Makefile])
AC_OUTPUT

31
node_modules/node-hid/hidapi/dist/hidapi.podspec generated vendored Normal file
View File

@@ -0,0 +1,31 @@
Pod::Spec.new do |spec|
spec.name = "hidapi"
spec.version = File.read('../VERSION')
spec.summary = "A Simple library for communicating with USB and Bluetooth HID devices on Linux, Mac and Windows."
spec.description = <<-DESC
HIDAPI is a multi-platform library which allows an application to interface with USB and Bluetooth HID-Class devices on Windows, Linux, FreeBSD, and macOS. HIDAPI can be either built as a shared library (.so, .dll or .dylib) or can be embedded directly into a target application by adding a single source file (per platform) and a single header.
DESC
spec.homepage = "https://github.com/libusb/hidapi"
spec.license = { :type=> "GNU GPLv3 or BSD or HIDAPI original", :file => "LICENSE.txt" }
spec.authors = { "Alan Ott" => "alan@signal11.us",
"Ludovic Rousseau" => "rousseau@debian.org",
"libusb/hidapi Team" => "https://github.com/libusb/hidapi/blob/master/AUTHORS.txt",
}
spec.platform = :osx
spec.osx.deployment_target = "10.7"
spec.source = { :git => "https://github.com/libusb/hidapi.git", :tag => "hidapi-#{spec.version}" }
spec.source_files = "mac/hid.c", "hidapi/hidapi.h", "mac/hidapi_darwin.h"
spec.public_header_files = "hidapi/hidapi.h", "mac/hidapi_darwin.h"
spec.frameworks = "IOKit", "CoreFoundation"
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

2724
node_modules/node-hid/hidapi/doxygen/Doxyfile generated vendored Normal file

File diff suppressed because it is too large Load Diff

13
node_modules/node-hid/hidapi/doxygen/main_page.md generated vendored Normal file
View File

@@ -0,0 +1,13 @@
# HIDAPI Doxygen output
This site is dedicated to hosting an [API reference for the HIDAPI library](#API).
For general information, see the [source repository](https://github.com/libusb/hidapi#readme).
There are also build instructions hosted on github:
- [Building from source](https://github.com/libusb/hidapi/blob/master/BUILD.md)
- [Using CMake](https://github.com/libusb/hidapi/blob/master/BUILD.cmake.md)
- [Using Autotools (deprecated)](https://github.com/libusb/hidapi/blob/master/BUILD.autotools.md)
\example test.c contains a basic example usage of the HIDAPI library.

684
node_modules/node-hid/hidapi/hidapi/hidapi.h generated vendored Normal file
View File

@@ -0,0 +1,684 @@
/*******************************************************
HIDAPI - Multi-Platform library for
communication with HID devices.
Alan Ott
Signal 11 Software
libusb/hidapi Team
Copyright 2023, All Rights Reserved.
At the discretion of the user of this library,
this software may be licensed under the terms of the
GNU General Public License v3, a BSD-Style license, or the
original HIDAPI license as outlined in the LICENSE.txt,
LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt
files located at the root of the source distribution.
These files may also be found in the public source
code repository located at:
https://github.com/libusb/hidapi .
********************************************************/
/** @file
* @defgroup API hidapi API
*/
#ifndef HIDAPI_H__
#define HIDAPI_H__
#include <wchar.h>
/* #480: this is to be refactored properly for v1.0 */
#ifdef _WIN32
#ifndef HID_API_NO_EXPORT_DEFINE
#define HID_API_EXPORT __declspec(dllexport)
#endif
#endif
#ifndef HID_API_EXPORT
#define HID_API_EXPORT /**< API export macro */
#endif
/* To be removed in v1.0 */
#define HID_API_CALL /**< API call macro */
#define HID_API_EXPORT_CALL HID_API_EXPORT HID_API_CALL /**< API export and call macro*/
/** @brief Static/compile-time major version of the library.
@ingroup API
*/
#define HID_API_VERSION_MAJOR 0
/** @brief Static/compile-time minor version of the library.
@ingroup API
*/
#define HID_API_VERSION_MINOR 15
/** @brief Static/compile-time patch version of the library.
@ingroup API
*/
#define HID_API_VERSION_PATCH 0
/* Helper macros */
#define HID_API_AS_STR_IMPL(x) #x
#define HID_API_AS_STR(x) HID_API_AS_STR_IMPL(x)
#define HID_API_TO_VERSION_STR(v1, v2, v3) HID_API_AS_STR(v1.v2.v3)
/** @brief Coverts a version as Major/Minor/Patch into a number:
<8 bit major><16 bit minor><8 bit patch>.
This macro was added in version 0.12.0.
Convenient function to be used for compile-time checks, like:
@code{.c}
#if HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)
@endcode
@ingroup API
*/
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
/** @brief Static/compile-time version of the library.
This macro was added in version 0.12.0.
@see @ref HID_API_MAKE_VERSION.
@ingroup API
*/
#define HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
/** @brief Static/compile-time string version of the library.
@ingroup API
*/
#define HID_API_VERSION_STR HID_API_TO_VERSION_STR(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
/** @brief Maximum expected HID Report descriptor size in bytes.
Since version 0.13.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 13, 0)
@ingroup API
*/
#define HID_API_MAX_REPORT_DESCRIPTOR_SIZE 4096
#ifdef __cplusplus
extern "C" {
#endif
/** A structure to hold the version numbers. */
struct hid_api_version {
int major; /**< major version number */
int minor; /**< minor version number */
int patch; /**< patch version number */
};
struct hid_device_;
typedef struct hid_device_ hid_device; /**< opaque hidapi structure */
/** @brief HID underlying bus types.
@ingroup API
*/
typedef enum {
/** Unknown bus type */
HID_API_BUS_UNKNOWN = 0x00,
/** USB bus
Specifications:
https://usb.org/hid */
HID_API_BUS_USB = 0x01,
/** Bluetooth or Bluetooth LE bus
Specifications:
https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/
https://www.bluetooth.com/specifications/specs/hid-service-1-0/
https://www.bluetooth.com/specifications/specs/hid-over-gatt-profile-1-0/ */
HID_API_BUS_BLUETOOTH = 0x02,
/** I2C bus
Specifications:
https://docs.microsoft.com/previous-versions/windows/hardware/design/dn642101(v=vs.85) */
HID_API_BUS_I2C = 0x03,
/** SPI bus
Specifications:
https://www.microsoft.com/download/details.aspx?id=103325 */
HID_API_BUS_SPI = 0x04,
} hid_bus_type;
/** hidapi info structure */
struct hid_device_info {
/** Platform-specific device path */
char *path;
/** Device Vendor ID */
unsigned short vendor_id;
/** Device Product ID */
unsigned short product_id;
/** Serial Number */
wchar_t *serial_number;
/** Device Release Number in binary-coded decimal,
also known as Device Version Number */
unsigned short release_number;
/** Manufacturer String */
wchar_t *manufacturer_string;
/** Product string */
wchar_t *product_string;
/** Usage Page for this Device/Interface
(Windows/Mac/hidraw only) */
unsigned short usage_page;
/** Usage for this Device/Interface
(Windows/Mac/hidraw only) */
unsigned short usage;
/** The USB interface which this logical device
represents.
Valid only if the device is a USB HID device.
Set to -1 in all other cases.
*/
int interface_number;
/** Pointer to the next device */
struct hid_device_info *next;
/** Underlying bus type
Since version 0.13.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 13, 0)
*/
hid_bus_type bus_type;
};
/** @brief Initialize the HIDAPI library.
This function initializes the HIDAPI library. Calling it is not
strictly necessary, as it will be called automatically by
hid_enumerate() and any of the hid_open_*() functions if it is
needed. This function should be called at the beginning of
execution however, if there is a chance of HIDAPI handles
being opened by different threads simultaneously.
@ingroup API
@returns
This function returns 0 on success and -1 on error.
Call hid_error(NULL) to get the failure reason.
*/
int HID_API_EXPORT HID_API_CALL hid_init(void);
/** @brief Finalize the HIDAPI library.
This function frees all of the static data associated with
HIDAPI. It should be called at the end of execution to avoid
memory leaks.
@ingroup API
@returns
This function returns 0 on success and -1 on error.
*/
int HID_API_EXPORT HID_API_CALL hid_exit(void);
/** @brief Enumerate the HID Devices.
This function returns a linked list of all the HID devices
attached to the system which match vendor_id and product_id.
If @p vendor_id is set to 0 then any vendor matches.
If @p product_id is set to 0 then any product matches.
If @p vendor_id and @p product_id are both set to 0, then
all HID devices will be returned.
@ingroup API
@param vendor_id The Vendor ID (VID) of the types of device
to open.
@param product_id The Product ID (PID) of the types of
device to open.
@returns
This function returns a pointer to a linked list of type
struct #hid_device_info, containing information about the HID devices
attached to the system,
or NULL in the case of failure or if no HID devices present in the system.
Call hid_error(NULL) to get the failure reason.
@note The returned value by this function must to be freed by calling hid_free_enumeration(),
when not needed anymore.
*/
struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_enumerate(unsigned short vendor_id, unsigned short product_id);
/** @brief Free an enumeration Linked List
This function frees a linked list created by hid_enumerate().
@ingroup API
@param devs Pointer to a list of struct_device returned from
hid_enumerate().
*/
void HID_API_EXPORT HID_API_CALL hid_free_enumeration(struct hid_device_info *devs);
/** @brief Open a HID device using a Vendor ID (VID), Product ID
(PID) and optionally a serial number.
If @p serial_number is NULL, the first device with the
specified VID and PID is opened.
@ingroup API
@param vendor_id The Vendor ID (VID) of the device to open.
@param product_id The Product ID (PID) of the device to open.
@param serial_number The Serial Number of the device to open
(Optionally NULL).
@returns
This function returns a pointer to a #hid_device object on
success or NULL on failure.
Call hid_error(NULL) to get the failure reason.
@note The returned object must be freed by calling hid_close(),
when not needed anymore.
*/
HID_API_EXPORT hid_device * HID_API_CALL hid_open(unsigned short vendor_id, unsigned short product_id, const wchar_t *serial_number);
/** @brief Open a HID device by its path name.
The path name be determined by calling hid_enumerate(), or a
platform-specific path name can be used (eg: /dev/hidraw0 on
Linux).
@ingroup API
@param path The path name of the device to open
@returns
This function returns a pointer to a #hid_device object on
success or NULL on failure.
Call hid_error(NULL) to get the failure reason.
@note The returned object must be freed by calling hid_close(),
when not needed anymore.
*/
HID_API_EXPORT hid_device * HID_API_CALL hid_open_path(const char *path);
/** @brief Write an Output report to a HID device.
The first byte of @p data[] must contain the Report ID. For
devices which only support a single report, this must be set
to 0x0. The remaining bytes contain the report data. Since
the Report ID is mandatory, calls to hid_write() will always
contain one more byte than the report contains. For example,
if a hid report is 16 bytes long, 17 bytes must be passed to
hid_write(), the Report ID (or 0x0, for devices with a
single report), followed by the report data (16 bytes). In
this example, the length passed in would be 17.
hid_write() will send the data on the first interrupt OUT
endpoint, if one exists. If it does not the behaviour is as
@ref hid_send_output_report
@ingroup API
@param dev A device handle returned from hid_open().
@param data The data to send, including the report number as
the first byte.
@param length The length in bytes of the data to send.
@returns
This function returns the actual number of bytes written and
-1 on error.
Call hid_error(dev) to get the failure reason.
*/
int HID_API_EXPORT HID_API_CALL hid_write(hid_device *dev, const unsigned char *data, size_t length);
/** @brief Read an Input report from a HID device with timeout.
Input reports are returned
to the host through the INTERRUPT IN endpoint. The first byte will
contain the Report number if the device uses numbered reports.
@ingroup API
@param dev A device handle returned from hid_open().
@param data A buffer to put the read data into.
@param length The number of bytes to read. For devices with
multiple reports, make sure to read an extra byte for
the report number.
@param milliseconds timeout in milliseconds or -1 for blocking wait.
@returns
This function returns the actual number of bytes read and
-1 on error.
Call hid_read_error(dev) to get the failure reason.
If no packet was available to be read within
the timeout period, this function returns 0.
@note This function doesn't change the buffer returned by the hid_error(dev).
*/
int HID_API_EXPORT HID_API_CALL hid_read_timeout(hid_device *dev, unsigned char *data, size_t length, int milliseconds);
/** @brief Read an Input report from a HID device.
Input reports are returned
to the host through the INTERRUPT IN endpoint. The first byte will
contain the Report number if the device uses numbered reports.
@ingroup API
@param dev A device handle returned from hid_open().
@param data A buffer to put the read data into.
@param length The number of bytes to read. For devices with
multiple reports, make sure to read an extra byte for
the report number.
@returns
This function returns the actual number of bytes read and
-1 on error.
Call hid_read_error(dev) to get the failure reason.
If no packet was available to be read and
the handle is in non-blocking mode, this function returns 0.
@note This function doesn't change the buffer returned by the hid_error(dev).
*/
int HID_API_EXPORT HID_API_CALL hid_read(hid_device *dev, unsigned char *data, size_t length);
/** @brief Get a string describing the last error which occurred during hid_read/hid_read_timeout.
Since version 0.15.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 15, 0)
This function is intended for logging/debugging purposes.
This function guarantees to never return NULL for a valid @ref dev.
If there was no error in the last call to hid_read/hid_read_error -
the returned string clearly indicates that.
Strings returned from hid_read_error() must not be freed by the user,
i.e. owned by HIDAPI library.
Device-specific error string may remain allocated at most until hid_close() is called.
@ingroup API
@param dev A device handle. Shall never be NULL.
@returns
A string describing the hid_read/hid_read_timeout error (if any).
*/
HID_API_EXPORT const wchar_t* HID_API_CALL hid_read_error(hid_device *dev);
/** @brief Set the device handle to be non-blocking.
In non-blocking mode calls to hid_read() will return
immediately with a value of 0 if there is no data to be
read. In blocking mode, hid_read() will wait (block) until
there is data to read before returning.
Nonblocking can be turned on and off at any time.
@ingroup API
@param dev A device handle returned from hid_open().
@param nonblock enable or not the nonblocking reads
- 1 to enable nonblocking
- 0 to disable nonblocking.
@returns
This function returns 0 on success and -1 on error.
Call hid_error(dev) to get the failure reason.
*/
int HID_API_EXPORT HID_API_CALL hid_set_nonblocking(hid_device *dev, int nonblock);
/** @brief Send a Feature report to the device.
Feature reports are sent over the Control endpoint as a
Set_Report transfer. The first byte of @p data[] must
contain the Report ID. For devices which only support a
single report, this must be set to 0x0. The remaining bytes
contain the report data. Since the Report ID is mandatory,
calls to hid_send_feature_report() will always contain one
more byte than the report contains. For example, if a hid
report is 16 bytes long, 17 bytes must be passed to
hid_send_feature_report(): the Report ID (or 0x0, for
devices which do not use numbered reports), followed by the
report data (16 bytes). In this example, the length passed
in would be 17.
@ingroup API
@param dev A device handle returned from hid_open().
@param data The data to send, including the report number as
the first byte.
@param length The length in bytes of the data to send, including
the report number.
@returns
This function returns the actual number of bytes written and
-1 on error.
Call hid_error(dev) to get the failure reason.
*/
int HID_API_EXPORT HID_API_CALL hid_send_feature_report(hid_device *dev, const unsigned char *data, size_t length);
/** @brief Get a feature report from a HID device.
Set the first byte of @p data[] to the Report ID of the
report to be read. Make sure to allow space for this
extra byte in @p data[]. Upon return, the first byte will
still contain the Report ID, and the report data will
start in data[1].
@ingroup API
@param dev A device handle returned from hid_open().
@param data A buffer to put the read data into, including
the Report ID. Set the first byte of @p data[] to the
Report ID of the report to be read, or set it to zero
if your device does not use numbered reports.
@param length The number of bytes to read, including an
extra byte for the report ID. The buffer can be longer
than the actual report.
@returns
This function returns the number of bytes read plus
one for the report ID (which is still in the first
byte), or -1 on error.
Call hid_error(dev) to get the failure reason.
*/
int HID_API_EXPORT HID_API_CALL hid_get_feature_report(hid_device *dev, unsigned char *data, size_t length);
/** @brief Send a Output report to the device.
Since version 0.15.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 15, 0)
Output reports are sent over the Control endpoint as a
Set_Report transfer. The first byte of @p data[] must
contain the Report ID. For devices which only support a
single report, this must be set to 0x0. The remaining bytes
contain the report data. Since the Report ID is mandatory,
calls to hid_send_output_report() will always contain one
more byte than the report contains. For example, if a hid
report is 16 bytes long, 17 bytes must be passed to
hid_send_output_report(): the Report ID (or 0x0, for
devices which do not use numbered reports), followed by the
report data (16 bytes). In this example, the length passed
in would be 17.
This function sets the return value of hid_error().
@ingroup API
@param dev A device handle returned from hid_open().
@param data The data to send, including the report number as
the first byte.
@param length The length in bytes of the data to send, including
the report number.
@returns
This function returns the actual number of bytes written and
-1 on error.
@see @ref hid_write
*/
int HID_API_EXPORT HID_API_CALL hid_send_output_report(hid_device* dev, const unsigned char* data, size_t length);
/** @brief Get a input report from a HID device.
Since version 0.10.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 10, 0)
Set the first byte of @p data[] to the Report ID of the
report to be read. Make sure to allow space for this
extra byte in @p data[]. Upon return, the first byte will
still contain the Report ID, and the report data will
start in data[1].
@ingroup API
@param dev A device handle returned from hid_open().
@param data A buffer to put the read data into, including
the Report ID. Set the first byte of @p data[] to the
Report ID of the report to be read, or set it to zero
if your device does not use numbered reports.
@param length The number of bytes to read, including an
extra byte for the report ID. The buffer can be longer
than the actual report.
@returns
This function returns the number of bytes read plus
one for the report ID (which is still in the first
byte), or -1 on error.
Call hid_error(dev) to get the failure reason.
*/
int HID_API_EXPORT HID_API_CALL hid_get_input_report(hid_device *dev, unsigned char *data, size_t length);
/** @brief Close a HID device.
@ingroup API
@param dev A device handle returned from hid_open().
*/
void HID_API_EXPORT HID_API_CALL hid_close(hid_device *dev);
/** @brief Get The Manufacturer String from a HID device.
@ingroup API
@param dev A device handle returned from hid_open().
@param string A wide string buffer to put the data into.
@param maxlen The length of the buffer in multiples of wchar_t.
@returns
This function returns 0 on success and -1 on error.
Call hid_error(dev) to get the failure reason.
*/
int HID_API_EXPORT_CALL hid_get_manufacturer_string(hid_device *dev, wchar_t *string, size_t maxlen);
/** @brief Get The Product String from a HID device.
@ingroup API
@param dev A device handle returned from hid_open().
@param string A wide string buffer to put the data into.
@param maxlen The length of the buffer in multiples of wchar_t.
@returns
This function returns 0 on success and -1 on error.
Call hid_error(dev) to get the failure reason.
*/
int HID_API_EXPORT_CALL hid_get_product_string(hid_device *dev, wchar_t *string, size_t maxlen);
/** @brief Get The Serial Number String from a HID device.
@ingroup API
@param dev A device handle returned from hid_open().
@param string A wide string buffer to put the data into.
@param maxlen The length of the buffer in multiples of wchar_t.
@returns
This function returns 0 on success and -1 on error.
Call hid_error(dev) to get the failure reason.
*/
int HID_API_EXPORT_CALL hid_get_serial_number_string(hid_device *dev, wchar_t *string, size_t maxlen);
/** @brief Get The struct #hid_device_info from a HID device.
Since version 0.13.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 13, 0)
@ingroup API
@param dev A device handle returned from hid_open().
@returns
This function returns a pointer to the struct #hid_device_info
for this hid_device, or NULL in the case of failure.
Call hid_error(dev) to get the failure reason.
This struct is valid until the device is closed with hid_close().
@note The returned object is owned by the @p dev, and SHOULD NOT be freed by the user.
*/
struct hid_device_info HID_API_EXPORT * HID_API_CALL hid_get_device_info(hid_device *dev);
/** @brief Get a string from a HID device, based on its string index.
@ingroup API
@param dev A device handle returned from hid_open().
@param string_index The index of the string to get.
@param string A wide string buffer to put the data into.
@param maxlen The length of the buffer in multiples of wchar_t.
@returns
This function returns 0 on success and -1 on error.
Call hid_error(dev) to get the failure reason.
*/
int HID_API_EXPORT_CALL hid_get_indexed_string(hid_device *dev, int string_index, wchar_t *string, size_t maxlen);
/** @brief Get a report descriptor from a HID device.
Since version 0.14.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 14, 0)
User has to provide a preallocated buffer where descriptor will be copied to.
The recommended size for preallocated buffer is @ref HID_API_MAX_REPORT_DESCRIPTOR_SIZE bytes.
@ingroup API
@param dev A device handle returned from hid_open().
@param buf The buffer to copy descriptor into.
@param buf_size The size of the buffer in bytes.
@returns
This function returns non-negative number of bytes actually copied, or -1 on error.
*/
int HID_API_EXPORT_CALL hid_get_report_descriptor(hid_device *dev, unsigned char *buf, size_t buf_size);
/** @brief Get a string describing the last error which occurred.
This function is intended for logging/debugging purposes.
This function guarantees to never return NULL.
If there was no error in the last function call -
the returned string clearly indicates that.
Any HIDAPI function that can explicitly indicate an execution failure
(e.g. by an error code, or by returning NULL) - may set the error string,
to be returned by this function.
Strings returned from hid_error() must not be freed by the user,
i.e. owned by HIDAPI library.
Device-specific error string may remain allocated at most until hid_close() is called.
Global error string may remain allocated at most until hid_exit() is called.
@ingroup API
@param dev A device handle returned from hid_open(),
or NULL to get the last non-device-specific error
(e.g. for errors in hid_open() or hid_enumerate()).
@returns
A string describing the last error (if any).
*/
HID_API_EXPORT const wchar_t* HID_API_CALL hid_error(hid_device *dev);
/** @brief Get a runtime version of the library.
This function is thread-safe.
@ingroup API
@returns
Pointer to statically allocated struct, that contains version.
*/
HID_API_EXPORT const struct hid_api_version* HID_API_CALL hid_version(void);
/** @brief Get a runtime version string of the library.
This function is thread-safe.
@ingroup API
@returns
Pointer to statically allocated string, that contains version string.
*/
HID_API_EXPORT const char* HID_API_CALL hid_version_str(void);
#ifdef __cplusplus
}
#endif
#endif

40
node_modules/node-hid/hidapi/hidtest/CMakeLists.txt generated vendored Normal file
View File

@@ -0,0 +1,40 @@
cmake_minimum_required(VERSION 3.1.3...3.25 FATAL_ERROR)
project(hidtest C)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# hidtest is build as a standalone project
if(POLICY CMP0074)
# allow using hidapi_ROOT if CMake supports it
cmake_policy(SET CMP0074 NEW)
endif()
find_package(hidapi 0.12 REQUIRED)
message(STATUS "Using HIDAPI: ${hidapi_VERSION}")
else()
# hidtest is built as part of the main HIDAPI build
message(STATUS "Building hidtest")
endif()
set(HIDAPI_HIDTEST_TARGETS)
if(NOT WIN32 AND NOT APPLE AND CMAKE_SYSTEM_NAME MATCHES "Linux")
if(TARGET hidapi::hidraw)
add_executable(hidtest_hidraw test.c)
target_link_libraries(hidtest_hidraw hidapi::hidraw)
list(APPEND HIDAPI_HIDTEST_TARGETS hidtest_hidraw)
endif()
if(TARGET hidapi::libusb)
add_executable(hidtest_libusb test.c)
target_compile_definitions(hidtest_libusb PRIVATE USING_HIDAPI_LIBUSB)
target_link_libraries(hidtest_libusb hidapi::libusb)
list(APPEND HIDAPI_HIDTEST_TARGETS hidtest_libusb)
endif()
else()
add_executable(hidtest test.c)
target_link_libraries(hidtest hidapi::hidapi)
list(APPEND HIDAPI_HIDTEST_TARGETS hidtest)
endif()
install(TARGETS ${HIDAPI_HIDTEST_TARGETS}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)

28
node_modules/node-hid/hidapi/hidtest/Makefile.am generated vendored Normal file
View File

@@ -0,0 +1,28 @@
AM_CPPFLAGS = -I$(top_srcdir)/hidapi/
## Linux
if OS_LINUX
noinst_PROGRAMS = hidtest-libusb hidtest-hidraw
hidtest_hidraw_SOURCES = test.c
hidtest_hidraw_LDADD = $(top_builddir)/linux/libhidapi-hidraw.la
hidtest_libusb_SOURCES = test.c
hidtest_libusb_LDADD = $(top_builddir)/libusb/libhidapi-libusb.la
else
# Other OS's
noinst_PROGRAMS = hidtest
hidtest_SOURCES = test.c
hidtest_LDADD = $(top_builddir)/$(backend)/libhidapi.la
endif
if OS_DARWIN
AM_CPPFLAGS += -I$(top_srcdir)/mac/
endif
if OS_WINDOWS
AM_CPPFLAGS += -I$(top_srcdir)/windows/
endif

348
node_modules/node-hid/hidapi/hidtest/test.c generated vendored Normal file
View File

@@ -0,0 +1,348 @@
/*******************************************************
HIDAPI - Multi-Platform library for
communication with HID devices.
Alan Ott
Signal 11 Software
libusb/hidapi Team
Copyright 2022.
This contents of this file may be used by anyone
for any reason without any conditions and may be
used as a starting point for your own applications
which use HIDAPI.
********************************************************/
#include <stdio.h>
#include <wchar.h>
#include <string.h>
#include <stdlib.h>
#include <hidapi.h>
// Headers needed for sleeping.
#ifdef _WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
// Fallback/example
#ifndef HID_API_MAKE_VERSION
#define HID_API_MAKE_VERSION(mj, mn, p) (((mj) << 24) | ((mn) << 8) | (p))
#endif
#ifndef HID_API_VERSION
#define HID_API_VERSION HID_API_MAKE_VERSION(HID_API_VERSION_MAJOR, HID_API_VERSION_MINOR, HID_API_VERSION_PATCH)
#endif
//
// Sample using platform-specific headers
#if defined(__APPLE__) && HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)
#include <hidapi_darwin.h>
#endif
#if defined(_WIN32) && HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)
#include <hidapi_winapi.h>
#endif
#if defined(USING_HIDAPI_LIBUSB) && HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)
#include <hidapi_libusb.h>
#endif
//
const char *hid_bus_name(hid_bus_type bus_type) {
static const char *const HidBusTypeName[] = {
"Unknown",
"USB",
"Bluetooth",
"I2C",
"SPI",
};
if ((int)bus_type < 0)
bus_type = HID_API_BUS_UNKNOWN;
if ((int)bus_type >= (int)(sizeof(HidBusTypeName) / sizeof(HidBusTypeName[0])))
bus_type = HID_API_BUS_UNKNOWN;
return HidBusTypeName[bus_type];
}
void print_device(struct hid_device_info *cur_dev) {
printf("Device Found\n type: %04hx %04hx\n path: %s\n serial_number: %ls", cur_dev->vendor_id, cur_dev->product_id, cur_dev->path, cur_dev->serial_number);
printf("\n");
printf(" Manufacturer: %ls\n", cur_dev->manufacturer_string);
printf(" Product: %ls\n", cur_dev->product_string);
printf(" Release: %hx\n", cur_dev->release_number);
printf(" Interface: %d\n", cur_dev->interface_number);
printf(" Usage (page): 0x%hx (0x%hx)\n", cur_dev->usage, cur_dev->usage_page);
printf(" Bus type: %u (%s)\n", (unsigned)cur_dev->bus_type, hid_bus_name(cur_dev->bus_type));
printf("\n");
}
void print_hid_report_descriptor_from_device(hid_device *device) {
unsigned char descriptor[HID_API_MAX_REPORT_DESCRIPTOR_SIZE];
int res = 0;
printf(" Report Descriptor: ");
#if HID_API_VERSION >= HID_API_MAKE_VERSION(0, 14, 0)
res = hid_get_report_descriptor(device, descriptor, sizeof(descriptor));
#else
(void)res;
#endif
if (res < 0) {
printf("error getting: %ls", hid_error(device));
}
else {
printf("(%d bytes)", res);
}
for (int i = 0; i < res; i++) {
if (i % 10 == 0) {
printf("\n");
}
printf("0x%02x, ", descriptor[i]);
}
printf("\n");
}
void print_hid_report_descriptor_from_path(const char *path) {
hid_device *device = hid_open_path(path);
if (device) {
print_hid_report_descriptor_from_device(device);
hid_close(device);
}
else {
printf(" Report Descriptor: Unable to open device by path\n");
}
}
void print_devices(struct hid_device_info *cur_dev) {
for (; cur_dev; cur_dev = cur_dev->next) {
print_device(cur_dev);
}
}
void print_devices_with_descriptor(struct hid_device_info *cur_dev) {
for (; cur_dev; cur_dev = cur_dev->next) {
print_device(cur_dev);
print_hid_report_descriptor_from_path(cur_dev->path);
}
}
int main(int argc, char* argv[])
{
(void)argc;
(void)argv;
/* --- HIDAPI R&D: this is just to force the compiler to ensure
each of those functions are implemented (even as a stub)
by each backend. --- */
(void)&hid_open;
(void)&hid_open_path;
(void)&hid_read_timeout;
(void)&hid_get_input_report;
#if HID_API_VERSION >= HID_API_MAKE_VERSION(0, 15, 0)
(void)&hid_send_output_report;
#endif
(void)&hid_get_feature_report;
(void)&hid_send_feature_report;
#if HID_API_VERSION >= HID_API_MAKE_VERSION(0, 14, 0)
(void)&hid_get_report_descriptor;
#endif
/* --- */
int res;
unsigned char buf[256];
#define MAX_STR 255
wchar_t wstr[MAX_STR];
hid_device *handle;
int i;
struct hid_device_info *devs;
printf("hidapi test/example tool. Compiled with hidapi version %s, runtime version %s.\n", HID_API_VERSION_STR, hid_version_str());
if (HID_API_VERSION == HID_API_MAKE_VERSION(hid_version()->major, hid_version()->minor, hid_version()->patch)) {
printf("Compile-time version matches runtime version of hidapi.\n\n");
}
else {
printf("Compile-time version is different than runtime version of hidapi.\n]n");
}
if (hid_init())
return -1;
#if defined(__APPLE__) && HID_API_VERSION >= HID_API_MAKE_VERSION(0, 12, 0)
// To work properly needs to be called before hid_open/hid_open_path after hid_init.
// Best/recommended option - call it right after hid_init.
hid_darwin_set_open_exclusive(0);
#endif
devs = hid_enumerate(0x0, 0x0);
print_devices_with_descriptor(devs);
hid_free_enumeration(devs);
// Set up the command buffer.
memset(buf,0x00,sizeof(buf));
buf[0] = 0x01;
buf[1] = 0x81;
// Open the device using the VID, PID,
// and optionally the Serial number.
////handle = hid_open(0x4d8, 0x3f, L"12345");
handle = hid_open(0x4d8, 0x3f, NULL);
if (!handle) {
printf("unable to open device\n");
hid_exit();
return 1;
}
#if defined(_WIN32) && HID_API_VERSION >= HID_API_MAKE_VERSION(0, 15, 0)
hid_winapi_set_write_timeout(handle, 5000);
#endif
// Read the Manufacturer String
wstr[0] = 0x0000;
res = hid_get_manufacturer_string(handle, wstr, MAX_STR);
if (res < 0)
printf("Unable to read manufacturer string\n");
printf("Manufacturer String: %ls\n", wstr);
// Read the Product String
wstr[0] = 0x0000;
res = hid_get_product_string(handle, wstr, MAX_STR);
if (res < 0)
printf("Unable to read product string\n");
printf("Product String: %ls\n", wstr);
// Read the Serial Number String
wstr[0] = 0x0000;
res = hid_get_serial_number_string(handle, wstr, MAX_STR);
if (res < 0)
printf("Unable to read serial number string\n");
printf("Serial Number String: (%d) %ls\n", wstr[0], wstr);
print_hid_report_descriptor_from_device(handle);
struct hid_device_info* info = hid_get_device_info(handle);
if (info == NULL) {
printf("Unable to get device info\n");
} else {
print_devices(info);
}
// Read Indexed String 1
wstr[0] = 0x0000;
res = hid_get_indexed_string(handle, 1, wstr, MAX_STR);
if (res < 0)
printf("Unable to read indexed string 1\n");
printf("Indexed String 1: %ls\n", wstr);
// Set the hid_read() function to be non-blocking.
hid_set_nonblocking(handle, 1);
// Try to read from the device. There should be no
// data here, but execution should not block.
res = hid_read(handle, buf, 17);
if (res < 0) {
#if HID_API_VERSION >= HID_API_MAKE_VERSION(0, 15, 0)
printf("Unable to read from device: %ls\n", hid_read_error(handle));
#else
printf("Unable to read from device: %ls\n", hid_error(handle));
#endif
}
// Send a Feature Report to the device
buf[0] = 0x2;
buf[1] = 0xa0;
buf[2] = 0x0a;
buf[3] = 0x00;
buf[4] = 0x00;
res = hid_send_feature_report(handle, buf, 17);
if (res < 0) {
printf("Unable to send a feature report: %ls\n", hid_error(handle));
}
memset(buf,0,sizeof(buf));
// Read a Feature Report from the device
buf[0] = 0x2;
res = hid_get_feature_report(handle, buf, sizeof(buf));
if (res < 0) {
printf("Unable to get a feature report: %ls\n", hid_error(handle));
}
else {
// Print out the returned buffer.
printf("Feature Report\n ");
for (i = 0; i < res; i++)
printf("%02x ", (unsigned int) buf[i]);
printf("\n");
}
memset(buf,0,sizeof(buf));
// Toggle LED (cmd 0x80). The first byte is the report number (0x1).
buf[0] = 0x1;
buf[1] = 0x80;
res = hid_write(handle, buf, 17);
if (res < 0) {
printf("Unable to write(): %ls\n", hid_error(handle));
}
// Request state (cmd 0x81). The first byte is the report number (0x1).
buf[0] = 0x1;
buf[1] = 0x81;
hid_write(handle, buf, 17);
if (res < 0) {
printf("Unable to write()/2: %ls\n", hid_error(handle));
}
// Read requested state. hid_read() has been set to be
// non-blocking by the call to hid_set_nonblocking() above.
// This loop demonstrates the non-blocking nature of hid_read().
res = 0;
i = 0;
while (res == 0) {
res = hid_read(handle, buf, sizeof(buf));
if (res == 0) {
printf("waiting...\n");
}
if (res < 0) {
printf("Unable to read(): %ls\n", hid_error(handle));
break;
}
i++;
if (i >= 10) { /* 10 tries by 500 ms - 5 seconds of waiting*/
printf("read() timeout\n");
break;
}
#ifdef _WIN32
Sleep(500);
#else
usleep(500*1000);
#endif
}
if (res > 0) {
printf("Data read:\n ");
// Print out the returned buffer.
for (i = 0; i < res; i++)
printf("%02x ", (unsigned int) buf[i]);
printf("\n");
}
hid_close(handle);
/* Free static HIDAPI objects. */
hid_exit();
#ifdef _WIN32
system("pause");
#endif
return 0;
}

107
node_modules/node-hid/hidapi/libusb/CMakeLists.txt generated vendored Normal file
View File

@@ -0,0 +1,107 @@
cmake_minimum_required(VERSION 3.6.3...3.25 FATAL_ERROR)
list(APPEND HIDAPI_PUBLIC_HEADERS "hidapi_libusb.h")
add_library(hidapi_libusb
${HIDAPI_PUBLIC_HEADERS}
hid.c
)
target_link_libraries(hidapi_libusb PUBLIC hidapi_include)
if(TARGET usb-1.0)
target_link_libraries(hidapi_libusb PRIVATE usb-1.0)
else()
include(FindPkgConfig)
pkg_check_modules(libusb REQUIRED IMPORTED_TARGET libusb-1.0>=1.0.9)
target_link_libraries(hidapi_libusb PRIVATE PkgConfig::libusb)
endif()
find_package(Threads REQUIRED)
target_link_libraries(hidapi_libusb PRIVATE Threads::Threads)
if(HIDAPI_NO_ICONV)
target_compile_definitions(hidapi_libusb PRIVATE NO_ICONV)
else()
if(NOT ANDROID)
include(CheckCSourceCompiles)
if(NOT CMAKE_VERSION VERSION_LESS 3.11)
message(STATUS "Check for Iconv")
find_package(Iconv)
if(Iconv_FOUND)
if(NOT Iconv_IS_BUILT_IN)
target_link_libraries(hidapi_libusb PRIVATE Iconv::Iconv)
set(CMAKE_REQUIRED_LIBRARIES "Iconv::Iconv")
if(NOT BUILD_SHARED_LIBS)
set(HIDAPI_NEED_EXPORT_ICONV TRUE PARENT_SCOPE)
endif()
endif()
else()
message(STATUS "Iconv Explicitly check '-liconv'")
# Sometime the build environment is not setup
# in a way CMake can find Iconv on its own by default.
# But if we simply link against iconv (-liconv), the build may succeed
# due to other compiler/link flags.
set(CMAKE_REQUIRED_LIBRARIES "iconv")
check_c_source_compiles("
#include <stddef.h>
#include <iconv.h>
int main() {
char *a, *b;
size_t i, j;
iconv_t ic;
ic = iconv_open(\"to\", \"from\");
iconv(ic, &a, &i, &b, &j);
iconv_close(ic);
}
"
Iconv_EXPLICITLY_AT_ENV)
if(Iconv_EXPLICITLY_AT_ENV)
message(STATUS "Iconv Explicitly check '-liconv' - Available")
target_link_libraries(hidapi_libusb PRIVATE iconv)
else()
message(FATAL_ERROR "Iconv is not found, make sure to provide it in the build environment")
endif()
endif()
else()
# otherwise there is 2 options:
# 1) iconv is provided by Standard C library and the build will be just fine
# 2) The _user_ has to provide additional compilation options for this project/target
endif()
# check for error: "conflicting types for 'iconv'"
check_c_source_compiles("#include<iconv.h>
extern size_t iconv (iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
int main() {}"
HIDAPI_ICONV_CONST)
if(HIDAPI_ICONV_CONST)
target_compile_definitions(hidapi_libusb PRIVATE "ICONV_CONST=const")
endif()
else()
# On Android Iconv is disabled on the code level anyway, so no issue;
endif()
endif()
set_target_properties(hidapi_libusb
PROPERTIES
EXPORT_NAME "libusb"
OUTPUT_NAME "hidapi-libusb"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
PUBLIC_HEADER "${HIDAPI_PUBLIC_HEADERS}"
)
# compatibility with find_package()
add_library(hidapi::libusb ALIAS hidapi_libusb)
# compatibility with raw library link
add_library(hidapi-libusb ALIAS hidapi_libusb)
if(HIDAPI_INSTALL_TARGETS)
install(TARGETS hidapi_libusb EXPORT hidapi
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hidapi"
)
endif()
hidapi_configure_pc("${PROJECT_ROOT}/pc/hidapi-libusb.pc.in")

22
node_modules/node-hid/hidapi/libusb/Makefile-manual generated vendored Normal file
View File

@@ -0,0 +1,22 @@
OS=$(shell uname)
ifeq ($(OS), Linux)
FILE=Makefile.linux
endif
ifeq ($(OS), FreeBSD)
FILE=Makefile.freebsd
endif
ifeq ($(OS), Haiku)
FILE=Makefile.haiku
endif
ifeq ($(FILE), )
all:
$(error Your platform ${OS} is not supported by hidapi/libusb at this time.)
endif
include $(FILE)

34
node_modules/node-hid/hidapi/libusb/Makefile.am generated vendored Normal file
View File

@@ -0,0 +1,34 @@
AM_CPPFLAGS = -I$(top_srcdir)/hidapi $(CFLAGS_LIBUSB)
if OS_LINUX
lib_LTLIBRARIES = libhidapi-libusb.la
libhidapi_libusb_la_SOURCES = hid.c
libhidapi_libusb_la_LDFLAGS = $(LTLDFLAGS) $(PTHREAD_CFLAGS)
libhidapi_libusb_la_LIBADD = $(LIBS_LIBUSB)
endif
if OS_FREEBSD
lib_LTLIBRARIES = libhidapi.la
libhidapi_la_SOURCES = hid.c
libhidapi_la_LDFLAGS = $(LTLDFLAGS)
libhidapi_la_LIBADD = $(LIBS_LIBUSB)
endif
if OS_KFREEBSD
lib_LTLIBRARIES = libhidapi.la
libhidapi_la_SOURCES = hid.c
libhidapi_la_LDFLAGS = $(LTLDFLAGS)
libhidapi_la_LIBADD = $(LIBS_LIBUSB)
endif
if OS_HAIKU
lib_LTLIBRARIES = libhidapi.la
libhidapi_la_SOURCES = hid.c
libhidapi_la_LDFLAGS = $(LTLDFLAGS)
libhidapi_la_LIBADD = $(LIBS_LIBUSB)
endif
hdrdir = $(includedir)/hidapi
hdr_HEADERS = $(top_srcdir)/hidapi/hidapi.h hidapi_libusb.h
EXTRA_DIST = Makefile-manual

39
node_modules/node-hid/hidapi/libusb/Makefile.freebsd generated vendored Normal file
View File

@@ -0,0 +1,39 @@
###########################################
# Simple Makefile for HIDAPI test program
#
# Alan Ott
# Signal 11 Software
# 2010-06-01
###########################################
all: hidtest libs
libs: libhidapi.so
CC ?= cc
CFLAGS ?= -Wall -g -fPIC
COBJS = hid.o ../hidtest/test.o
OBJS = $(COBJS)
INCLUDES = -I../hidapi -I. -I/usr/local/include
LDFLAGS = -L/usr/local/lib
LIBS = -lusb -liconv -pthread
# Console Test Program
hidtest: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
# Shared Libs
libhidapi.so: $(COBJS)
$(CC) $(LDFLAGS) -shared -Wl,-soname,$@.0 $^ -o $@ $(LIBS)
# Objects
$(COBJS): %.o: %.c
$(CC) $(CFLAGS) -c $(INCLUDES) $< -o $@
clean:
rm -f $(OBJS) hidtest libhidapi.so ../hidtest/hidtest.o
.PHONY: clean libs

39
node_modules/node-hid/hidapi/libusb/Makefile.haiku generated vendored Normal file
View File

@@ -0,0 +1,39 @@
###########################################
# Simple Makefile for HIDAPI test program
#
# Alan Ott
# Signal 11 Software
# 2010-06-01
###########################################
all: hidtest libs
libs: libhidapi.so
CC ?= cc
CFLAGS ?= -Wall -g -fPIC
COBJS = hid.o ../hidtest/test.o
OBJS = $(COBJS)
INCLUDES = -I../hidapi -I. -I/usr/local/include
LDFLAGS = -L/usr/local/lib
LIBS = -lusb -liconv -pthread
# Console Test Program
hidtest: $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $^ -o $@ $(LIBS)
# Shared Libs
libhidapi.so: $(COBJS)
$(CC) $(LDFLAGS) -shared -Wl,-soname,$@.0 $^ -o $@ $(LIBS)
# Objects
$(COBJS): %.o: %.c
$(CC) $(CFLAGS) -c $(INCLUDES) $< -o $@
clean:
rm -f $(OBJS) hidtest libhidapi.so ../hidtest/hidtest.o
.PHONY: clean libs

42
node_modules/node-hid/hidapi/libusb/Makefile.linux generated vendored Normal file
View File

@@ -0,0 +1,42 @@
###########################################
# Simple Makefile for HIDAPI test program
#
# Alan Ott
# Signal 11 Software
# 2010-06-01
###########################################
all: hidtest-libusb libs
libs: libhidapi-libusb.so
CC ?= gcc
CFLAGS ?= -Wall -g -fpic
LDFLAGS ?= -Wall -g
COBJS_LIBUSB = hid.o
COBJS = $(COBJS_LIBUSB) ../hidtest/test.o
OBJS = $(COBJS)
LIBS_USB = `pkg-config libusb-1.0 --libs` -lrt -lpthread
LIBS = $(LIBS_USB)
INCLUDES ?= -I../hidapi -I. `pkg-config libusb-1.0 --cflags`
# Console Test Program
hidtest-libusb: $(COBJS)
$(CC) $(LDFLAGS) $^ $(LIBS_USB) -o $@
# Shared Libs
libhidapi-libusb.so: $(COBJS_LIBUSB)
$(CC) $(LDFLAGS) $(LIBS_USB) -shared -fpic -Wl,-soname,$@.0 $^ -o $@
# Objects
$(COBJS): %.o: %.c
$(CC) $(CFLAGS) -c $(INCLUDES) $< -o $@
clean:
rm -f $(OBJS) hidtest-libusb libhidapi-libusb.so ../hidtest/hidtest.o
.PHONY: clean libs

2018
node_modules/node-hid/hidapi/libusb/hid.c generated vendored Normal file

File diff suppressed because it is too large Load Diff

56
node_modules/node-hid/hidapi/libusb/hidapi_libusb.h generated vendored Normal file
View File

@@ -0,0 +1,56 @@
/*******************************************************
HIDAPI - Multi-Platform library for
communication with HID devices.
libusb/hidapi Team
Copyright 2021, All Rights Reserved.
At the discretion of the user of this library,
this software may be licensed under the terms of the
GNU General Public License v3, a BSD-Style license, or the
original HIDAPI license as outlined in the LICENSE.txt,
LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt
files located at the root of the source distribution.
These files may also be found in the public source
code repository located at:
https://github.com/libusb/hidapi .
********************************************************/
/** @file
* @defgroup API hidapi API
* Since version 0.11.0, @ref HID_API_VERSION >= HID_API_MAKE_VERSION(0, 11, 0).
*/
#ifndef HIDAPI_LIBUSB_H__
#define HIDAPI_LIBUSB_H__
#include <stdint.h>
#include "hidapi.h"
#ifdef __cplusplus
extern "C" {
#endif
/** @brief Open a HID device using libusb_wrap_sys_device.
See https://libusb.sourceforge.io/api-1.0/group__libusb__dev.html#ga98f783e115ceff4eaf88a60e6439563c,
for details on libusb_wrap_sys_device.
@ingroup API
@param sys_dev Platform-specific file descriptor that can be recognised by libusb.
@param interface_num USB interface number of the device to be used as HID interface.
Pass -1 to select first HID interface of the device.
@returns
This function returns a pointer to a #hid_device object on
success or NULL on failure.
*/
HID_API_EXPORT hid_device * HID_API_CALL hid_libusb_wrap_sys_device(intptr_t sys_dev, int interface_num);
#ifdef __cplusplus
}
#endif
#endif

View File

@@ -0,0 +1,174 @@
/*******************************************************
HIDAPI - Multi-Platform library for
communication with HID devices.
Alan Ott
Signal 11 Software
libusb/hidapi Team
Sam Lantinga
Copyright 2023, All Rights Reserved.
At the discretion of the user of this library,
this software may be licensed under the terms of the
GNU General Public License v3, a BSD-Style license, or the
original HIDAPI license as outlined in the LICENSE.txt,
LICENSE-gpl3.txt, LICENSE-bsd.txt, and LICENSE-orig.txt
files located at the root of the source distribution.
These files may also be found in the public source
code repository located at:
https://github.com/libusb/hidapi .
********************************************************/
#include <pthread.h>
#if defined(__ANDROID__) && __ANDROID_API__ < __ANDROID_API_N__
/* Barrier implementation because Android/Bionic don't have pthread_barrier.
This implementation came from Brent Priddy and was posted on
StackOverflow. It is used with his permission. */
typedef int pthread_barrierattr_t;
typedef struct pthread_barrier {
pthread_mutex_t mutex;
pthread_cond_t cond;
int count;
int trip_count;
} pthread_barrier_t;
static int pthread_barrier_init(pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count)
{
if(count == 0) {
errno = EINVAL;
return -1;
}
if(pthread_mutex_init(&barrier->mutex, 0) < 0) {
return -1;
}
if(pthread_cond_init(&barrier->cond, 0) < 0) {
pthread_mutex_destroy(&barrier->mutex);
return -1;
}
barrier->trip_count = count;
barrier->count = 0;
return 0;
}
static int pthread_barrier_destroy(pthread_barrier_t *barrier)
{
pthread_cond_destroy(&barrier->cond);
pthread_mutex_destroy(&barrier->mutex);
return 0;
}
static int pthread_barrier_wait(pthread_barrier_t *barrier)
{
pthread_mutex_lock(&barrier->mutex);
++(barrier->count);
if(barrier->count >= barrier->trip_count) {
barrier->count = 0;
pthread_cond_broadcast(&barrier->cond);
pthread_mutex_unlock(&barrier->mutex);
return 1;
}
else {
pthread_cond_wait(&barrier->cond, &(barrier->mutex));
pthread_mutex_unlock(&barrier->mutex);
return 0;
}
}
#endif
#define HIDAPI_THREAD_TIMED_OUT ETIMEDOUT
typedef struct timespec hidapi_timespec;
typedef struct
{
pthread_t thread;
pthread_mutex_t mutex; /* Protects input_reports */
pthread_cond_t condition;
pthread_barrier_t barrier; /* Ensures correct startup sequence */
} hidapi_thread_state;
static void hidapi_thread_state_init(hidapi_thread_state *state)
{
pthread_mutex_init(&state->mutex, NULL);
pthread_cond_init(&state->condition, NULL);
pthread_barrier_init(&state->barrier, NULL, 2);
}
static void hidapi_thread_state_destroy(hidapi_thread_state *state)
{
pthread_barrier_destroy(&state->barrier);
pthread_cond_destroy(&state->condition);
pthread_mutex_destroy(&state->mutex);
}
#define hidapi_thread_cleanup_push pthread_cleanup_push
#define hidapi_thread_cleanup_pop pthread_cleanup_pop
static void hidapi_thread_mutex_lock(hidapi_thread_state *state)
{
pthread_mutex_lock(&state->mutex);
}
static void hidapi_thread_mutex_unlock(hidapi_thread_state *state)
{
pthread_mutex_unlock(&state->mutex);
}
static void hidapi_thread_cond_wait(hidapi_thread_state *state)
{
pthread_cond_wait(&state->condition, &state->mutex);
}
static int hidapi_thread_cond_timedwait(hidapi_thread_state *state, hidapi_timespec *ts)
{
return pthread_cond_timedwait(&state->condition, &state->mutex, ts);
}
static void hidapi_thread_cond_signal(hidapi_thread_state *state)
{
pthread_cond_signal(&state->condition);
}
static void hidapi_thread_cond_broadcast(hidapi_thread_state *state)
{
pthread_cond_broadcast(&state->condition);
}
static void hidapi_thread_barrier_wait(hidapi_thread_state *state)
{
pthread_barrier_wait(&state->barrier);
}
static void hidapi_thread_create(hidapi_thread_state *state, void *(*func)(void*), void *func_arg)
{
pthread_create(&state->thread, NULL, func, func_arg);
}
static void hidapi_thread_join(hidapi_thread_state *state)
{
pthread_join(state->thread, NULL);
}
static void hidapi_thread_gettime(hidapi_timespec *ts)
{
clock_gettime(CLOCK_REALTIME, ts);
}
static void hidapi_thread_addtime(hidapi_timespec *ts, int milliseconds)
{
ts->tv_sec += milliseconds / 1000;
ts->tv_nsec += (milliseconds % 1000) * 1000000;
if (ts->tv_nsec >= 1000000000L) {
ts->tv_sec++;
ts->tv_nsec -= 1000000000L;
}
}

38
node_modules/node-hid/hidapi/linux/CMakeLists.txt generated vendored Normal file
View File

@@ -0,0 +1,38 @@
cmake_minimum_required(VERSION 3.6.3...3.25 FATAL_ERROR)
add_library(hidapi_hidraw
${HIDAPI_PUBLIC_HEADERS}
hid.c
)
target_link_libraries(hidapi_hidraw PUBLIC hidapi_include)
find_package(Threads REQUIRED)
include(FindPkgConfig)
pkg_check_modules(libudev REQUIRED IMPORTED_TARGET libudev)
target_link_libraries(hidapi_hidraw PRIVATE PkgConfig::libudev Threads::Threads)
set_target_properties(hidapi_hidraw
PROPERTIES
EXPORT_NAME "hidraw"
OUTPUT_NAME "hidapi-hidraw"
VERSION ${PROJECT_VERSION}
SOVERSION ${PROJECT_VERSION_MAJOR}
PUBLIC_HEADER "${HIDAPI_PUBLIC_HEADERS}"
)
# compatibility with find_package()
add_library(hidapi::hidraw ALIAS hidapi_hidraw)
# compatibility with raw library link
add_library(hidapi-hidraw ALIAS hidapi_hidraw)
if(HIDAPI_INSTALL_TARGETS)
install(TARGETS hidapi_hidraw EXPORT hidapi
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/hidapi"
)
endif()
hidapi_configure_pc("${PROJECT_ROOT}/pc/hidapi-hidraw.pc.in")

42
node_modules/node-hid/hidapi/linux/Makefile-manual generated vendored Normal file
View File

@@ -0,0 +1,42 @@
###########################################
# Simple Makefile for HIDAPI test program
#
# Alan Ott
# Signal 11 Software
# 2010-06-01
###########################################
all: hidtest-hidraw libs
libs: libhidapi-hidraw.so
CC ?= gcc
CFLAGS ?= -Wall -g -fpic
LDFLAGS ?= -Wall -g
COBJS = hid.o ../hidtest/test.o
OBJS = $(COBJS)
LIBS_UDEV = `pkg-config libudev --libs` -lrt
LIBS = $(LIBS_UDEV)
INCLUDES ?= -I../hidapi `pkg-config libusb-1.0 --cflags`
# Console Test Program
hidtest-hidraw: $(COBJS)
$(CC) $(LDFLAGS) $^ $(LIBS_UDEV) -o $@
# Shared Libs
libhidapi-hidraw.so: $(COBJS)
$(CC) $(LDFLAGS) $(LIBS_UDEV) -shared -fpic -Wl,-soname,$@.0 $^ -o $@
# Objects
$(COBJS): %.o: %.c
$(CC) $(CFLAGS) -c $(INCLUDES) $< -o $@
clean:
rm -f $(OBJS) hidtest-hidraw libhidapi-hidraw.so $(COBJS)
.PHONY: clean libs

Some files were not shown because too many files have changed in this diff Show More