Updated the serial library as the new library does not produce cgo errors and does not need the kernel headers to build

This commit is contained in:
Nicholas Thompson
2019-03-13 16:55:02 +02:00
committed by ncthompson
parent 67fa25495f
commit a29781f025
5 changed files with 13 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ import (
"syscall"
"github.com/diebietse/invertergui/mk2if"
"github.com/mikepb/go-serial"
"github.com/tarm/serial"
)
// Basic CLI to serve as example lib usage
@@ -37,10 +37,8 @@ func main() {
panic(err)
}
} else {
options := serial.RawOptions
options.BitRate = 2400
options.Mode = serial.MODE_READ_WRITE
p, err = options.Open(*dev)
serialConfig := &serial.Config{Name: *dev, Baud: 2400}
p, err = serial.OpenPort(serialConfig)
if err != nil {
panic(err)
}

View File

@@ -40,8 +40,8 @@ import (
"github.com/diebietse/invertergui/frontend"
"github.com/diebietse/invertergui/mk2if"
"github.com/diebietse/invertergui/webgui"
"github.com/mikepb/go-serial"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/tarm/serial"
)
func main() {
@@ -66,10 +66,8 @@ func main() {
panic(err)
}
} else {
options := serial.RawOptions
options.BitRate = 2400
options.Mode = serial.MODE_READ_WRITE
p, err = options.Open(*dev)
serialConfig := &serial.Config{Name: *dev, Baud: 2400}
p, err = serial.OpenPort(serialConfig)
if err != nil {
panic(err)
}