helpers

package
v0.0.0-...-4039ec2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2019 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBlankStatus

func GetBlankStatus(address string, pooled bool) (status.Blanked, *nerr.E)

func GetHardwareInfo

func GetHardwareInfo(address string, pooled bool) (structs.HardwareInfo, *nerr.E)

GetHardwareInfo gets the necessary hardware information from this device and returns it.

func GetInputStatus

func GetInputStatus(address string, pooled bool) (status.Input, *nerr.E)

func GetPower

func GetPower(address string, pooled bool) (status.Power, *nerr.E)

func HasActiveSignal

func HasActiveSignal(address string, port string, pooled bool) (structs.ActiveSignal, *nerr.E)

HasActiveSignal checks to see if the projector has an active signal on the given port currently.

func PowerOn

func PowerOn(address string, pooled bool) *nerr.E

func PowerStandby

func PowerStandby(address string, pooled bool) *nerr.E

func QueryStateWithConn

func QueryStateWithConn(command, address string, conn *net.TCPConn) ([]byte, *nerr.E)

func SendCommandWithConn

func SendCommandWithConn(command, address string, conn *net.TCPConn) *nerr.E

func SetBlank

func SetBlank(address string, blank, pooled bool) *nerr.E

func SetInput

func SetInput(address, port string, pooled bool) *nerr.E

func StartMinder

func StartMinder(conn *Connection)

Types

type Connection

type Connection struct {
	Conn              *net.TCPConn
	Address           string
	InChannel         chan Request
	SeppukuChannel    chan bool
	LastCommunication time.Time
}

func StartConnection

func StartConnection(address string) (*Connection, *nerr.E)

type Request

type Request struct {
	Command         string
	Address         string
	Query           bool
	ResponseChannel chan Response
}

type Response

type Response struct {
	Body []byte
	Err  *nerr.E
}

func MakeRequest

func MakeRequest(req Request) Response

Jump to

Keyboard shortcuts

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