SPP Studio

From SpinetiX Support Wiki

Jump to: navigation, search
The SPP Studio application has been deprecated and it will no longer be maintained.

Description

SPP Studio

The SPP (Serial Port Protocols) Studio application allows testing protocol files on a PC directly connected to the appliance (monitor for instance). This should help in debugging protocol files and testing that the appliance behaves as expected when the commands are sent.

Note that SPP Studio does not allow editing the protocol file, so you will need an external XML editor for that.

Versions

  • HMD version
    This version is included by default in the Hyper Media Director installer; after installation, the application can be found in the SpinetiX folder included in the Start menu. The HMD installer can still be downloaded from SpinetiX website (the legacy section).
  • Elementi version
    This version is not included by default in the Elementi installer (version 3.0.x), but an "extended" installer which includes it can be provided upon request.

Getting started

In order to work with protocol files, you need to perform the following operations:

  1. Make sure that your RS232 port settings are correct.
    • The "Settings" button (top menu, right side) is used to configure the speed and the various options for the transmission on the RS232 port. The default settings should work with most appliances.
  2. Open you protocol file using the Open button.
  3. Start the finite state machine using the Run button. Now SPP Studio is ready to send commands to your appliance.

Sending Commands

SPP Studio commands

Depending on your protocol file, a different set of commands will be shown in the SPP Studio interface. SPP Studio will add a command button for each <onStart> element present inside the "start" state element.

For instance, the following file will lead to the set of commands shown in the image on the right:

<state xml:id='start' desc='Start command'>
  <onStart command='PowerOn' goto='transmit_poweron' />
  <onStart command='PowerOff' goto='transmit_poweroff' />
  <onStart command='MuteOn' goto='transmit_muteon' />
  <onStart command='MuteOff' goto='transmit_muteoff' />
  <onStart command='SelectInput' goto='select_input_start'>
    <set var='Input' to='$PARAM1'/>
  </onStart>
  <onStart command='SetVolume' goto='transmit_vol'>
    <set var='Volume' to='%d{$PARAM1*60/100}'/>
  </onStart>
</state>

Pressing any button is equivalent to sending the command using the sendComPort() JavaScript command on the HMP.

For instance:

  • The PowerOn button is equivalent to the execution of the following script sendComPort("monitor", "PowerOn");.
  • The SetVolume button with a value of 50 in the first parameters text box is equivalent to the execution of the following script sendComPort("monitor", "PowerOn", 50);.

Advanced debugging

With SPP Studio you can see the characters which are sent and received on the RS232 interface. The dialog between the PC and the appliance is shown just under the parameters input area. The characters sent to the appliance are shown in blue, while the ones received from the appliance are shown in italic black. Non-printable characters are shown using their character code, i.e. &#xD; means character 13, end of line (\n).

SPP Studio commands

The example in the snapshot shows the dialog between the PC and a Sharp Aquaos when the user presses the MuteOn, MuteOff and SetVolume button (with an input of 50 for the volume).

  • The mute on command is sent (MUTE0001\n), and the screen replies that the settings have been modified as expected (OK\n).
  • The mute off command is sent (MUTE0002\n), and the screen replies that the settings have been modified as expected (OK\n).
  • The volume command is sent (VOL0030\n), and the screen replies that the settings have been modified as expected (OK\n). Note that the Sharp Aquos expects a volume between 0 and 60, whereas we have defined in the protocol file that the volume was between 0 and 100. Thus the value of 50 has to be converted to 30 when sent to the screen using the set command in the protocol file: <set var='Data' to='%d{$PARAM1*60/100}'/>

It is possible to increase the logging level of the finite state machine to indicate exactly what is happening during the exchange. To do so, change the "Log Level" setting from "Info" to "Trace". The debugging mode will indicate all the steps taken by the finite state machine to send and receive information from/to the appliance.

For instance, the effect of the "SetVolume" command is shown in the snapshot image.

  1. The finite state machine starts with the state ‘start’.
  2. The command SetVolume is received.
  3. The variables ‘Command’ and ‘Data’ are set respectively to ‘VOLM’ and ‘30’.
  4. The FSM moves to the state transmit and sends the ‘VOLM0030\n’ characters.
  5. The FSM receives ‘OK\n’ from the screen and thus moves from the ‘transmit’ state back to the ‘start’ state, ready to receive new commands.
This page was last modified on 31 January 2014, at 10:44.