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 ¶
- Variables
- func DoSerial() error
- func GetSerialPorts() ([]string, error)
- type HTTPReceiver
- type SerialReceiver
- func (p *SerialReceiver) CleanUp()
- func (p *SerialReceiver) ClosePort()
- func (p *SerialReceiver) GetBufferChannel() *chan []byte
- func (p *SerialReceiver) GetTriceChannel() *chan []byte
- func (p *SerialReceiver) SetBaudrate(baudrate int)
- func (p *SerialReceiver) SetDataBits(databits int)
- func (p *SerialReceiver) SetParity(parity serial.Parity)
- func (p *SerialReceiver) SetReadTimeOut(timeout int)
- func (p *SerialReceiver) SetStopBits(stopbits serial.StopBits)
- func (p *SerialReceiver) SetUp() bool
- func (p *SerialReceiver) Start()
- func (p *SerialReceiver) Stop()
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 ¶
Types ¶
type HTTPReceiver ¶
type HTTPReceiver struct {
// contains filtered or unexported fields
}
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) Start ¶
func (self *HTTPReceiver) Start()
Start starts 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) 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) Start ¶
func (p *SerialReceiver) Start()
Start starts receiving of serial data
Click to show internal directories.
Click to hide internal directories.