receiver

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package receiver is responsible for getting and handling the bytes from the communication port. Currently only serial port is supported. It is activated by the trice package and call emit.Trice() on received bytes chunks.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Port is the COMport name like COM1
	Port string

	// Baud is the configured baudrate of the serial port
	Baud int
)
View Source
var Cipher *xtea.Cipher

Cipher is a pointer to the cryptpo struct filled during initialization

View Source
var Crypto bool

Crypto set to true if a -key other than "none" was given

Functions

func DoSerial added in v0.8.2

func DoSerial() error

DoSerial is the endless loop for trice logging

func GetSerialPorts

func GetSerialPorts() ([]string, error)

GetSerialPorts scans for serial ports

Types

type HTTPReceiver

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

func (*HTTPReceiver) CleanUp

func (self *HTTPReceiver) CleanUp()

CleanUp washes...

func (*HTTPReceiver) GetBufferChannel added in v0.7.0

func (p *HTTPReceiver) GetBufferChannel() *chan []byte

func (*HTTPReceiver) GetTriceChannel added in v0.7.0

func (p *HTTPReceiver) GetTriceChannel() *chan []byte

func (*HTTPReceiver) SetUp

func (self *HTTPReceiver) SetUp() bool

SetUp opens...

func (*HTTPReceiver) Start

func (self *HTTPReceiver) Start()

Start starts receiving of serial data

func (*HTTPReceiver) Stop

func (self *HTTPReceiver) Stop()

Stop stops receiving of serial data

type SerialReceiver

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

func NewSerialReceiver

func NewSerialReceiver(portIdentifier string, baudrate int) *SerialReceiver

NewSerialReceiver

func (*SerialReceiver) CleanUp

func (p *SerialReceiver) CleanUp()

CleanUp makes clean

func (*SerialReceiver) ClosePort

func (p *SerialReceiver) ClosePort()

ClosePort releases port

func (*SerialReceiver) GetBufferChannel added in v0.7.0

func (p *SerialReceiver) GetBufferChannel() *chan []byte

func (*SerialReceiver) GetTriceChannel added in v0.7.0

func (p *SerialReceiver) GetTriceChannel() *chan []byte

func (*SerialReceiver) SetBaudrate

func (p *SerialReceiver) SetBaudrate(baudrate int)

SetBaudrate sets speed

func (*SerialReceiver) SetDataBits

func (p *SerialReceiver) SetDataBits(databits int)

SetDataBits sets bit count

func (*SerialReceiver) SetParity

func (p *SerialReceiver) SetParity(parity serial.Parity)

SetParity sets transmit parity

func (*SerialReceiver) SetReadTimeOut

func (p *SerialReceiver) SetReadTimeOut(timeout int)

SetReadTimeOut sets timeout

func (*SerialReceiver) SetStopBits

func (p *SerialReceiver) SetStopBits(stopbits serial.StopBits)

SetStopBits sets stop condition

func (*SerialReceiver) SetUp

func (p *SerialReceiver) SetUp() bool

SetUp opens a serial port

func (*SerialReceiver) Start

func (p *SerialReceiver) Start()

Start starts receiving of serial data

func (*SerialReceiver) Stop

func (p *SerialReceiver) Stop()

Stop stops receiving of serial data

Jump to

Keyboard shortcuts

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