schwag

package module
v0.0.0-...-cb879c0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2014 License: Apache-2.0 Imports: 7 Imported by: 0

README

CT Display Schwag

This is a driver for an LCD log driver that was given at the May 7th, 2014 Certificate Transparency hack day.

You'll need go v1.1 or higher to compile.

Website

Building

Import into your Go workspace like this:

go get code.google.com/p/certificate-transparency.schwag

To compile it, run the following command from the top of your Go workspace:

go build src/code.google.com/p/certificate-transparency.schwag/main/display.go

Contributing

When sending pull requests, please ensure that everything's been run through gofmt beforehand so we can keep everything nice and tidy.

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

func Colour

func Colour(r uint8, g uint8, b uint8) string

Colour returns a string containing Matrix Orbital compatible control codes to set the color of the LCD backlight.

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.)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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