hdlc

package
v0.1.8 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HDLC

type HDLC struct {
	TxCharsEscape [256]bool
	RxCharsIgnore [256]bool
	// contains filtered or unexported fields
}

HDLC is a packet framer that implements the HDLC protocol

func NewHDLCFramer

func NewHDLCFramer(port io.ReadWriter, options *framerinterface.FramerOptions) (*HDLC, error)

NewHDLCFramer is used to create a HDLC framer

func (*HDLC) GetStats

func (s *HDLC) GetStats() framerinterface.BaseStats

GetStats returns a safely accessed snapshot of the statistics

func (*HDLC) Run

func (s *HDLC) Run(receivedPacket framerinterface.FramerReceivedPacketHandler) error

Run should be called to start the receiver process. It will only return on read errors (eg, port closed)

func (*HDLC) SendPacket

func (s *HDLC) SendPacket(payload []byte) (int64, error)

SendPacket is used to send a packet to the port using HDLC framing

func (*HDLC) SetPort

func (s *HDLC) SetPort(port io.ReadWriter) error

SetPort can be used to change the port used by the framer. It may not be executed concurrently with Run

Jump to

Keyboard shortcuts

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