FX-CG-UI

From WikiPrizm
Revision as of 08:41, 13 November 2012 by Tari (talk | contribs) (Created page with "<span style="margin-left:1em"><i>The real title of this page should be <b>FX-CG[UI]</b>. Technical limitations prevent this.</i></span> FX-CG[UI] is a piece of software design...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

The real title of this page should be FX-CG[UI]. Technical limitations prevent this. FX-CG[UI] is a piece of software designed to be a common interface for Prizm programs executing on non-Prizm platforms. It is implemented in Python and communicates with backend software (such as an emulator) via TCP.

Communication

This section documents the protocol used to communicate with the UI. Connections are accepted on TCP port 19756. All data is encapsulated in packets.

Packet format

Packets are composed of a small header and zero or more bytes of data. The header is the string "FXCG" in ASCII, followed by a single type byte and a 32-bit big-endian integer specifying the number of data bytes in the packet. For example, the following string represents a packet of type 16 with 0 bytes of data (C-style escapes): "FXCG\x10\x00\x00\x00\x00".

Packet types

The packet type indicates the meaning of the contained data. Any packet type is valid going in either direction (to or from the UI), but some may only make sense in one direction, but are still valid. Behavior in response to such packets (sending input events to the UI, for example) is implementation-defined.

0: Screen image

Contains an image of the device screen, formatted as an image file. Most common formats are accepted, such as BMP, GIF, JPEG (not recommended due to its lossy nature) and PNG. FX-CG[CL] uses 24-bit PPM for simplicity. The UI backs this functionality with a QImage structure, so all supported formats may be found in the Qt Documentation.