Documentation ¶
Index ¶
- Constants
- Variables
- func ToBuffer(f *ini.File) (*bytes.Buffer, error)
- type API
- func (a *API) ClearDevice() error
- func (a *API) FetchChannelProbe(channel Channel) (*Probe, error)
- func (a *API) FetchChannelTarget(channel Channel, probe Probe) (string, error)
- func (a *API) FetchCsv(channel Channel, allData bool) ([][]string, error)
- func (a *API) FetchInstrumentStatus() (*InstrumentStatus, error)
- func (a *API) FetchProblemReport(dir string) (string, error)
- func (a *API) FetchSettings() (*ini.File, error)
- func (a *API) FetchStatus() (*Status, error)
- func (a *API) FetchUsedChannels() ([]Channel, error)
- func (a *API) FetchVersion() (*Version, error)
- func (a *API) GnssStatus() (*GNSS, error)
- func (a *API) PowerSupplyStatus() (*PowerSupplyStatus, error)
- func (a *API) PushCert(cert []byte) (*Result, error)
- func (a *API) PushLicense(path string) (*Result, error)
- func (a *API) PushSettings(f *ini.File) error
- func (a *API) PushVersion(path string) (*Result, error)
- func (a *API) Reboot() error
- func (a *API) StartMeasure() error
- func (a *API) StopMeasure() error
- type Channel
- type ChannelStatus
- type Channels
- type GNSS
- type InstrumentStatus
- type ModuleStatus
- type PowerSupply
- type PowerSupplyStatus
- type Probe
- type Result
- type Status
- type Version
Constants ¶
const ( ON = "On" OFF = "Off" YES = "Yes" NO = "No" ENABLED = "Enabled" DISABLED = "Disabled" STATIC = "Static" DHCP = "DHCP" TE = "te" TWOWAYTE = "2wayte" RSFEC = "RS-FEC" INTERVAL = "1 packet/16 s" CHANNEL1 = "Channel 1" IPV6 = "UDP/IPv6" INTERNAL = "Internal" SPTP = "SPTP_V2.1" )
Calnex Status constants
Variables ¶
var ( // ErrBadChannel is returned when channel is not recognized ErrBadChannel = errors.New("channel is not recognized") )
var MeasureChannelDatatypeMap = map[Channel]string{ ChannelA: TE, ChannelB: TE, ChannelC: TE, ChannelD: TE, ChannelE: TE, ChannelF: TE, ChannelVP1: TWOWAYTE, ChannelVP2: TWOWAYTE, ChannelVP3: TWOWAYTE, ChannelVP4: TWOWAYTE, ChannelVP5: TWOWAYTE, ChannelVP6: TWOWAYTE, ChannelVP7: TWOWAYTE, ChannelVP8: TWOWAYTE, ChannelVP9: TWOWAYTE, ChannelVP10: TWOWAYTE, ChannelVP11: TWOWAYTE, ChannelVP12: TWOWAYTE, ChannelVP13: TWOWAYTE, ChannelVP14: TWOWAYTE, ChannelVP15: TWOWAYTE, ChannelVP16: TWOWAYTE, ChannelVP17: TWOWAYTE, ChannelVP18: TWOWAYTE, ChannelVP19: TWOWAYTE, ChannelVP20: TWOWAYTE, ChannelVP21: TWOWAYTE, ChannelVP22: TWOWAYTE, ChannelVP23: TWOWAYTE, ChannelVP24: TWOWAYTE, ChannelVP25: TWOWAYTE, ChannelVP26: TWOWAYTE, ChannelVP27: TWOWAYTE, ChannelVP28: TWOWAYTE, ChannelVP29: TWOWAYTE, ChannelVP30: TWOWAYTE, ChannelVP31: TWOWAYTE, ChannelVP32: TWOWAYTE, }
MeasureChannelDatatypeMap is a Map of the measurement channels to the data type. Only channels used for measurements defined here
Functions ¶
Types ¶
type API ¶
API is struct for accessing calnex API
func (*API) FetchChannelProbe ¶
FetchChannelProbe returns monitored protocol of the channel
func (*API) FetchChannelTarget ¶
FetchChannelTarget returns the measure target of the server monitored on the channel
func (*API) FetchCsv ¶
FetchCsv takes channel name (like 1, 2, c, d) it returns list of CSV lines which is []string
func (*API) FetchInstrumentStatus ¶
func (a *API) FetchInstrumentStatus() (*InstrumentStatus, error)
FetchInstrumentStatus returns the calnex instrument status
func (*API) FetchProblemReport ¶
FetchProblemReport saves a problem report
func (*API) FetchSettings ¶
FetchSettings returns the calnex settings
func (*API) FetchStatus ¶
FetchStatus returns the calnex status
func (*API) FetchUsedChannels ¶
FetchUsedChannels returns list of channels in use
func (*API) FetchVersion ¶
FetchVersion returns current Firmware Version
func (*API) GnssStatus ¶
GnssStatus returns current GNSS status
func (*API) PowerSupplyStatus ¶
func (a *API) PowerSupplyStatus() (*PowerSupplyStatus, error)
PowerSupplyStatus returns current PSU status
func (*API) PushLicense ¶
PushLicense uploads a new license to the device
func (*API) PushSettings ¶
PushSettings pushes the calnex settings
func (*API) PushVersion ¶
PushVersion uploads a new Firmware Version to the device
type Channel ¶
type Channel string
Channel is a Calnex channel object
const ( ChannelA Channel = "A" ChannelB Channel = "B" ChannelC Channel = "C" ChannelD Channel = "D" ChannelE Channel = "E" ChannelF Channel = "F" ChannelONE Channel = "1" ChannelTWO Channel = "2" ChannelREF Channel = "REF" ChannelVP1 Channel = "VP1" ChannelVP2 Channel = "VP2" ChannelVP3 Channel = "VP3" ChannelVP4 Channel = "VP4" ChannelVP5 Channel = "VP5" ChannelVP6 Channel = "VP6" ChannelVP7 Channel = "VP7" ChannelVP8 Channel = "VP8" ChannelVP9 Channel = "VP9" ChannelVP10 Channel = "VP10" ChannelVP11 Channel = "VP11" ChannelVP12 Channel = "VP12" ChannelVP13 Channel = "VP13" ChannelVP14 Channel = "VP14" ChannelVP15 Channel = "VP15" ChannelVP16 Channel = "VP16" ChannelVP17 Channel = "VP17" ChannelVP18 Channel = "VP18" ChannelVP19 Channel = "VP19" ChannelVP20 Channel = "VP20" ChannelVP21 Channel = "VP21" ChannelVP22 Channel = "VP22" ChannelVP23 Channel = "VP23" ChannelVP24 Channel = "VP24" ChannelVP25 Channel = "VP25" ChannelVP26 Channel = "VP26" ChannelVP27 Channel = "VP27" ChannelVP28 Channel = "VP28" ChannelVP29 Channel = "VP29" ChannelVP30 Channel = "VP30" ChannelVP31 Channel = "VP31" ChannelVP32 Channel = "VP32" )
Available Calnex channels
func ChannelFromInt ¶
ChannelFromInt returns channel from int
func ChannelFromString ¶
ChannelFromString returns channel from string
func (*Channel) UnmarshalText ¶
UnmarshalText channel from string version
type ChannelStatus ¶
ChannelStatus is a struct representing Calnex channel instrument status
type GNSS ¶
type GNSS struct { AntennaStatus string Locked bool LockedSatellites int SurveyComplete bool SurveyPercentComplete int }
GNSS is a struct representing Calnex GNSS JSON response
type InstrumentStatus ¶
type InstrumentStatus struct { Channels map[Channel]ChannelStatus Modules map[Channel]ModuleStatus }
InstrumentStatus is a struct representing Calnex instrument status JSON response
type ModuleStatus ¶
ModuleStatus is a struct representing Calnex channel module status
type PowerSupply ¶
type PowerSupply struct { CommsGood bool `json:"comms_good"` Name string StatusGood bool `json:"status_good"` }
PowerSupply is a struct representing a single power supply unit
type PowerSupplyStatus ¶
type PowerSupplyStatus struct { PowerSupplyGood bool `json:"power_supply_good"` Supplies []PowerSupply }
PowerSupplyStatus is a struct representing Calnex Power Supply JSON response
type Probe ¶
type Probe string
Probe is a Calnex probe protocol
Probe numbers by calnex
func ProbeFromCalnex ¶
ProbeFromCalnex returns Channel object from String version
func ProbeFromString ¶
ProbeFromString returns Channel object from String version
func (Probe) CalnexName ¶
CalnexName returns Calnex Name like "PTP slave" or "NTP client"
func (Probe) ServerType ¶
ServerType returns server type like "server_ip" or "master_ip"
func (*Probe) UnmarshalText ¶
UnmarshalText probe from string version