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");
Afficher le fichier Open project: rit-sse-mycroft/app-projector Class Usage Examples

Méthodes publiques

Méthode 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

Méthode Description
closeConnection ( ) : void
getMD5Hash ( string input ) : string
initConnection ( ) : bool

Method Details

PJLinkConnection() public méthode

public PJLinkConnection ( string host ) : System
host string
Résultat System

PJLinkConnection() public méthode

public PJLinkConnection ( string host, int port ) : System
host string
port int
Résultat System

PJLinkConnection() public méthode

public PJLinkConnection ( string host, int port, string passwd ) : System
host string
port int
passwd string
Résultat System

PJLinkConnection() public méthode

public PJLinkConnection ( string host, string passwd ) : System
host string
passwd string
Résultat System

getFullProjectorInfo() public méthode

public getFullProjectorInfo ( ) : rv.ProjectorInfo
Résultat rv.ProjectorInfo

getProjectorInfo() public méthode

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

powerQuery() public méthode

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

sendCommand() public méthode

public sendCommand ( Command cmd ) : Command.Response
cmd Command
Résultat Command.Response

sendCommandAsync() public méthode

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
Résultat void

turnOff() public méthode

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

turnOn() public méthode

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