device

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package device provides common interfaces and utilities for virtual USB devices.

Index

Constants

View Source
const (
	ExportMetaKey contextKey = iota
	ConnTimerKey
)

Variables

This section is empty.

Functions

func GetConnTimer

func GetConnTimer(ctx context.Context) *time.Timer

GetConnTimer extracts the connection timer from a device context. Returns nil if the context doesn't contain the timer.

func GetDeviceMeta

func GetDeviceMeta(ctx context.Context) *usbip.ExportMeta

GetDeviceMeta extracts the device metadata from a device context. Returns nil if the context doesn't contain device metadata.

Types

type CreateOptions

type CreateOptions struct {
	IdVendor  *uint16
	IdProduct *uint16
}

type ReportBuilder

type ReportBuilder interface {
	// BuildReport encodes the input state into a byte slice for USB transfer.
	BuildReport() []byte
}

ReportBuilder is an interface for device input states that can build USB reports.

Directories

Path Synopsis
Package keyboard provides a HID keyboard device implementation with full N-key rollover.
Package keyboard provides a HID keyboard device implementation with full N-key rollover.
Package mouse provides a HID mouse device implementation.
Package mouse provides a HID mouse device implementation.
Package xbox360 provides an Xbox 360 controller device implementation.
Package xbox360 provides an Xbox 360 controller device implementation.

Jump to

Keyboard shortcuts

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