usb

package
v0.1.85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Overview

Package usb provides utilities for searching for and working with usb based devices.

Index

Constants

This section is empty.

Variables

View Source
var SysPaths = []string{"/sys/bus/usb-serial/devices", "/sys/bus/usb/drivers/cdc_acm"}

SysPaths are where we search for devices. This can be changed for tests.

Functions

This section is empty.

Types

type Description

type Description struct {
	ID   Identifier
	Path string
}

Description describes a specific USB device.

func Search(filter SearchFilter, includeDevice func(vendorID, productID int) bool) []Description

Search uses linux device APIs to find all applicable USB devices.

type Identifier

type Identifier struct {
	Vendor  int
	Product int
}

Identifier identifies a specific USB device by the vendor who produced it and the product that it is. These should be unique across products.

type SearchFilter

type SearchFilter struct{}

SearchFilter does not do anything for linux.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL