Go-Serial-Detector

module
v1.0.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: Apache-2.0

README

Go-Serial-Detector

This is a package that allows you to list active serial ports:

  • /dev/ttyS*;
  • /dev/ttyUSB*.

In linux systems information is obtained from udev, sysfs or procfs.

OS support

This package currently supports only linux systems.

Usage

import (
  "log"

  "github.com/hedhyw/Go-Serial-Detector/pkg/v1/serialdet"
)

if list, err := serialdet.List(); err == nil {
  for _, p := range list {
    // p.Description():
    //   returns short information about serial port.
    // p.Path():
    //   returns path to device, for example: "/dev/ttyUSB1".
    log.Print(p.Description(), " ", p.Path())
  }
}

How to get

go get github.com/hedhyw/Go-Serial-Detector/pkg/v1/serialdet

Directories

Path Synopsis
pkg
v1/serialdet
Package serialdet provides method for finding active serial ports Package serialdet provides method for finding active serial ports Package serialdet provides method for finding active serial ports
Package serialdet provides method for finding active serial ports Package serialdet provides method for finding active serial ports Package serialdet provides method for finding active serial ports
Package serialdet is deprecated.
Package serialdet is deprecated.

Jump to

Keyboard shortcuts

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