payload

package
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package payload implements structure to describe and handle container infrastructure and instruments

Index

Constants

View Source
const BaseUDPport = 16000

BaseUDPport port zero in the port range

Variables

View Source
var (
	// BaseIP is the same for everybody in the container:
	BaseIP = [...]byte{192, 168, 232}
)

Functions

This section is empty.

Types

type Class

type Class int

Class classifies a component of the payload

func (Class) String

func (p Class) String() string

type Inst

type Inst struct {
	ID            int         `yaml:"ID"`
	Name          string      `yaml:"Name"`
	Address       net.IP      `yaml:"Address"` // []byte
	UDPcfg        UDPcfg      // determined based on address in cnf file
	Class         Class       // int, defined by func FromYaml
	StateSet      state.State // default state set: Idle
	StateIs       state.State // default state is: undefined
	WarmUpAllowed bool        `yaml:"WU_allowed"` // instrument-specific warm-up state
	OldMessFmt    bool        `yaml:"Old_mess"`   // instrument-specific old message format
}

Inst - a type to represent a component of the container's payload

func NewInst

func NewInst() *Inst

NewInst returns a pointer to a new inst

func (Inst) String

func (i Inst) String() (repr string)

type Payload

type Payload struct {
	Infra []Inst `yaml:"Infrastructure"`
	Sci   []Inst `yaml:"Instruments"`
}

Payload structure holds infrastucture and instruments

func FromYaml

func FromYaml(src string) (*Payload, error)

FromYaml loads payload config from yaml file

type UDPcfg

type UDPcfg struct {
	State     int // the port for state messages. inst receives on this port. master expects answer on this port.
	MeasParms int // the port to where message with measured data goes
}

UDPcfg - a struct holding specific UDP ports of an inst type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL