Skip to content

x4rMa/go-serial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Golang serial-port OOP interface. Examples:

import ( "serial" )

//open
p := serial.Serial{}
p.Open( "/dev/ttyUSB0" )
if !p.IsOpened() { os.Exit(0) }

//parameters config
p.SetBaud(9600)
p.SetBits(8)
p.SetStops(2)
p.SetParity("n")

//line control
ri := p.RI()
p.SetRTS(0)
p.SetDTR(1)

//set/get attribute
fmt.Println( "Attributes: ", p.GetKeys() )
p.SetAttrs([]string{"baud","bits","stops","parity"}, []string{"38400","8","2","n"})
fmt.Println( p.GetAttrs( []string{"baud","bits","stops","parity"} ))

//close
p.Close()

About

Go serial port interface library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%