sfinder

package module
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: MIT Imports: 4 Imported by: 1

README

serial-finder

查找特定的USB串口

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Finder

type Finder interface {
	Find() (ports []Uart, err error)
	Monitor(config MonitorConfig)
	Remove(name string)
}

func New

func New(vendorName SerialType) Finder

type MonitorConfig

type MonitorConfig struct {
	Ctx   context.Context
	Delay time.Duration
	Build func(name string) (interface{}, error)
}

type SerialType

type SerialType string
const (
	CH34x SerialType = "ch34x"
	FT2x  SerialType = "ft23x"
	CP2x  SerialType = "cp21x"
	PL23X SerialType = "pl23x"
)

type Uart

type Uart struct {
	Name         string
	SerialNumber string
	Vendor       string
	Product      string
}

Jump to

Keyboard shortcuts

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