mirror of https://bitbucket.org/ausocean/av.git
psi: trimming excess bytes in gps data from pmt
This commit is contained in:
parent
798add533b
commit
dc6964d41c
|
@ -28,6 +28,7 @@ LICENSE
|
||||||
package psi
|
package psi
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"bytes"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"errors"
|
"errors"
|
||||||
"hash/crc32"
|
"hash/crc32"
|
||||||
|
@ -101,6 +102,7 @@ func GpsOf(p []byte) (g string, err error) {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
gBytes := p[gpsDataIndx : gpsDataIndx+gpsDataSize]
|
gBytes := p[gpsDataIndx : gpsDataIndx+gpsDataSize]
|
||||||
|
gBytes = bytes.Trim(gBytes, "\x00")
|
||||||
g = string(gBytes)
|
g = string(gBytes)
|
||||||
return g, nil
|
return g, nil
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue