Back to godoc.org
github.com/RoboCup-SSL/ssl-go-tools/pkg/persistence

package persistence

v1.0.0
Latest Go to latest
Published: Oct 28, 2019 | License: GPL3 | Module: github.com/RoboCup-SSL/ssl-go-tools

Index

func ParseMessage

func ParseMessage(data []byte, message proto.Message) error

type Broadcaster

type Broadcaster struct {
	Slots []*Slot

	SkipNonRunningStages bool
	// contains filtered or unexported fields
}

func NewBroadcaster

func NewBroadcaster() Broadcaster

func (*Broadcaster) AddSlot

func (b *Broadcaster) AddSlot(messageType MessageType, address string)

func (*Broadcaster) Start

func (b *Broadcaster) Start(filename string) error

func (*Broadcaster) Stop

func (b *Broadcaster) Stop()

type Message

type Message struct {
	Timestamp   int64 // Receiver timestamp in ns
	MessageType MessageType
	Message     []byte
}

func (*Message) ParseReferee

func (m *Message) ParseReferee() (*sslproto.Referee, error)

func (*Message) ParseVisionWrapper

func (m *Message) ParseVisionWrapper() (*sslproto.SSL_WrapperPacket, error)

type MessageId

type MessageId int
const (
	MessageBlank         MessageId = 0 //(ignore message)
	MessageUnknown       MessageId = 1 //(try to guess message type by parsing the data)
	MessageSslVision2010 MessageId = 2
	MessageSslRefbox2013 MessageId = 3
	MessageSslVision2014 MessageId = 4
)

type MessageType

type MessageType struct {
	Id   MessageId
	Name string
}

type Reader

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

func NewReader

func NewReader(filename string) (logReader *Reader, err error)

func (*Reader) Close

func (l *Reader) Close() error

func (*Reader) CreateChannel

func (l *Reader) CreateChannel() (channel chan *Message)

func (*Reader) HasMessage

func (l *Reader) HasMessage() bool

func (*Reader) ReadMessage

func (l *Reader) ReadMessage() (msg *Message, err error)

func (*Reader) SkipMessage

func (l *Reader) SkipMessage() (bytesRead int, err error)

type Recorder

type Recorder struct {
	Slots []*Slot
	// contains filtered or unexported fields
}

func NewRecorder

func NewRecorder() Recorder

func (*Recorder) AddSlot

func (r *Recorder) AddSlot(messageType MessageType, address string)

func (*Recorder) RegisterToInterrupt

func (r *Recorder) RegisterToInterrupt()

func (*Recorder) Start

func (r *Recorder) Start() error

func (*Recorder) Stop

func (r *Recorder) Stop() error

type Slot

type Slot struct {
	ReceivedMessages int
	MessageType      MessageType
	// contains filtered or unexported fields
}

type Writer

type Writer struct {
	Open bool
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(filename string) (logWriter *Writer, err error)

func (*Writer) Close

func (l *Writer) Close() error

func (*Writer) Write

func (l *Writer) Write(msg *Message) (err error)
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier