kramer

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	BuildDate       = "BUILD-DATE"
	Model           = "MODEL"
	SerialNumber    = "SN"
	FirmwareVersion = "VERSION"
	ProtocolVersion = "PROT-VER"
	Temperature     = "HW-TEMP"
	PowerSave       = "POWER-SAVE"
	IPAddress       = "NET-IP"
	Gateway         = "NET-GATE"
	MACAddress      = "NET-MAC"
	NetDNS          = "NET-DNS"
	Signal          = "SIGNAL"
)
View Source
const (
	CARRIAGE_RETURN           = 0x0D
	LINE_FEED                 = 0x0A
	SPACE                     = 0x20
	DELAY_BETWEEN_CONNECTIONS = time.Second * 10
)

Variables

This section is empty.

Functions

func LessThanZero

func LessThanZero(numString string) bool

Returns if a given number (in a string) is less than zero.

func SendCommand

func SendCommand(conn *net.TCPConn, address, command string) (resp string, err error)

Takes a command and sends it to the address, and returns the devices response to that command

func ToIndexOne

func ToIndexOne(numString string) (string, error)

This function converts a number (in a string) to index-based 1.

func ToIndexZero

func ToIndexZero(numString string) (string, error)

This function converts a number (in a string) to index-base 0.

Types

type CommandInfo

type CommandInfo struct {
	ResponseChannel chan Response
	Address         string
	Command         string
	ReadWelcome     bool
}

type Logger

type Logger interface {
	Debugf(format string, a ...interface{})
	Infof(format string, a ...interface{})
	Warnf(format string, a ...interface{})
	Errorf(format string, a ...interface{})
}

type Option

type Option interface {
	// contains filtered or unexported methods
}

type Response

type Response struct {
	Response string
	Err      error
}

type VideoSwitcher

type VideoSwitcher struct {
	Address string
	Log     Logger
	// contains filtered or unexported fields
}

func NewVideoSwitcher

func NewVideoSwitcher(addr string, opts ...Option) *VideoSwitcher

func (*VideoSwitcher) GetActiveSignal

func (vs *VideoSwitcher) GetActiveSignal(ctx context.Context, port string) (error, structs.ActiveSignal)

func (*VideoSwitcher) GetActiveSignalByPort

func (vs *VideoSwitcher) GetActiveSignalByPort(ctx context.Context, port string, readWelcome bool) (structs.ActiveSignal, error)

func (*VideoSwitcher) GetHardwareInfo

func (vs *VideoSwitcher) GetHardwareInfo(ctx context.Context) (structs.HardwareInfo, error)

func (*VideoSwitcher) GetInfo

func (vs *VideoSwitcher) GetInfo(ctx context.Context) (interface{}, error)

GetInfo .

func (*VideoSwitcher) GetInputByOutput added in v0.1.1

func (vs *VideoSwitcher) GetInputByOutput(ctx context.Context, output string) (string, error)

GetInput returns the current input

func (*VideoSwitcher) SendCommand

func (vs *VideoSwitcher) SendCommand(ctx context.Context, cmd []byte) ([]byte, error)

SendCommand sends the byte array to the desired address of projector

func (*VideoSwitcher) SetFrontLock

func (vs *VideoSwitcher) SetFrontLock(ctx context.Context, state bool) error

func (*VideoSwitcher) SetInputByOutput added in v0.1.1

func (vs *VideoSwitcher) SetInputByOutput(ctx context.Context, output, input string) error

SwitchInput changes the input on the given output to input

Jump to

Keyboard shortcuts

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