Documentation
¶
Overview ¶
This package contains a driver for an LCD display which shows info about a CT log.
This package can be used to drive any serially connected LCD which is compatible with the Matrix Orbital command set, although currently the code assumes an 16x2 LCD.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DisplayConfig ¶
type DisplayConfig struct {
// Info to be displayed is fetched using |Client|
Client *client.LogClient
// Log name to be displayed on the LCD
Name string
// Path to the serial port connected to the LCD
Port string
// Baud rate to use to talk to the LCD device
Baud int
// When the current STH is less than |FreshAge| seconds old, the display is
// green, above this age it starts fading towards red.
FreshAge int
// When the current STH is older than |StaleAge| the display colour is set
// to red.
StaleAge int
// Fetch a new STH from the log once every |FetchSecs| seconds
FetchSecs int
}
type LCDDisplay ¶
type LCDDisplay struct {
// contains filtered or unexported fields
}
LCDDisplay is a driver for Matrix Orbital compatible serially connected LCD panels.
func NewLCDDisplay ¶
func NewLCDDisplay(conf DisplayConfig) (*LCDDisplay, error)
NewLCDDisplay creates a new LCD Display driver instance. The LCDDisplay is configured with the data in |conf|. Returns a new LCDDisplay instance or an error.
func (*LCDDisplay) Run ¶
func (l *LCDDisplay) Run()
Run will start periodically fetching STHs from the configured log in the background, and block while it continues to refresh the LCD contents. There's currently no way to cause Run() to exit (other than killing the program.)