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/receiver_upgrade.go

22 lines
733 B
Go

package updater
const (
eventIsReceiverUpgradeAvailable = "is receiver upgrade available"
eventReceiverUpgradeAvailable = "receiver upgrade available"
)
type receiverUpgreAvailable struct {
Available bool `json:"available"`
Running bool `json:"running"`
}
// ReceiverUpgradeAvailable checks if an upgrade is avaialable/running for the ReachRS module
func (c *Client) ReceiverUpgradeAvailable() (bool, bool, error) {
res := &receiverUpgreAvailable{}
if err := c.ReqResp(eventIsReceiverUpgradeAvailable, nil, eventReceiverUpgradeAvailable, res); err != nil {
return false, false, err
}
c.Logf("receiver upgrade result: available: %v, running: %v", res.Available, res.Running)
return res.Available, res.Running, nil
}