2018-09-21 12:31:52 +02:00
|
|
|
package reachview
|
2018-09-20 17:28:18 +02:00
|
|
|
|
|
|
|
const (
|
|
|
|
eventGetConfiguration = "get configuration"
|
|
|
|
eventCurrentConfiguration = "current configuration"
|
|
|
|
)
|
|
|
|
|
|
|
|
// Configuration is a configuration
|
|
|
|
type Configuration struct {
|
|
|
|
RTKSettings *RTKSettings `mapstructure:"rtk settings,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// RTKSettings -
|
|
|
|
type RTKSettings struct {
|
|
|
|
GLONASSARMode string `mapstructure:"glonass ar mode"`
|
|
|
|
UpdateRate string `mapstructure:"update rate"`
|
|
|
|
ElevationMaskAngle string `mapstructure:"elevation mask angle"`
|
|
|
|
MaxHorizontalAcceleration string `mapstructure:"max horizontal acceleration"`
|
|
|
|
SNRMask string `mapstructure:"snr mask"`
|
|
|
|
GPSARMode string `mapstructure:"gps ar mode"`
|
|
|
|
PositionningMode string `mapstructure:"positioning mode"`
|
|
|
|
PositioningSystems *PositionningSystems `mapstructure:"positioning systems,omitempty"`
|
|
|
|
MaxVerticalAcceleration string `mapstructure:"max vertical acceleration"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// PositionningSystems -
|
|
|
|
type PositionningSystems struct {
|
|
|
|
GLONASS bool `json:"glonass"`
|
|
|
|
SBAS bool `json:"sbas"`
|
|
|
|
QZS bool `json:"qzs"`
|
|
|
|
QZSS bool `json:"qzss"`
|
|
|
|
Compass bool `json:"compass"`
|
|
|
|
Galileo bool `json:"galileo"`
|
|
|
|
GPS bool `json:"gps"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// Configuration fetches and return the current configuration of the ReachRS module
|
2018-09-21 12:31:52 +02:00
|
|
|
func (r *Client) Configuration() (*Configuration, error) {
|
2018-09-20 17:28:18 +02:00
|
|
|
configuration := &Configuration{}
|
2018-09-21 12:31:52 +02:00
|
|
|
if err := r.ReqResp(eventGetConfiguration, nil, eventCurrentConfiguration, configuration); err != nil {
|
2018-09-20 17:28:18 +02:00
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return configuration, nil
|
|
|
|
}
|