
cbus Documentation, Release 0.1-dev
4.2 Protocol
4.2.1 Discovery and Handshake
After the SWF is started, it loads the configuration file from /clipsal/resources/local_config.xml. This
looks like:
<local_config version="1.0">
<wiser ip="XXX.XXX.XXX.XXX" port="8888" remote_url="" remote_port="8336"
remote="0" wan="0"/>
<client name="Web UI" fullscreen="0" http_auth="0" local_file_access="1"
local_project="0" local_skin_definition="0"/>
</local_config>
Here we see the internal IP address of the Wiser, and the port that is used for XMLSockets requests (port).
remote_port indicates the port used by the CFTP daemon.
4.2.2 Authentication
There is a basic authentication system in place on some of the sockets. This can be established by retrieving the key
from /clipsal/resources/projectorkey.xml. This file looks like:
<cbus_auth_data value="0x12345678"/>
This projector key is generated when a project file is first created by PICED. The projector key stays the same for all
projects created during that particular run of PICED.
As a result, rebooting Wiser or changing the HTTP password does not change this key, and as a result it is not an
effective measure for preventing access to the CBus XMLSocket protocol.
Once this projector key is acquired, it may be reused in perpetuity. It is only possible to change this key by creating
an entirely new project file in PICED, during a different run of PICED, and transferring this to the Wiser.
4.2.3 Connecting
There is now enough information to connect to the XMLSocket service on port 8888 of the Wiser (or “port” in
local_config.xml).
So to start the connection we need to send some commands off to the server to handshake.
This starts with a command called <cbus_auth_cmd>. This has three attributes, required exactly in this order:
<cbus_auth_cmd value="0x12345678" cbc_version="3.7.0" count="0" />
• value is the value of the cbus_auth_data retrieved in the previous step.
• cbc_version is the version of the SWF being used. This is found in wiserui.swf, in the variable “cbc_version”.
• count is the number of times that this session has attempted to authenticate. Set this to 0.
You could also request the project files and skin files in one shot, like this:
<cbus_auth_cmd value="0x12345678" cbc_version="3.7.0" count="0" />
<project-file-request />
<skin-file-request />
The Wiser responds with a message like this:
14 Chapter 4. Wiser
Comentarios a estos manuales