devices

package
v0.0.0-...-211c12f Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2022 License: Apache-2.0 Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const (
	MacVarName     = "mac_string"
	NameVarName    = "NAME"
	IpVarName      = "IP"
	HwTypeVarName  = "HWTYPE"
	HwRevVarName   = "HWREV"
	ExtModeVarName = "EXTMODE"
	ModeVarName    = "MODE"
	VersionVarName = "VERSION"

	PixelLengthVar       = "pixel_length"
	FxVar                = "fx"
	FxSpeedVar           = "fx_speed"
	FxXfadeVar           = "fx_xfade"
	FxForegroundRedVar   = "fx_fgnd_r"
	FxForegroundGreenVar = "fx_fgnd_g"
	FxForegroundBlueVar  = "fx_fgnd_b"
	FxBackgroundRedVar   = "fx_bgnd_r"
	FxBackgroundGreenVar = "fx_bgnd_g"
	FxBackgroundBlueVar  = "fx_bgnd_b"
)

Variables

This section is empty.

Functions

func RegisterEndpoints

func RegisterEndpoints(e *echo.Group, service *Service)

Types

type Device

type Device struct {
	MAC          string         `json:"mac"`
	Name         string         `json:"name"`
	IP           string         `json:"ip"`
	Hardware     Hardware       `json:"hardware"`
	Mode         int            `json:"mode"`
	ExternalMode int            `json:"external_mode"`
	LastBeat     time.Time      `json:"last_beat"`
	Version      int            `json:"version"`
	Config       map[string]int `json:"config"`
}

func ParseDevice

func ParseDevice(m *nats.Msg) (*Device, error)

type Hardware

type Hardware struct {
	Kind    string `json:"kind"`
	Version string `json:"revision"`
}

type Logic

type Logic struct {
	// contains filtered or unexported fields
}

func (*Logic) Connect

func (l *Logic) Connect(client *comm.NatsClient) error

type Module

type Module struct {
	Service *Service
	Logic   *Logic
	// contains filtered or unexported fields
}

func NewModule

func NewModule(client *comm.NatsClient, e *echo.Group) (*Module, error)

func (*Module) Start

func (m *Module) Start() error

type Reader

type Reader struct {
	// contains filtered or unexported fields
}

func (*Reader) Get

func (r *Reader) Get(key string) (*Device, error)

func (*Reader) Keys

func (r *Reader) Keys() ([]string, error)

func (*Reader) List

func (r *Reader) List() ([]Device, error)

type Service

type Service struct {
	// contains filtered or unexported fields
}
func (c *Service) Blink(mac string, times int) error

func (*Service) GetDevice

func (c *Service) GetDevice(mac string) (*Device, error)

func (*Service) Keys

func (c *Service) Keys() ([]string, error)

func (*Service) ListDevices

func (c *Service) ListDevices() ([]Device, error)

func (*Service) Ping

func (c *Service) Ping() error

func (*Service) Reset

func (c *Service) Reset(mac string, delayMs int) error

func (*Service) SendDeltaDmx

func (c *Service) SendDeltaDmx(mac string, data []byte) error

func (*Service) SendDmx

func (c *Service) SendDmx(mac string, data []byte) error

func (*Service) SendFx

func (c *Service) SendFx(mac string, effect *core.Effect) error

func (*Service) SendRgb

func (c *Service) SendRgb(mac string, data []byte) error

func (*Service) SetMode

func (c *Service) SetMode(mac string, mode *core.Mode) error

type Writer

type Writer struct {
	// contains filtered or unexported fields
}

func (*Writer) Register

func (w *Writer) Register(dev *Device) error

Jump to

Keyboard shortcuts

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