6. LW3 Programmers’ Reference
HDMI20-OPTC series – User's Manual
38
Following example presents the structure of the tree traversal:
Tree structure of the nodes
6.1.1.2.
Property
The ‘property’ in the LW3 protocol is basically a leaf, which has a well-defined value.
▪
A property has a value.
▪
A property cannot have child nodes or child properties. It is always a leaf.
▪
A node can have any number of properties (may not have any).
▪
A property is referenced with a dot (‘.’) after the node name.
▪
The properties’ name can contain the elements of the English alphabet, numbers and underscore (‘_’)
character.
▪
By convention, properties are beginning with a capital letter, all other characters are lowercase ones.
In the case of compound words, all words are beginning with a capital letter (CamelCase).
▪
The value of the property can contain any readable ASCII character.
▪
A property can be read-only or read/write.
Format:
pX
●
/[nodeName].[propertyName]=[propertyValue]
Legend:
p:
property
‘X’ can be:
‘r’:
if the property is read-only.
‘w’:
if the property is readable, writable.
‘m’:
the manual of the property.
‘E’:
error message for the property.
'v':
virtual node property: contains a node path to a node which will
be linked to the property's parent node.
node2
node3
node1
n-/
node12
node21
node11
node211
Path of the nodes:
n- /node1
n- /node1/node11
n- /node1/node12
n- /node2
n- /node2/node21
n- /node2/node21/node211
n- /node3
Example:
The following two ones are read-only properties:
pr
●
/node1/node12.ReadOnlyProperty=value1
pr
●
/.ProductName=HDMI20-OPTC-TX22
The following two ones are read-write properties:
pw
●
/node1/node12.ReadWriteProperty=value2
pw
●
/.DeviceNickName=John
6.1.1.3.
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 a lowercase letter. In the 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 always has a return ‘state’ if the method could be executed. The state could be either ‘OK’
or ‘FAILED’.
▪
The method does not necessarily have a return ‘value’. If it does, it can contain additional information,
which is always specific to 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’:
the manual of the method.
‘E’:
error message for the method.
Example:
mO
●
/node1/node12:method1
mO
●
/MEDIA/XP/VIDEO:switch
mE
●
%E001:Syntax error
mm
●
/MEDIA/XP/VIDEO:lockSource:Lock one or more source ports