mirror of https://bitbucket.org/ausocean/av.git
revid: improved naming of encoder globals for location and timestamp
This commit is contained in:
parent
dc6964d41c
commit
f1ee09ad7b
|
@ -148,14 +148,12 @@ func (s *httpSender) send() error {
|
|||
var reply string
|
||||
if send {
|
||||
reply, _, err = s.client.Send(netsender.RequestRecv, pins)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
err = extractMeta(reply, s)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return err
|
||||
return extractMeta(reply, s)
|
||||
}
|
||||
|
||||
func extractMeta(r string, s *httpSender) error {
|
||||
|
@ -169,7 +167,7 @@ func extractMeta(r string, s *httpSender) error {
|
|||
s.log(smartlogger.Warning, pkg+"No timestamp in reply")
|
||||
} else {
|
||||
s.log(smartlogger.Debug, fmt.Sprintf("%v got timestamp: %v", pkg, t))
|
||||
mts.TimeMeta(uint64(t))
|
||||
mts.SetTimeStamp(uint64(t))
|
||||
}
|
||||
|
||||
// Extract gps from reply
|
||||
|
@ -178,7 +176,7 @@ func extractMeta(r string, s *httpSender) error {
|
|||
s.log(smartlogger.Warning, pkg+"No gps in reply")
|
||||
} else {
|
||||
s.log(smartlogger.Debug, fmt.Sprintf("%v got gps: %v", pkg, g))
|
||||
mts.GpsMeta(g)
|
||||
mts.SetLocation(g)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
@ -53,11 +53,11 @@ type MetaData struct {
|
|||
|
||||
var metaData = MetaData{time: 0, gps: ""}
|
||||
|
||||
func TimeMeta(t uint64) {
|
||||
func SetTimeStamp(t uint64) {
|
||||
metaData.time = t
|
||||
}
|
||||
|
||||
func GpsMeta(g string) {
|
||||
func SetLocation(g string) {
|
||||
metaData.gps = g
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue