
Page 82 / 127
Section 8.
LW3 Programmers’ reference
Method
The ‘method’ in the LW3 protocol is also a leaf. It cannot have a value, such as the
properties, but it can be invoked with a parameter with the help of a special ‘CALL’
command.
A method cannot have child nodes or child methods. It is always a leaf.
A node can have any number of methods (may not have any).
A method is referenced with a colon (‘:’) after the node.
The methods’ name can contain the elements of the English alphabet, numbers
and underscore (‘_’) character.
By convention, methods are beginning with lowercase letter. In case of compound
words, the very first letter is lowercase, and the first letter of each other words are
capitalized (lowerCamelCase).
The parameter of the method can contain any readable ASCII character.
The method al
ways has a return ‘state’ if the method could be executed. The state
could be either ‘OK’ or ‘FAILED’.
The method not necessarily has a return ‘value’. If it does, it can contain additional
information, which is always specific for the current case (the return value can
specify why the execution failed).
When the method cannot be executed (e.g. the parameter list is illegal), there is an
error message.
Format:
mX
●/[nodeName]:[methodName]=[returnValue]
Legend:
m:
method
X can be:
‘O’: when the execution of the method was successful (OK),
‘F’:
when the execution of the method failed,
‘m’: manual for the method,
‘E’:
error message for the method.
Example:
mO
●/node1/node12:method1
mO
●/MEDIA/VIDEO/XP1:switch
mE
●%E001:Syntax error
mm
●/MEDIA/VIDEO/XP1:lockSource:Lock one or more source ports
8.1.2. Escaping
Property values and method parameters can contain characters that 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
Example:
The original text:
John
●(Doe).●#3:●5%2=1●node1\node11
The escaped text:
John
●\(Doe\).●\#3:●5\%2=1●node1\\node11
When using the LDC, the escaping is done automatically. If you send a command from a
third party device/terminal to the transmitter, the escaping has to be done manually. In this
case put an extra backslash before the control character.
Example:
CALL /MEDIA/UART/P1:SendMessage(My_message\\r\\n)
Summary of Contents for UMX-TPS-TX120
Page 2: ......