kopia lustrzana https://github.com/cyoung/stratux
Merge branch 'master' of https://github.com/cyoung/stratux
commit
a6517c3623
|
@ -133,8 +133,7 @@ func heartBeatSender() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func parseInput(buf string) ([]byte, uint16) {
|
func parseInput(buf string) ([]byte, uint16) {
|
||||||
buf = strings.Trim(buf, "\r\n") // Remove newlines.
|
x := strings.Split(buf, ";") // Discard everything after the first ';'.
|
||||||
x := strings.Split(buf, ";") // We want to discard everything before the first ';'.
|
|
||||||
if len(x) == 0 {
|
if len(x) == 0 {
|
||||||
return nil, 0
|
return nil, 0
|
||||||
}
|
}
|
||||||
|
@ -145,7 +144,7 @@ func parseInput(buf string) ([]byte, uint16) {
|
||||||
msgtype := uint16(0)
|
msgtype := uint16(0)
|
||||||
|
|
||||||
s = s[1:]
|
s = s[1:]
|
||||||
msglen := len(s)/2
|
msglen := len(s) / 2
|
||||||
|
|
||||||
if len(s)%2 != 0 { // Bad format.
|
if len(s)%2 != 0 { // Bad format.
|
||||||
return nil, 0
|
return nil, 0
|
||||||
|
|
Ładowanie…
Reference in New Issue