protoudp

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Overview

Package protoudp implements the UDPROS protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Conn added in v1.1.0

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

Conn is a UDPROS connection.

func NewConn added in v1.1.0

func NewConn(pc net.PacketConn) *Conn

NewConn allocates a Conn.

func (*Conn) ReadFrame added in v1.1.0

func (s *Conn) ReadFrame() (*Frame, *net.UDPAddr, error)

ReadFrame reads a frame.

func (*Conn) WriteFrame added in v1.1.0

func (s *Conn) WriteFrame(f *Frame, dest *net.UDPAddr) error

WriteFrame writes a frame.

func (*Conn) WriteMessage added in v1.1.0

func (s *Conn) WriteMessage(pubID int, messageID uint8, msg interface{}, dest *net.UDPAddr) error

WriteMessage writes a message.

type Frame

type Frame struct {
	ConnectionID uint32
	Opcode       Opcode
	MessageID    uint8
	BlockID      uint16
	Payload      []byte
}

Frame is a UDPROS frame.

type HeaderPublisher

type HeaderPublisher struct {
	Callerid          string
	Topic             string
	Type              string
	Md5sum            string
	MessageDefinition string
}

HeaderPublisher is a publisher header.

type HeaderSubscriber

type HeaderSubscriber struct {
	Callerid          string
	Topic             string
	Type              string
	Md5sum            string
	MessageDefinition string
}

HeaderSubscriber is a subscriber header.

type Opcode

type Opcode uint8

Opcode is the opcode of a Frame.

const (
	Data0 Opcode = 0
	DataN Opcode = 1
	Ping  Opcode = 2
	Error Opcode = 3
)

Standard opcodes.

Jump to

Keyboard shortcuts

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