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
William Petit 6e9df8d386 Refactor reach package
- Rename reach package to emlid
- Create generic Reach websocket client
- Add 2 new subpackages 'updater' and 'reachview' to provides specific
API
2018-09-21 16:07:38 +02:00

22 lines
578 B
Go

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
}