arnetwork

package
v0.0.0-...-acec0f2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBuffers

func NewBuffers(
	frameSender arnetworkal.FrameSender,
	frameReceiver arnetworkal.FrameReceiver,
	c2dBufCfgs []C2DBufferConfig,
	d2cBufCfgs []D2CBufferConfig,
) (map[uint8]chan<- Frame, map[uint8]<-chan Frame, error)

NewBuffers returns maps of write-only channels for placing frames onto c2d buffers and read-only channels for receiving frames from d2c buffers. All channels are indexed by buffer ID.

Types

type C2DBufferConfig

type C2DBufferConfig struct {
	ID            uint8                 // Buffer ID 0 - 255
	FrameType     arnetworkal.FrameType // Type of data
	Size          int32                 // Size of the internal fifo
	MaxDataSize   int32                 // Maximum size of an element in the fifo
	IsOverwriting bool                  // What to do when data is received and the fifo is full
	AckTimeout    time.Duration         // Time before considering a frame lost
	MaxRetries    int                   // Number of retries before considering a frame lost
}

C2DBufferConfig represents the configuration of a buffer for frames being sent from the client to the device. nolint: lll

type D2CBufferConfig

type D2CBufferConfig struct {
	ID            uint8                 // Buffer ID 0 - 255
	FrameType     arnetworkal.FrameType // Type of data
	Size          int32                 // Size of the internal fifo
	MaxDataSize   int32                 // Maximum size of an element in the fifo
	IsOverwriting bool                  // What to do when data is received and the fifo is full
}

D2CBufferConfig represents the configuration of a buffer for frame sent from the device to the client. nolint: lll

type Frame

type Frame struct {
	Data []byte
	// contains filtered or unexported fields
}

Frame represents a frame to be sent or received over the arnetwork protocol. At this level of abstraction, no details of the underlying network protocols (arnetworkal, UDP/IP, BLE, etc.) bleed through.

Jump to

Keyboard shortcuts

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