Documentation ¶
Overview ¶
Package cryocon provides utilities for working with temperature sensors Supports model 12, 14, 18i and maybe more
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HTTPWrapper ¶
type HTTPWrapper struct { // Sensor is the underlying sensor that is wrapped TemperatureMonitor // RouteTable maps goji patterns to http handlers RouteTable generichttp.RouteTable }
HTTPWrapper provides HTTP bindings on top of the underlying Go interface BindRoutes must be called on it
func NewHTTPWrapper ¶
func NewHTTPWrapper(m TemperatureMonitor) HTTPWrapper
NewHTTPWrapper returns a new HTTP wrapper with the route table pre-configured
func (HTTPWrapper) RT ¶
func (h HTTPWrapper) RT() generichttp.RouteTable
RT satisfies the HTTPer interface
func (*HTTPWrapper) ReadAll ¶
func (h *HTTPWrapper) ReadAll(w http.ResponseWriter, r *http.Request)
ReadAll reads all the channels and returns them as an array of f64 over JSON. Units of Celcius. NaN (no probe) encoded as -274.
func (*HTTPWrapper) ReadChan ¶
func (h *HTTPWrapper) ReadChan(w http.ResponseWriter, r *http.Request)
ReadChan reads a single channel A~G (or so, may expand with future hardware) plucked from the URL and returns the value in Celcius as JSON
func (*HTTPWrapper) Version ¶
func (h *HTTPWrapper) Version(w http.ResponseWriter, r *http.Request)
Version reads the version and sends it back as json
type TemperatureMonitor ¶
type TemperatureMonitor struct {
// contains filtered or unexported fields
}
TemperatureMonitor models a Model 12 or Model 14 temperature monitor
func NewTemperatureMonitor ¶
func NewTemperatureMonitor(addr string) *TemperatureMonitor
NewTemperatureMonitor creates a new temperature monitor instance
func (*TemperatureMonitor) Identification ¶
func (tm *TemperatureMonitor) Identification() (string, error)
Identification returns the identifying information from the monitor. it looks something like:
Cryocon Model 12/14 Rev <firmware rev code><hardware rev code>
func (*TemperatureMonitor) ReadAllChannels ¶
func (tm *TemperatureMonitor) ReadAllChannels() ([]float64, error)
ReadAllChannels reads all of the temperature channels of the sensor in C. any unpopulated channels are NaN.
func (*TemperatureMonitor) ReadChannelLetter ¶
func (tm *TemperatureMonitor) ReadChannelLetter(ch string) (float64, error)
ReadChannelLetter reads the temperature on a given channel in C, where the channel is something like "A"