22 lines
578 B
Go
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
|
||
|
}
|