MODEX-OPTS, MODEX-OPTM
User’s Manual
Section 7.
Programmer’s reference
Page 73 / 113
7.2.7. 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 notification is called
as the
‘change message’. The format of such a message is very similar to the response for
‘GET’ command.
Format:
CHG
●[nodePath].[propertyName]=[newPropertyValue]
A short example of how to use the subscription
Below an example is presented, how the subscriptions work and how to use them. In the
example there are two independent users controlling the device through two independent
connections (‘C #1’ and ‘C #2’). The events in the rows occur after each other.
C #1
> OPEN●/EDID
< o-
●/EDID
> GET●/EDID.EdidStatus
< pr
●/EDID.EdidStatus=D1:E1;D1:E2
- User1 subscribes to /EDID node
- User1 queries /EDID.EdidStatus
C #2
> GET●/EDID.EdidStatus
< pr
●/EDID.EdidStatus=D1:E1;D1:E2
> CALL
●/EDID:switch(U1:E1)
< mO
●/EDID:switch
- User2 queries /EDID.EdidStatus
- User2 switches EDID
C #1
> CHG●/EDID.EdidStatus=U1:E1;D1:E2
> CLOSE●/EDID
< c-
●/EDID
- User1 got a change message
- User1 unsubscribes from the node
7.2.8. Signature
For some command the response can contain multiple lines. Every 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. In several cases the client is
intended waiting for the whole response and also wants to be sure, that received lines
belong together and to the same command. In these cases a special feature the
‘signature’
can be used.
The signature is a four-digit-long hexadecimal value that can be optionally placed before
every command. In that case, the response to that particular command will also be
preceded by the signature, and the corresponding lines will be in between brackets.
Command format:
XXXX#[command]
Legend:
xxxx: four-digit-long hexadecimal value.
Response format:
{XXXX
[command lines]
}
Example:
> 0001#GET●/MEDIA
< {0001
< n-●/MEDIA/VIDEO
< n-●/MEDIA/AUDIO
< n-●/MEDIA/UART
< n-●/MEDIA/IR
< n-●/MEDIA/PACKETROUTER
< }
Info: The lines of the signature are also Cr and Lf terminated.