vehicle

package
v0.0.0-...-0b3c072 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const OrderByteSize = 2
View Source
const OrderNumByteSize = 1
View Source
const (
	UPDATE_CHAN_BUF_SIZE = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BitarrayParser

type BitarrayParser struct {
	// contains filtered or unexported fields
}

func NewBitarrayParser

func NewBitarrayParser(names map[uint16][]string) BitarrayParser

func (*BitarrayParser) Decode

func (parser *BitarrayParser) Decode(id uint16, data io.Reader) (map[string]bool, error)

func (*BitarrayParser) Encode

func (parser *BitarrayParser) Encode(id uint16, enabled map[string]bool, data io.Writer) error

type Config

type Config struct {
	Boards       []string             `toml:"boards,omitempty"`
	Network      NetworkConfig        `toml:"network"`
	PacketParser packet_parser.Config `toml:"packet_parser"`
	Messages     MessageConfig        `toml:"messages"`
}

type EmptyFrom

type EmptyFrom struct{}

func NewEmptyFrom

func NewEmptyFrom() EmptyFrom

func (EmptyFrom) ReadFrom

func (rf EmptyFrom) ReadFrom(r io.Reader) ([]byte, error)

type MessageConfig

type MessageConfig struct {
	InfoIdKey              string `toml:"info_id_key"`
	WarningIdKey           string `toml:"warning_id_key"`
	FaultIdKey             string `toml:"fault_id_key"`
	BlcuAckId              string `toml:"blcu_ack_id_key"`
	AddStateOrdersIdKey    string `toml:"add_state_orders_id_key"`
	RemoveStateOrdersIdKey string `toml:"remove_state_orders_id_key"`
}

type NetworkConfig

type NetworkConfig struct {
	TcpClientTag string `toml:"tcp_client_tag"`
	TcpServerTag string `toml:"tcp_server_tag"`

	UdpTag            string  `toml:"udp_tag"`
	Mtu               uint    `toml:"mtu"`
	KeepAliveProbes   int     `toml:"keep_alive_probes"`
	Interface         string  `toml:"interface"`
	KeepAliveInterval *string `toml:"keep_alive_interval,omitempty"`
	WriteTimeout      *string `toml:"timeout,omitempty"`
}

func (NetworkConfig) GetKeepAliveInterval

func (networkConfig NetworkConfig) GetKeepAliveInterval() *time.Duration

func (NetworkConfig) GetWriteTimeout

func (networkConfig NetworkConfig) GetWriteTimeout() *time.Duration

type ProtectionFrom

type ProtectionFrom struct{}

func NewProtectionFrom

func NewProtectionFrom() ProtectionFrom

func (ProtectionFrom) ReadFrom

func (rf ProtectionFrom) ReadFrom(r io.Reader) ([]byte, error)

type StateOrderReaderFrom

type StateOrderReaderFrom struct{}

func NewStateOrderReaderFrom

func NewStateOrderReaderFrom() StateOrderReaderFrom

func (StateOrderReaderFrom) ReadFrom

func (rf StateOrderReaderFrom) ReadFrom(r io.Reader) ([]byte, error)

type StateSpaceReaderFrom

type StateSpaceReaderFrom struct {
	// contains filtered or unexported fields
}

func NewStateSpaceReaderFrom

func NewStateSpaceReaderFrom(rows int, cols int, varSize int) StateSpaceReaderFrom

func (StateSpaceReaderFrom) ReadFrom

func (rf StateSpaceReaderFrom) ReadFrom(r io.Reader) ([]byte, error)

type Vehicle

type Vehicle struct {
	// contains filtered or unexported fields
}

func New

func (*Vehicle) Listen

func (vehicle *Vehicle) Listen(updateChan chan<- models.PacketUpdate, transmittedOrderChan chan<- models.PacketUpdate, messageChan chan<- any, blcuAckChan chan<- struct{}, stateOrdersChan chan<- message_parser.StateOrdersAdapter, stateSpaceChan chan<- models.StateSpace)

func (*Vehicle) SendOrder

func (vehicle *Vehicle) SendOrder(order models.Order) error

type VehicleConstructorArgs

type VehicleConstructorArgs struct {
	Boards             []pod_data.Board
	Info               info.Info
	PodData            pod_data.PodData
	Config             Config
	OnConnectionChange func(string, bool)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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