C# Класс rv.PJLinkConnection

Simple class to control networked projectors via the PJLink protocol. See full spec here: http://pjlink.jbmia.or.jp/english/data/PJLink%20Specifications100.pdf This library was written in one day, so don't expect perfection. Most information must be fetched from commands after execution (sendCommand). For most common tasks, there are some shortcuts available in the PJLinkConnectionPJLinkConnection class. Basic usage: // Create connection object, communicating with projector with IP 192.168.1.14 // Projector has authentication enabled, password is rv (ignored if auth disabled) PJLinkConnection c = new PJLinkConnection("192.168.1.14", "rv"); //using shortcuts c.turnOn(); c.turnOff(); System.Console.WriteLine(c.getProjectorInfo()); //using low(er) level commands ErrorStatusCommand esc = new ErrorStatusCommand(); if (c.sendCommand(esc) == Command.Response.SUCCESS) Console.WriteLine(esc.dumpToString()); else Console.WriteLine("Communication Error");
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
PJLinkConnection ( string host ) : System
PJLinkConnection ( string host, int port ) : System
PJLinkConnection ( string host, int port, string passwd ) : System
PJLinkConnection ( string host, string passwd ) : System
getFullProjectorInfo ( ) : rv.ProjectorInfo
getProjectorInfo ( ) : string

Return String in the form Manufacturer Product (ProjectorName) or Manufacturer Product if no projector name is set.

powerQuery ( ) : PowerCommand.PowerStatus

Check power state of Projector. Returns unknown in case of an error

sendCommand ( Command cmd ) : Command.Response
sendCommandAsync ( Command cmd, Command resultCallback ) : void

Sends a command asynchronously. The specified resultCallback will be called when the command has executed.

turnOff ( ) : bool

Turn off projector. Returns true if projector answered with SUCCESS

turnOn ( ) : bool

Turn on projector. Returns true if projector answered with SUCCESS

Приватные методы

Метод Описание
closeConnection ( ) : void
getMD5Hash ( string input ) : string
initConnection ( ) : bool

Описание методов

PJLinkConnection() публичный Метод

public PJLinkConnection ( string host ) : System
host string
Результат System

PJLinkConnection() публичный Метод

public PJLinkConnection ( string host, int port ) : System
host string
port int
Результат System

PJLinkConnection() публичный Метод

public PJLinkConnection ( string host, int port, string passwd ) : System
host string
port int
passwd string
Результат System

PJLinkConnection() публичный Метод

public PJLinkConnection ( string host, string passwd ) : System
host string
passwd string
Результат System

getFullProjectorInfo() публичный Метод

public getFullProjectorInfo ( ) : rv.ProjectorInfo
Результат rv.ProjectorInfo

getProjectorInfo() публичный Метод

Return String in the form Manufacturer Product (ProjectorName) or Manufacturer Product if no projector name is set.
public getProjectorInfo ( ) : string
Результат string

powerQuery() публичный Метод

Check power state of Projector. Returns unknown in case of an error
public powerQuery ( ) : PowerCommand.PowerStatus
Результат PowerCommand.PowerStatus

sendCommand() публичный Метод

public sendCommand ( Command cmd ) : Command.Response
cmd Command
Результат Command.Response

sendCommandAsync() публичный Метод

Sends a command asynchronously. The specified resultCallback will be called when the command has executed.
public sendCommandAsync ( Command cmd, Command resultCallback ) : void
cmd Command
resultCallback Command
Результат void

turnOff() публичный Метод

Turn off projector. Returns true if projector answered with SUCCESS
public turnOff ( ) : bool
Результат bool

turnOn() публичный Метод

Turn on projector. Returns true if projector answered with SUCCESS
public turnOn ( ) : bool
Результат bool