adcp

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2020 License: Apache-2.0 Imports: 9 Imported by: 1

README

adcp-driver

A driver for communicating with devices over ADCP

Documentation

Index

Constants

View Source
const (
	// CR is a carriage return
	CR = '\r'
	// LF is a line feed
	LF = '\n'
)

Variables

View Source
var (
	// BlankStatus is the command to ask the projector if it is blanked or not
	BlankStatus = []byte("blank ?\r\n")

	// Blank is the command to send to the projector to tell it to blank
	Blank = []byte("blank \"on\"\r\n")

	// Unblank is the command to send to the projector to tell it to unblank
	Unblank = []byte("blank \"off\"\r\n")
)
View Source
var (
	// InputStatus is the command to ask the projector what input it is on
	InputStatus = []byte("input ?\r\n")

	// ActiveSignal is the command to ask the projector if it has an active input signal
	ActiveSignal = []byte("signal ?\r\n")
)
View Source
var (
	// PowerStatus gets the projector's power status
	PowerStatus = []byte("power_status ?\r\n")

	// PowerOn powers on the projector
	PowerOn = []byte("power \"on\"\r\n")

	// PowerStandby powers off the projector
	PowerStandby = []byte("power \"standby\"\r\n")
)

Functions

This section is empty.

Types

type HardwareInfo

type HardwareInfo struct {
	Hostname              string           `json:"hostname,omitempty"`
	ModelName             string           `json:"model_name,omitempty"`
	SerialNumber          string           `json:"serial_number,omitempty"`
	BuildDate             string           `json:"build_date,omitempty"`
	FirmwareVersion       string           `json:"firmware_version,omitempty"`
	ProtocolVersion       string           `json:"protocol_version,omitempty"`
	NetworkInfo           NetworkInfo      `json:"network_information,omitempty"`
	FilterStatus          string           `json:"filter_status,omitempty"`
	WarningStatus         []string         `json:"warning_status,omitempty"`
	ErrorStatus           []string         `json:"error_status,omitempty"`
	PowerStatus           string           `json:"power_status,omitempty"`
	PowerSavingModeStatus string           `json:"power_saving_mode_status,omitempty"`
	TimerInfo             []map[string]int `json:"timer_info,omitempty"`
	Temperature           string           `json:"temperature,omitempty"`
}

HardwareInfo contains the common information for device hardware information

type NetworkInfo

type NetworkInfo struct {
	IPAddress  string   `json:"ip_address,omitempty"`
	MACAddress string   `json:"mac_address,omitempty"`
	Gateway    string   `json:"gateway,omitempty"`
	DNS        []string `json:"dns,omitempty"`
}

NetworkInfo contains the network information for the device

type Projector

type Projector struct {
	Address string
	// contains filtered or unexported fields
}

Projector is the base level object for a projector controlled over ADCP

func (*Projector) GetActiveSignal

func (p *Projector) GetActiveSignal(ctx context.Context, port string) (bool, error)

GetActiveSignal checks to see if the projector has an active input signal and returns the result

func (*Projector) GetBlanked

func (p *Projector) GetBlanked(ctx context.Context) (bool, error)

GetBlanked asks the projector if it is blanked or not and returns the result

func (*Projector) GetInfo

func (p *Projector) GetInfo(ctx context.Context) (interface{}, error)

GetInfo returns the hardware information of the projector

func (*Projector) GetInput

func (p *Projector) GetInput(ctx context.Context) (string, error)

GetInput returns the current input that the projector is set to

func (*Projector) GetMutedByBlock

func (p *Projector) GetMutedByBlock(ctx context.Context, block string) (bool, error)

GetMutedByBlock returns whether the projector is muted or not

func (*Projector) GetPower

func (p *Projector) GetPower(ctx context.Context) (string, error)

GetPower returns the status of the projector

func (*Projector) GetVolumeByBlock

func (p *Projector) GetVolumeByBlock(ctx context.Context, block string) (int, error)

GetVolumeByBlock returns the volume level of the projector

func (*Projector) SendCommand

func (p *Projector) SendCommand(ctx context.Context, addr string, cmd []byte) (string, error)

SendCommand sends the byte array to the desired address of the projector

func (*Projector) SetBlanked

func (p *Projector) SetBlanked(ctx context.Context, blanked bool) error

SetBlanked tells the projector to blank or unblank itself

func (*Projector) SetInput

func (p *Projector) SetInput(ctx context.Context, input string) error

SetInput sets the current input of the projector to the given input

func (*Projector) SetMutedByBlock

func (p *Projector) SetMutedByBlock(ctx context.Context, block string, muted bool) error

SetMutedByBlock sets the muted status of the projector

func (*Projector) SetPower

func (p *Projector) SetPower(ctx context.Context, power string) error

SetPower sets the status of the projector

func (*Projector) SetVolumeByBlock

func (p *Projector) SetVolumeByBlock(ctx context.Context, block string, level int) error

SetVolumeByBlock sets the volume level of the projector

Jump to

Keyboard shortcuts

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