XBMC Event Client Class.
Implementation of XBMC's UDP based input system. A set of classes that abstract the various packets that the event server currently supports. In addition, there's also a class, XBMCClient, that provides functions that sends the various packets. Use XBMCClient if you don't need complete control over packet structure.
The basic workflow involves:
-
Send a HELO packet
-
Send x number of valid packets
-
Send a BYE packet
IMPORTANT NOTE ABOUT TIMEOUTS: A client is considered to be timed out if XBMC doesn't received a packet at least once every 60 seconds. To "ping" XBMC with an empty packet use PacketPING or XBMCClient.ping(). See the documentation for details.
Base class that implements a single event packet.
- Generic packet structure (maximum 1024 bytes per packet)
- Header is 32 bytes long, so 992 bytes available for payload
- large payloads can be split into multiple packets using H4 and H5 H5 should contain total no. of packets in such a case
- H6 contains length of P1, which is limited to 992 bytes
- if H5 is 0 or 1, then H4 will be ignored (single packet msg)
- H7 must be set to zeros for now
-----------------------------
| -H1 Signature ("XBMC") | - 4 x CHAR 4B
| -H2 Version (eg. 2.0) | - 2 x UNSIGNED CHAR 2B
| -H3 PacketType | - 1 x UNSIGNED SHORT 2B
| -H4 Sequence number | - 1 x UNSIGNED LONG 4B
| -H5 No. of packets in msg | - 1 x UNSIGNED LONG 4B
| -H6 Payloadsize of packet | - 1 x UNSIGNED SHORT 2B
| -H7 Client's unique token | - 1 x UNSIGNED LONG 4B
| -H8 Reserved | - 10 x UNSIGNED CHAR 10B
|---------------------------|
| -P1 payload | -
-----------------------------
- Author
- Stefan Agner