A
1: S
ap
V
2 •
1
19
© 2017 Telos Alliance - Rev 1.2
System items always come at the end of a message and system items all begin with the dollar sign. Therefore when
parsing a SapV2 message the system item section begins when you encounter an un-escaped space followed by a
dollar sign. Since any property value that includes a space must be enclosed in quotes, dollar signs after a space
may exist in a property value if they are enclosed in quotes. If a double quote needs to be embedded within a
property value it needs to be escaped with the backslash - \”. If a carriage return and linefeed is to be embedded in
the value of a property use the %BeginEncap% %EndEncap% as defined in the Lwcp specification.
For example:
indi Devices#0.AnalogNode#[tcp://172.16.1.81:93] Name=”AAND-001-081 $Hello” $TXID=555
In the example above the property value of Name is:
AAND-001-081 $Hello
The parser does not start parsing the system items when it reaches the space and dollar sign because it is enclosed in
quotes as part of the property value. Instead, the system item list begins at $TXID.
In the following example, we needed to include a carriage return and linefeed as part of the value of a property, so
we use encapsulation:
set MemorySlots#0.MemorySlot#Hello Slotvalue=%BeginEncap%My Name Is
Freddy%EndEncap%
In this example the value of the memory slot will be set to “My Name is Freddy” with a carriage return and linefeed
between Is and Freddy. Some properties in the system also accept escape values to represent carriage return and line
feed. For example the generic protocol translator accepts \cr\lf for its ToSend property.
Discovery
Unlike the current version of Lwcp, SapV2 has been designed to extend Lwcp to allow for the discovery for all
objects and properties in the system. As in Lwcp, by using the get operator, you can specify an object path and a
property and retrieve the property’s value:
get Devices#0.Element#[tcp://172.16.1.51:93] Name
indi Devices#0.Element#[tcp://172.16.1.51:93] Name=”Element”
However, in SapV2 if you do not specify a property, that means you are requesting a list of all the properties and
values that the object has.
get Devices#0.Element#[tcp://172.16.1.51:93]
indi Devices#0.Element#[tcp://172.16.1.51:93] ExpectLwcp=”True”, DeviceType=”element”,
HasGpios=”True”, HasAudio=”False”, Name=”Element”, FriendlyName=”Element_172.16.1.51”,
Description=””, DiscoveredDateTime=”02/06/2015 13:08:41”, PathId=”tcp://172.16.1.51:93”, ShortId=”2”,
AutoReconnect=”20000”