diff --git a/devices/geiger/geiger.go b/devices/geiger/geiger.go new file mode 100644 index 0000000000000000000000000000000000000000..7599d56ce942a54296a4a8fbb6aeaecad52b3450 --- /dev/null +++ b/devices/geiger/geiger.go @@ -0,0 +1,34 @@ +// +// geiger.go +// Copyright (C) 2017 kevin <kevin@ie.suberic.net> +// +// Distributed under terms of the GPL license. +// + +package geiger + +// New creates a new Counter instance +func New(c Config) (Counter, error) { + switch c.Model { + case "gqgmc": + return NewGQGMC(c) + } + return nil, nil +} + +// Counter is an interface for Geiger Counters +type Counter interface { + GetReading() (*Reading, error) +} + +// Config contain the configuration for a Geiger Counter +type Config struct { + Model string + Device string + Options map[string]string +} + +// Reading contains a single geiger reading +type Reading struct { + CPM float64 +} diff --git a/devices/geiger/gqgmc.go b/devices/geiger/gqgmc.go new file mode 100644 index 0000000000000000000000000000000000000000..73e4483044eb47681ee8c8116c501b1daa4a3a7a --- /dev/null +++ b/devices/geiger/gqgmc.go @@ -0,0 +1,25 @@ +// +// gqgmc.go +// Copyright (C) 2017 kevin <kevin@phrye.com> +// +// Distributed under terms of the GPL license. +// + +package geiger + +// GQGMCCounter is a GQ GMC Counter +type GQGMCCounter struct { + fh string // TODO: make this a file handle. +} + +// NewGQGMC creates a new GQGMC Counter instance +func NewGQGMC(c Config) (*GQGMCCounter, error) { + return &GQGMCCounter{ + fh: "TODO", + }, nil +} + +// GetReading returns a reading. +func (gc *GQGMCCounter) GetReading() (*Reading, error) { + return nil, nil +}