npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

arctis-usb-finder

v0.0.21

Published

Finds Arctis Headphones that are connected via USB

Downloads

67

Readme

Arctis USB Finder

CI Publish to NPM NPM Version Code Climate codecov

Finds known Arctis headsets that are currently plugged in via the USB dongle.

Supported Headphones

  • Arctis Pro Wireless
  • Arctis 7 2017
  • Arctis 7 2019
  • Arctis Pro 2019
  • Arctis Pro GameDac
  • Arctis 9
  • Arctis 1 Wireless
  • Arctis 1 Xbox
  • Arctis 7X
  • Arctis 7 Plus
  • Arctis 7P Plus
  • Arctis 7X Plus
  • Arctis 7 Destiny Plus
  • Arctis Nova 7
  • Arctis Nova 7X
  • Arctis Nova 7P

See Probe for how to get find new devices.

Usage

Install the package:

npm install arctis-usb-finder

Require the package:

const ArctisUsbFinder = require('arctis-usb-finder');

Use it:

const arctisUsbFinder = new ArctisUsbFinder();
arctisUsbFinder.loadHeadphones()
let headphones = arctisUsbFinder.simpleHeadphones()

// Sometime later
arctisUsbFinder.refreshHeadphones()
headphones = arctisUsbFinder.simpleHeadphones()
// or
arctisUsbFinder.loadHeadphones()
headphones = arctisUsbFinder.simpleHeadphones()

Data structure:

[
  {
    isMuted: false,
    isCharging: false,
    isDischarging: true,
    isConnected: true,
    vendorId: 4152,
    productId: 4823,
    modelName: 'Arctis 7X',
    batteryPercent: 58,
    path: 'IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/XHC1@14/XHC1@14000000/HS06@14100000/USB2.0 Hub             @14100000/AppleUSB20Hub@14100000/AppleUSB20HubPort@14120000/SteelSeries Arctis 7X@14120000/SteelSeries Arctis 7X@3/AppleUserUSBHostHIDDevice'
  }
]

And using the data structure we get back, as long as we have the path, we can refresh the devices we have connected

const headphones = refreshHeadphones(
  [
    {
      // Not required
      isMuted: true, // Changed
      isCharging: false,
      isDischarging: true,
      isConnected: true,
      modelName: 'Arctis 7X',
      batteryPercent: 50, // Changed
      // Optional either
      // Path
      path: 'IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/XHC1@14/XHC1@14000000/HS06@14100000/USB2.0 Hub             @14100000/AppleUSB20Hub@14100000/AppleUSB20HubPort@14120000/SteelSeries Arctis 7X@14120000/SteelSeries Arctis 7X@3/AppleUserUSBHostHIDDevice',
      // or Vendor ID AND Product ID
      vendorId: 4152,
      productId: 4823,
    }
  ]
)

Note

  • If the isMuted, isCharging, isDischarging or isConnected flags are not supported, they would return undefined. They are defined per Model you can see which headphones are supported here. The path is the HID path.
  • refreshHeadphones requires a path value; it will not pick up additional headphones or headphones moved to another port.

Development

Use npm install to install all the dependencies and npm test to run the tests.

Probe

Install this package npm install arctis-usb-finder, which will give you access to the executable arctis-usb-finder-probe. This will search for known USB dongles and will report the technical details so it can be added via an Issue.

E.g.

Product: SteelSeries Arctis 7X
Product ID: 4823
Bytes: [ 6, 18 ]
Report: [
  6, 18, 1, 0, 0, 1, 34, 142, 1,
  0,  0, 0, 0, 0, 0,  0,   0, 0,
  0,  0, 0, 0, 0, 0,  0,   0, 0,
  0,  0, 0, 0
]
path: 'IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/XHC1@14/XHC1@14000000/HS06@14100000/USB2.0 Hub             @14100000/AppleUSB20Hub@14100000/AppleUSB20HubPort@14120000/SteelSeries Arctis 7X@14120000/SteelSeries Arctis 7X@3/AppleUserUSBHostHIDDevice'

You may get something like this:

Product: SteelSeries Arctis 7X
Product ID: 4823
Bytes: undefined
Report: undefined
Path: IOService:/AppleACPIPlatformExpert/PCI0@0/AppleACPIPCI/XHC1@14/XHC1@14000000/HS06@14100000/USB2.0 Hub             @14100000/AppleUSB20Hub@14100000/AppleUSB20HubPort@14120000/SteelSeries Arctis 7X@14120000/SteelSeries Arctis 7X@3/AppleUserUSBHostHIDDevice

This means that we know what the Product ID is but not what the Bytes are to get the information via the report. Create an Issue with this text.

To confirm a Product ID, you can open your system information, copy the highlighted text in the screenshot below and Google 0x12d7 to decimal.

macOS of System Information showing the Product ID

Credits

Inspired by https://github.com/atagulalan/arctis-battery-percentage

Original work done by Fabien LOISON