mirror of https://bitbucket.org/ausocean/av.git
psi: simplified LocationStrBytes
This commit is contained in:
parent
7c24c79287
commit
239b52ad84
|
@ -105,10 +105,13 @@ func LocationFrom(p []byte) (g string, err error) {
|
|||
|
||||
// LocationStrBytes take a string of location data and converts to a 32 byte slice -
|
||||
// easy update of slice representation of a pmt with location descriptor
|
||||
func LocationStrBytes(l string) (out []byte) {
|
||||
out = make([]byte, locationDataSize)
|
||||
copy(out, []byte(l))
|
||||
return
|
||||
func LocationStrBytes(s string) []byte {
|
||||
if len(s) != locationDataSize {
|
||||
panic("Location string not the right size")
|
||||
}
|
||||
var b [locationDataSize]byte
|
||||
copy(b[:], s)
|
||||
return b[:]
|
||||
}
|
||||
|
||||
// UpdateLocation takes a byte slice representation of a psi-pmt containing a location
|
||||
|
|
Loading…
Reference in New Issue