sdk

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: 13 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PixelLength = []byte{0, 4}

	ConfigParams = map[string][]byte{
		"pixel_length": PixelLength,
	}
)

Functions

This section is empty.

Types

type Client

type Client struct {
	Devices *Devices
	// contains filtered or unexported fields
}

func NewClient

func NewClient(opts *comm.NatsClientOpts) (*Client, error)

type Device

type Device struct {
	Meta *DeviceMeta
	// contains filtered or unexported fields
}
func (d *Device) Blink(times int) error

func (*Device) GetName

func (d *Device) GetName(name string) (string, error)

func (*Device) Reset

func (d *Device) Reset(delayMs int) error

func (*Device) SendDeltaDmx

func (d *Device) SendDeltaDmx(data []byte) error

func (*Device) SendDmx

func (d *Device) SendDmx(data []byte) error

func (*Device) SendFx

func (d *Device) SendFx(effect *core.Effect) error

func (*Device) SendRgbPixels

func (d *Device) SendRgbPixels(offset uint16, colors []color.RGBA) error

func (*Device) SendRgbRaw

func (d *Device) SendRgbRaw(data []byte) error

func (*Device) SetConfig

func (d *Device) SetConfig(param string, value byte) error

func (*Device) SetMode

func (d *Device) SetMode(mode *core.Mode) error

func (*Device) SetName

func (d *Device) SetName(name string) error

type DeviceMeta

type DeviceMeta 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"`
}

type DeviceSelection

type DeviceSelection []*Device

func (DeviceSelection) Perform

func (s DeviceSelection) Perform(performer Performer)

type Devices

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

func (*Devices) Device

func (d *Devices) Device(key string) (*Device, error)

func (*Devices) Forget

func (d *Devices) Forget(key string) error

func (*Devices) Keys

func (d *Devices) Keys() ([]string, error)

func (*Devices) List

func (d *Devices) List() ([]*Device, error)

func (*Devices) Select

func (d *Devices) Select(selector string) (DeviceSelection, error)

func (*Devices) Sync

func (d *Devices) Sync() error

type Hardware

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

type Performer

type Performer func(dev *Device)

Jump to

Keyboard shortcuts

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