changed serial read behavior
This commit is contained in:
parent
b03d7fcfa2
commit
d16dd61863
@ -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() {
|
||||||
|
|||||||
@ -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 {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user