Lightware 3 Protocol Commands

1. The LW3 Command Structure

Command: ▸ CALL /MEDIA/VIDEO/XP:switch(I1:O1;I2:O2)
Response: ◂ mO /MEDIA/VIDEO/XP:switch
Command type

↓

Path

↓

Method/property

↓

Parameters

↓

  ▸ CALL/MEDIA/VIDEO/XP:switch(I1:O1;I2:O2)
◂ mO/MEDIA/VIDEO/XP:switch

↑


Prefix

↑


Path

↑


Method/property

2. General Rules

  • All names and parameters are case-sensitive.
  • The nodes are separated by a slash (‘/’) character.
  • The node name can contain the elements of the English alphabet and numbers.
  • Use the TCP port no. 6107 when using LW3 protocol over Ethernet.
  • When a command is issued by the device, the received response cannot be processed by the CPU.
  • The path of a node has to contain all parent nodes from the root node.

↑ Back to the top ↑

3. Command Types

GET Command

The GET command can be used to get the child nodes, properties and methods of a specific node. It can also be used to get the value of a property. Use the dot character (.) when addressing a property:

▸ GET /.SerialNumber
◂ pr /.SerialNumber=87654321

GETALL Command

The GETALL command can be used to get all child nodes, properties and methods of a node with one command.

▸ GETALL /MEDIA/UART
◂ ns /MEDIA/UART/P1
◂ ns /MEDIA/UART/P2
◂ pr /MEDIA/UART.PortCount=2
◂ pr /MEDIA/UART.PortUi=P1:12209;P2:12224
◂ pr /MEDIA/UART.P1=Local RS-232
◂ pr /MEDIA/UART.P2=TPS out RS-232

SET Command

The SET The SET command can be used to modify the value of a property. Use the dot character (.) when addressing the property:

▸ SET /MEDIA/VIDEO/I1.ColorSpaceMode=0
◂ pw /MEDIA/VIDEO/I1.ColorSpaceMode=0

CALL Command

A method can be invoked by the CALL command. Use the colon character (:) when addressing the method:

▸ CALL /MEDIA/VIDEO/XP:switch(I1:O1)
◂ mO /MEDIA/VIDEO/XP:switch

MAN Command

The manual is a human readable text in English that describes the syntax and provides a hint for how to use the primitives. For every node, property and method in the tree there is a manual, type the MAN command to get the manual:

▸ MAN /MEDIA/VIDEO/O1.Pwr5vMode
◂ pm /MEDIA/VIDEO/O1.Pwr5vMode ["0" | "1" | "2"] 0 - Auto, 1 - Always On, 2 - Always Off

↑ Back to the top ↑

4. Prefix Summary

DEFINITION: The prefix is a 2-character long code that describes the type of the response.

The following prefixes are defined in the LW3 protocol:

PrefixDescription
n-a node
nEan error for a node
nma manual of a node
nsa child node of a node
pra read-only property
pwread-write property
pEan error for the property
pma manual for the property
m-a method
mOa response after a success method execution
mFa response after a failed method execution
mEan error for a method
mma manual for a method

↑ Back to the top ↑

5. Error Messages

There are several error messages defined in the LW3 protocol, all of them have a unique error number.

▸ CALL /MEDIA/VIDEO/XP:switch(IA:O1)
◂ mE /MEDIA/VIDEO/XP:switch %E004:Invalid value

↑ Back to the top ↑

6. Escaping

DEFINITION: An escape sequence is a sequence of characters that does not represent itself when used inside a character or string literal, but is translated into another character or a sequence of characters.

Property values and method parameters can contain characters which are used as control characters in the protocol. They must be escaped. The escape character is the backslash (‘\’) and escaping means injecting a backslash before the character that should be escaped (like in C language).
Control characters are the followings: \ { } # % ( ) \r \n \t

The original message:

CALL /MEDIA/UART/P1:sendMessage(Set(01))

The escaped message:

CALL /MEDIA/UART/P1:sendMessage(Set\(01\))

↑ Back to the top ↑

7. Subscription

DEFINITION: Subscribe to a node means that the user will get a notification if any of the properties of the node is changed.

A user can subscribe to any node. These notifications are asynchronous messages and they are useful to keep the client application up to date, without receiving any unwanted information. When the user does not want to be informed about the changes anymore, one can simply unsubscribe from the node.

ATTENTION! The subscriptions are handled separately for connections. Hence, if the connection is terminated all registered subscriptions are deleted. After closing a connection the subscribe command has to be sent in order to get the notifications of the changes on that connection.

Subscribe to a Node

▸ OPEN /MEDIA/VIDEO
◂ o- /MEDIA/VIDEO

Get the Active Subscriptions

▸ OPEN
◂ o- /MEDIA/VIDEO
◂ o- /EDID
◂ o- /DISCOVERY

Subscribe to Multiple Nodes

▸ OPEN /MEDIA/VIDEO/*
◂ o- /MEDIA/VIDEO/*

Unsubscribe from a Node

▸ CLOSE /MEDIA/VIDEO
◂ c- /MEDIA/VIDEO

Unsubscribe from Multiple Nodes

▸ CLOSE /MEDIA/VIDEO/*
◂ c- /MEDIA/VIDEO/*

↑ Back to the top ↑

8. Signature

DEFINITION: The signature is a four-digit-long hexadecimal value that can be optionally placed before every command to keep a command and the corresponding responses together as a group.

Each line is terminated with a carriage return (Cr, ‘\r’) and line feed (Lf, ‘\n’) characters. In several cases the number of the lines in the response cannot be determined in advance, e.g. the client is intended waiting for the whole response and also wants to be sure, that the received lines belong together and to the same command. In these cases, a special feature the ‘signature’ can be used. In these cases, the response to that particular command will also be preceded by the signature, and the corresponding lines will be between brackets:

▸ 1700#GET /EDID.*
◂ {1700
◂ pr /EDID.EdidStatus=F89:E1;D1:E2;D1:E3;D1:E4;F89:E5
◂ m- /EDID:copy
◂ m- /EDID:delete
◂ m- /EDID:reset
◂ m- /EDID:switch
◂ m- /EDID:switchAll
◂ }

INFO: The lines of the signature are also Cr and Lf terminated.

↑ Back to the top ↑

9. Notifications about the Changes of the Properties

When the value of a property is changed and the user is subscribed to the node, which the property belongs to, an asynchronous notification is generated. This is notification is called as the ‘change message’. The format of such a message is very similar to the response for the GET command:

◂ CHG /EDID.EdidStatus=F48:E1

A Short Example of How to Use the Subscription

There are two independent users controlling the device through two independent connections (Connection #1 and Connection #2). The events in the rows occur after each other.

▸ OPEN /MEDIA/VIDEO/QUALITY    ↤   Connection #1
◂ o- /MEDIA/VIDEO/QUALITY
▸ GET /MEDIA/VIDEO/Quality.QualityMode
◂ pm /MEDIA/VIDEO/QUALITY.QualityMode=graphic
▸ GET /MEDIA/VIDEO/Quality.QualityMode    ↤   Connection #2
◂ pm /MEDIA/VIDEO/QUALITY.QualityMode=graphic
▸ SET /MEDIA/VIDEO/Quality.QualityMode=movie
◂ pw /MEDIA/VIDEO/QUALITY.QualityMode=movie
◂ CHG /MEDIA/VIDEO/QUALITY.QualityMode=movie    ↤   Connection #1

↑ Back to the top ↑