slip

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Implements Serial Line IP as specified in RFC 1055. Comments in quotes are from the RFC. See: https://datatracker.ietf.org/doc/html/rfc1055

Index

Constants

View Source
const (
	END     = 0300 // 0xC0, "indicates end of packet"
	ESC     = 0333 // 0xDB, "indicates byte stuffing"
	ESC_END = 0334 // 0xDC, "ESC ESC_END means END data byte"
	ESC_ESC = 0335 // 0xDD, "ESC ESC_ESC means ESC data byte"
)

Variables

This section is empty.

Functions

func ReadPacket

func ReadPacket(reader io.Reader) ([]byte, error)

ReadPacket reads a full packet from reader.

On error, any partially read packet data is dropped.

@Note: This calls reader.Read() for each byte. If this is not desired, the reader can be wrapped using bufio.NewReader().

func WritePacket

func WritePacket(writer io.Writer, packet []byte) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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