Documentation
¶
Index ¶
Constants ¶
View Source
const BaudRateMin = 100
Variables ¶
View Source
var ErrBaudRateMin = errors.New("baudRate too small")
View Source
var ErrListSerialUnsupportedPlatform = errors.New("unsupported platform")
View Source
var ParamLoadSerialMap = map[string]ParamLoadSerialObj{ "linux": { CMD: "sh", Args: []string{"-c", "ls /dev/tty* | grep -E 'ttyUSB.*|ttyACM.*'"}, }, "windows": { CMD: "powershell", Args: []string{"Get-ItemProperty HKLM:\\HARDWARE\\DEVICEMAP\\SERIALCOMM | Select-Object -Property * -ExcludeProperty PSPath, PSParentPath, PSChildName, PSDrive, PSProvider | ForEach-Object { $_.PSObject.Properties.Value }"}, }, "darwin": { CMD: "sh", Args: []string{"-c", "ls /dev/tty.*"}, }, }
Functions ¶
func ListSerial ¶
Types ¶
type BaudRateObj ¶
type BaudRateObj struct {
// contains filtered or unexported fields
}
func (*BaudRateObj) Get ¶
func (obj *BaudRateObj) Get() int
func (*BaudRateObj) Set ¶
func (obj *BaudRateObj) Set(newBaudRate int) error
type ParamLoadSerialObj ¶
type ReadTimeoutObj ¶
type ReadTimeoutObj struct {
// contains filtered or unexported fields
}
func (*ReadTimeoutObj) Get ¶
func (obj *ReadTimeoutObj) Get() time.Duration
type SerialObj ¶
type SerialObj struct { Timeout ReadTimeoutObj BaudRate BaudRateObj // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.