C# Class 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");
ファイルを表示 Open project: rit-sse-mycroft/app-projector Class Usage Examples

Public Methods

Method Description
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

Private Methods

Method Description
closeConnection ( ) : void
getMD5Hash ( string input ) : string
initConnection ( ) : bool

Method Details

PJLinkConnection() public method

public PJLinkConnection ( string host ) : System
host string
return System

PJLinkConnection() public method

public PJLinkConnection ( string host, int port ) : System
host string
port int
return System

PJLinkConnection() public method

public PJLinkConnection ( string host, int port, string passwd ) : System
host string
port int
passwd string
return System

PJLinkConnection() public method

public PJLinkConnection ( string host, string passwd ) : System
host string
passwd string
return System

getFullProjectorInfo() public method

public getFullProjectorInfo ( ) : rv.ProjectorInfo
return rv.ProjectorInfo

getProjectorInfo() public method

Return String in the form Manufacturer Product (ProjectorName) or Manufacturer Product if no projector name is set.
public getProjectorInfo ( ) : string
return string

powerQuery() public method

Check power state of Projector. Returns unknown in case of an error
public powerQuery ( ) : PowerCommand.PowerStatus
return PowerCommand.PowerStatus

sendCommand() public method

public sendCommand ( Command cmd ) : Command.Response
cmd Command
return Command.Response

sendCommandAsync() public method

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
return void

turnOff() public method

Turn off projector. Returns true if projector answered with SUCCESS
public turnOff ( ) : bool
return bool

turnOn() public method

Turn on projector. Returns true if projector answered with SUCCESS
public turnOn ( ) : bool
return bool