pjlink

package module
v0.0.0-...-bdb7c6b Latest Latest
Warning

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

Go to latest
Published: May 9, 2018 License: Apache-2.0 Imports: 8 Imported by: 1

README

Go implementation of PJLink Protocol. Library only. Based on: https://github.com/byuoitav/pjlink-microservice.
Apache 2 License

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AVMuteQueryResponses = map[string]string{
	"11":   "video mute on, audio mute off",
	"21":   "audio mute on, video mute off",
	"31":   "video and audio mute on",
	"30":   "video and audio mute off",
	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var AVMuteRequests = map[string]string{
	"query":          "?",
	"video-mute-on":  "11",
	"video-mute-off": "10",
	"audio-mute-on":  "21",
	"audio-mute-off": "20",
	"av-mute-on":     "31",
	"av-mute-off":    "30",
}
View Source
var AVMuteResponses = map[string]string{
	"OK":   "successful execution, or state already current",
	"ERR2": "out of parameter",
	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var CommandMapClass1 = map[string]bool{
	"POWR": true,
	"INST": true,
	"INPT": true,
	"AVMT": true,
	"ERST": true,
	"LAMP": true,
	"NAME": true,
	"INF1": true,
	"INF2": true,
	"INFO": true,
	"CLSS": true,
}

available commands Class 1

View Source
var CommandMapClass2 = map[string]bool{
	"SNUM": true,
	"SVER": true,
	"INNM": true,
	"IRES": true,
	"RRES": true,
	"FILT": true,
	"RLMP": true,
	"RFIL": true,
	"SVOL": true,
	"MVOL": true,
	"FREZ": true,
}
View Source
var ErrorStatusQueryResponses = map[string]string{

	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var ErrorStatusRequests = map[string]string{
	"query": "?",
}
View Source
var HumanToRawCommands = map[string]string{
	"power":        "POWR",
	"input-list":   "INST",
	"input":        "INPT",
	"av-mute":      "AVMT",
	"error-status": "ERST",
	"lamp":         "LAMP",
	"name":         "NAME",
	"manufacturer": "INF1",
	"model":        "INF2",
	"version":      "INFO",
}
View Source
var InputListQueryResponses = map[string]string{

	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var InputListRequests = map[string]string{
	"query": "?",
}
View Source
var InputQueryResponses = map[string]string{
	"11":   "rgb1",
	"12":   "rgb2",
	"13":   "rgb3",
	"14":   "rgb4",
	"15":   "rgb5",
	"16":   "rgb6",
	"17":   "rgb7",
	"18":   "rgb8",
	"19":   "rgb9",
	"21":   "video1",
	"22":   "video2",
	"23":   "video3",
	"24":   "video4",
	"25":   "video5",
	"26":   "video6",
	"27":   "video7",
	"28":   "video8",
	"29":   "video9",
	"31":   "digital1",
	"32":   "digital2",
	"33":   "digital3",
	"34":   "digital4",
	"35":   "digital5",
	"36":   "digital6",
	"37":   "digital7",
	"38":   "digital8",
	"39":   "digital9",
	"41":   "storage1",
	"42":   "storage2",
	"43":   "storage3",
	"44":   "storage4",
	"45":   "storage5",
	"46":   "storage6",
	"47":   "storage7",
	"48":   "storage8",
	"49":   "storage9",
	"51":   "network1",
	"52":   "network2",
	"53":   "network3",
	"54":   "network4",
	"55":   "network5",
	"56":   "network6",
	"57":   "network7",
	"58":   "network8",
	"59":   "network9",
	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var InputRequests = map[string]string{
	"query":    "?",
	"rgb1":     "11",
	"rgb2":     "12",
	"rgb3":     "13",
	"rgb4":     "14",
	"rgb5":     "15",
	"rgb6":     "16",
	"rgb7":     "17",
	"rgb8":     "18",
	"rgb9":     "19",
	"video1":   "21",
	"video2":   "22",
	"video3":   "23",
	"video4":   "24",
	"video5":   "25",
	"video6":   "26",
	"video7":   "27",
	"video8":   "28",
	"video9":   "29",
	"digital1": "31",
	"digital2": "32",
	"digital3": "33",
	"digital4": "34",
	"digital5": "35",
	"digital6": "36",
	"digital7": "37",
	"digital8": "38",
	"digital9": "39",
	"storage1": "41",
	"storage2": "42",
	"storage3": "43",
	"storage4": "44",
	"storage5": "45",
	"storage6": "46",
	"storage7": "47",
	"storage8": "48",
	"storage9": "49",
	"network1": "51",
	"network2": "52",
	"network3": "53",
	"network4": "54",
	"network5": "55",
	"network6": "56",
	"network7": "57",
	"network8": "58",
	"network9": "59",
}
View Source
var InputResponses = map[string]string{
	"OK":   "OK",
	"ERR2": "nonexistent input source",
	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var LampQueryResponses = map[string]string{

	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var LampRequests = map[string]string{
	"query": "?",
}
View Source
var LampStateResponses = map[string]string{
	"0": "off",
	"1": "on",
}
View Source
var ManufacturerQueryResponses = map[string]string{

	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var ManufacturerRequests = map[string]string{
	"query": "?",
}
View Source
var ModelQueryResponses = map[string]string{

	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var ModelRequests = map[string]string{
	"query": "?",
}
View Source
var NameQueryResponses = map[string]string{

	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var NameRequests = map[string]string{
	"query": "?",
}
View Source
var PowerQueryResponses = map[string]string{
	"0":    "power-off (standby)",
	"1":    "power-on (lamp on)",
	"2":    "cooling",
	"3":    "warm-up",
	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var PowerRequests = map[string]string{
	"query":     "?",
	"power-on":  "1",
	"power-off": "0",
}
View Source
var PowerResponses = map[string]string{
	"OK":   "success, or already current state",
	"ERR2": "out of parameter",
	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var RawToHumanCommands = map[string]string{
	"POWR": "power",
	"INST": "input-list",
	"INPT": "input",
	"AVMT": "av-mute",
	"ERST": "error-status",
	"LAMP": "lamp",
	"NAME": "name",
	"INF1": "manufacturer",
	"INF2": "model",
	"INFO": "version",
}
View Source
var RawToHumanInputs = map[string]string{
	"11": "rgb1",
	"12": "rgb2",
	"13": "rgb3",
	"14": "rgb4",
	"15": "rgb5",
	"16": "rgb6",
	"17": "rgb7",
	"18": "rgb8",
	"19": "rgb9",
	"21": "video1",
	"22": "video2",
	"23": "video3",
	"24": "video4",
	"25": "video5",
	"26": "video6",
	"27": "video7",
	"28": "video8",
	"29": "video9",
	"31": "digital1",
	"32": "digital2",
	"33": "digital3",
	"34": "digital4",
	"35": "digital5",
	"36": "digital6",
	"37": "digital7",
	"38": "digital8",
	"39": "digital9",
	"41": "storage1",
	"42": "storage2",
	"43": "storage3",
	"44": "storage4",
	"45": "storage5",
	"46": "storage6",
	"47": "storage7",
	"48": "storage8",
	"49": "storage9",
	"51": "network1",
	"52": "network2",
	"53": "network3",
	"54": "network4",
	"55": "network5",
	"56": "network6",
	"57": "network7",
	"58": "network8",
	"59": "network9",
}
View Source
var VersionQueryResponses = map[string]string{

	"ERR3": "unavailable time",
	"ERR4": "device failure",
}
View Source
var VersionRequests = map[string]string{
	"query": "?",
}

Functions

This section is empty.

Types

type PJProjector

type PJProjector struct {
	Address  string
	Port     string
	Password string
}

func NewProjector

func NewProjector(IP string, password string) *PJProjector

func (*PJProjector) GetPowerStatus

func (pr *PJProjector) GetPowerStatus() (*PJResponse, error)

--------------- Power ----------------------------------------------------------------------------------------------//

func (*PJProjector) GetProperty

func (self *PJProjector) GetProperty(property string) (string, error)

func (*PJProjector) GetPropertyArray

func (self *PJProjector) GetPropertyArray(property string) ([]string, error)

func (*PJProjector) SendRequest

func (pr *PJProjector) SendRequest(request PJRequest) (*PJResponse, error)

--------------------------------------------------------------------------------------------------------------------// Low-Level Calls --------------------------------------------------------------------------------------------------------------------//

func (*PJProjector) SetProperty

func (self *PJProjector) SetProperty(property string, val string) error

func (*PJProjector) TurnOff

func (pr *PJProjector) TurnOff() error

func (*PJProjector) TurnOn

func (pr *PJProjector) TurnOn() error

type PJRequest

type PJRequest struct {
	Class     int    `json:"class"`
	Command   string `json:"command"`
	Parameter string `json:"parameter"`
}

func (*PJRequest) Validate

func (request *PJRequest) Validate() error

checks basic validity of the Request

type PJResponse

type PJResponse struct {
	Class    string   `json:"class"`
	Command  string   `json:"command"`
	Response []string `json:"response"`
}

func NewPJResponse

func NewPJResponse() *PJResponse

func (*PJResponse) Parse

func (res *PJResponse) Parse(raw string) error

func (*PJResponse) Success

func (res *PJResponse) Success() bool

Checks if a Command was a success

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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