Difference between revisions of "Proxy Orbiter"

From LinuxMCE
Jump to: navigation, search
(Add web protocol)
(Web mediated comms: Mention Web Orbiter 2.0 in the web comms)
 
Line 43: Line 43:
  
 
Both require the <i>device_id</i> parameter, which selects which Proxy_Orbiter they'll operate on. The <i>device_id</i> is the device number of the Generic Web Device parent, not the Generic Proxy Orbiter child.
 
Both require the <i>device_id</i> parameter, which selects which Proxy_Orbiter they'll operate on. The <i>device_id</i> is the device number of the Generic Web Device parent, not the Generic Proxy Orbiter child.
 +
 +
These pages are the same ones used by [[Web Orbiter 2.0]].
  
 
===weborbiter_command.php===
 
===weborbiter_command.php===

Latest revision as of 12:57, 11 July 2011


Description

Proxy_Orbiter is built from the 'guts' of the full Orbiter you see on MD's but in this case it's a UI'less piece of software that runs on the Core and its job is to render the UI for the Touch Orbiter that is running remotely on the target device. Each Touch Orbiter has an associated instance of Proxy_Orbiter and the two work in partnership. Proxy_Orbiters do all the 'heavy lifting' of rendering the UI and interacting with the rest of the underlying system and this allows the remote device that is running the Touch Orbiter to be a much less powerful and very simple device indeed if needed.

Commands

The following commands are for direct socket communication to the Proxy_Orbiter.

All command replies start with a reply message followed by \n followed by an optional body of data.

Syntax Reply on success Description
IMAGE IMAGE <size>
<image data>
Ask the Proxy_Orbiter to give us the image of the current screen. size is the size of the image data in bytes. image data is the actual unaltered image data, in binary form. There's no indication of the image format (which can be PNG or JPEG) and this must be inferred by other means.
XML XML <size>
<xml_data>
Retrieve the XML data for the Cisco 7970.
PLUTO_KEY <Key_ID> OK Used by the Web Orbiter and Cisco 7970 Orbiter in association with programmable soft keys.
TOUCH <X>x<Y> OK Notify the Proxy_Orbiter about a touch. X and Y are the coordinates of the touch. There's a literal x between X and Y.
ANYNEWS? NEWS <size>
<answer>
Ask the Proxy_Orbiter if there are any updates. The answer is either yes or no. Data size includes the LF line separator that follows the answer. If the answer is yes, the Touch Orbiter should refresh its screen as its own copy is out of date. The Touch Orbiter/Web Orbiter calls ANYNEWS? periodically (typically once every second).
SCREEN_XML SCREEN_XML <size>
<xml_data>
Request the current screen structure in XML format.
DATAGRID_XML <GridID> DATAGRID_XML <size>
<xml_data>
Request the data for Datagrid GridID. This command should be used only for grid objects described in the data returned by SCREEN_XML, as otherwise it's very likely the grid data is invalid and you'll receive and ERROR message.
DATAGRID_TOUCH <GridID> <Row> <Column> OK Similar to TOUCH, but for datagrids. Touch Orbiter/Web Orbiter sends this message when a datagrid cell in the Enhanced UI is activated.

In case of ERROR, the ERROR message is returned instead of the reply described above for any command.

All commands must be followed by the \n (LF) character (UNIX style EOL). DOS style EOL (\r\n) won't work. All text parts of the replies (including the first line) are followed by LF.

Web mediated comms

You don't have to connect to the Proxy_Orbiter directly. Actually, it's recommended you don't use the direct socket connection unless you can't use HTTP to access the Proxy_Orbiter through the Web Orbiter backend code.

There are two pages of interest:

  • weborbiter_command.php
  • weborbiter_image.php

Both require the device_id parameter, which selects which Proxy_Orbiter they'll operate on. The device_id is the device number of the Generic Web Device parent, not the Generic Proxy Orbiter child.

These pages are the same ones used by Web Orbiter 2.0.

weborbiter_command.php

Syntax: /lmce-admin/weborbiter_command.php?device_id=device_id&cmd=proxy_orbiter_command_string

Sends the proxy_orbiter_command_string to the Proxy_Orbiter identified by device_id and returns the reply. The proxy_orbiter_command_string must be a URLencoded version of a complete socket command from the table above.

This page won't run the IMAGE command intentionally. Use weborbiter_image.php for images.

weborbiter_image.php

Syntax 1: /lmce-admin/weborbiter_image.php?device_id=device_id
Syntax 2: /lmce-admin/weborbiter_image.php?device_id=device_id&file=file_path

Without the file parameter, weborbiter_image.php sends IMAGE to the Proxy_Orbiter and returns the main screen image.

With the file parameter, weborbiter_image.php attempts to return the requested file from the filesystem. This form is used to retrieve cover art for the datagrids. Only files in /usr/pluto/orbiter and /home/mediapics will be served.