Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDeviceClosed = errors.New("Device is already closed")
Error: Device was already closed and is not ready for interaction anymore
var ErrKeepActiveNotSupported = errors.New("KeepActive is not supported by this device")
Some devices does not support KeepActive.
Functions ¶
func Devices ¶
func Devices() <-chan DeviceInfo
Devices returns a channel with all connected LED devices
func NewLedAnimation ¶
func NewLedAnimation() *ledAnimationFrame
func NewLedSound ¶
func NewLedSound() *ledSound
Types ¶
type Device ¶
type Device interface { // SetColor sets the color of the LED to the closest supported color. SetColor(c color.Color) error // SetKeepActive sets a value that tells the device not turn off the device on calling Close. By default the device is turned off! SetKeepActive(v bool) error // Close the device and release all resources Close() // Check if device is closed IsClosed() bool }
Device is an opened LED device.
type DeviceInfo ¶
type DeviceInfo interface { // GetPath returns a system specific path which can be used to find the device GetPath() string // GetType returns the "driver type" of the device GetType() DeviceType // Open opens the device for usage Open() (Device, error) }
DeviceInfo keeps information about a physical LED device
func ByPath ¶
func ByPath(path string) (DeviceInfo, error)
ByPath searches a device by given system specific path. (The path can be obtained from the GetPath func from DeviceInfo)
type DeviceNG ¶
type DeviceNG interface { // SetAnimation sets an animation for LED if device supports this feature SetAnimation(ani *ledAnimationFrame) error // Turns off device (TODO: maybe move this to "Device") TurnOff() error }
Some "NG" devices have additional features
type DeviceType ¶
type DeviceType int
Device type identifies the device type. the IDs may change on each program start.
var Blink1 DeviceType
Device type: blink(1)
var BlinkM DeviceType
Device type: LinkM / BlinkM
var BlinkStick DeviceType
Device type: BlinkStick
var Blync DeviceType
Device type: Blync
var BusyLightLync DeviceType
Device type: BusyLight Lync
var BusyLightNGUCOmega DeviceType
Device type: BusyLight UC Omega
var BusyLightUC DeviceType
Device type: BusyLight UC
var DealExtreme DeviceType
Device type: DealExtreme USBMailNotifier
var DreamCheeky DeviceType
Device type: DreamCheeky USBMailNotifier
func (DeviceType) String ¶
func (dt DeviceType) String() string
String returns a representation of the device type