This repository has been archived on 2024-08-02. You can view files and clone it, but cannot push or open issues or pull requests.
orion/emlid/updater/time_sync.go

22 lines
578 B
Go
Raw Normal View History

package updater
const (
eventGetTimeSyncStatus = "get time sync status"
eventTimeSyncResults = "time sync status"
)
type timeSyncStatus struct {
Status bool `json:"status"`
}
// TimeSynced returns the ReachRS module time synchronization status.
// A true response means that the module has synchronized its clock.
func (c *Client) TimeSynced() (bool, error) {
res := &timeSyncStatus{}
if err := c.ReqResp(eventGetTimeSyncStatus, nil, eventTimeSyncResults, res); err != nil {
return false, err
}
c.Logf("time sync result: %v", res.Status)
return res.Status, nil
}