Documentation ¶
Overview ¶
Package serenum implements enumeration of a system's serial ports.
Index ¶
Constants ¶
View Source
const StdFormat = `` /* 358-byte string literal not displayed */
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PortInfo ¶
type PortInfo struct { Desc string Device string Driver string VendorID string ProductID string Manufacturer string SerialNumber string Enumerator string }
func Lookup ¶
Lookup returns information about the named serial port. On failure, a PortInfo with just the Device field set to portName will be returned.
func Ports ¶
func Ports() (ports []*PortInfo)
Ports gathers information about the serial ports present on a system, by examining information from sysfs, especially from /sys/class/tty. Devices that have no driver entry are skipped, as well as devices that symlink into /sys/devices/platform. If a device is an USB device, additional information like VID, PID will be extracted. The resulting list containing one item for each serial port is sorted in the following order:
- PL2303 devices
- USB devices
- ACM devices
- other devices
Click to show internal directories.
Click to hide internal directories.