changed serial read behavior

This commit is contained in:
Timo Volkmann 2020-12-10 13:20:20 +01:00
parent b03d7fcfa2
commit d16dd61863
2 changed files with 4 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import (
const ( const (
TCP_PORT = ":3010" TCP_PORT = ":3010"
HTTP_PORT = ":3011" HTTP_PORT = ":3011"
SERIAL_PORT = "COM4" SERIAL_PORT = "/dev/tty.usbmodem14201"
) )
func main() { func main() {

View File

@ -75,6 +75,7 @@ func SerialCollector(proc Processor, serialPort string) {
if err != nil { if err != nil {
log.Fatalln(err.Error()) log.Fatalln(err.Error())
} }
defer port.Close()
decoder := ublox.NewDecoder(port) decoder := ublox.NewDecoder(port)
@ -84,8 +85,8 @@ func SerialCollector(proc Processor, serialPort string) {
if err.Error() == "NMEA not implemented" { if err.Error() == "NMEA not implemented" {
continue continue
} }
log.Println(err) log.Println("serial read err:", err)
continue break
} }
sd, err := ConvertUbxToSensorData(meas) sd, err := ConvertUbxToSensorData(meas)
if err != nil { if err != nil {