videoswitcher

package
Version: v0.0.0-...-01781d8 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CARRIAGE_RETURN           = 0x0D
	LINE_FEED                 = 0x0A
	SPACE                     = 0x20
	DELAY_BETWEEN_CONNECTIONS = time.Second * 10
)
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"
)

Command constants

Variables

View Source
var StartChannel = make(chan CommandInfo, 1000)

Functions

func GetActiveSignalByPort

func GetActiveSignalByPort(address, port string, readWelcome bool) (structs.ActiveSignal, *nerr.E)

GetActiveSignalByPort checks if the signal on a given port is active or not

func GetCurrentInputByOutputPort

func GetCurrentInputByOutputPort(address, port string, readWelcome bool) (status.Input, error)

GetCurrentInputByOutputPort gets the current input that is set to the given output port

func GetHardwareInformation

func GetHardwareInformation(address string, readWelcome bool) (structs.HardwareInfo, *nerr.E)

GetHardwareInformation builds the list of hardware information for this device and returns it

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 SetFrontLock

func SetFrontLock(address string, state, readWelcome bool) error

func StartRouter

func StartRouter()

func SwitchInput

func SwitchInput(address, input, output string, readWelcome bool) (status.Input, error)

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 Response

type Response struct {
	Response string
	Err      error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL