Rainforest Automation
,
Inc
.
RAVEn™
XML API Manual
6
Data Structures
The
RAVEn
™ sends and receives data as a serial stream. The data is structured as XML
Fragments. An XML Fragment is a stripped down XML Element. The
RAVEn
™ uses XML
Fragments to simplify the parsing of the data stream, while providing a data structure that is
flexible and human readable.
The rules for XML Fragments are:
1. XML Fragments are transmitted as a stream; there are no BOF or EOF markers.
2. An XML Fragment is a well formed XML Element.
3. XML Elements do not have XML Attributes.
4. Only the root XML Element has child XML Elements.
5. There is no XML Declaration Section.
6. There are no XML Name spaces.
The
RAVEn
™ receives commands and sends notifications. A command is a request to the
RAVEn
™ to do something. The
RAVEn
™ will execute the command, which will trigger an
event.
RAVEn
™ events send out notifications that contain information about the event.
For example:
1. Send a GET_CURRENT_PRICE command, which causes the
RAVEn
™ to request the
current price stored in the meter;
2.
RAVEn
™ returns a
PriceCluster
notification with the current price received from the
meter.
The
RAVEn
™ will also send notifications when events are triggered by something other than a
command. For instance, when the
RAVEn
™ receives a new text message from the smart
meter, the
RAVEn
™ will send a
MessageCluster
notification. This is why the communications
model is asynchronous; the
RAVEn
™ sends notifications whenever an event occurs, in addition
to when a command is received.
The format of an XML Fragment is
<tag>
[<string>text</string>]
[<hex>0xFFEEDDCCBBAA99887766554433221100</hex>]
[<int>-987654321</int>]
[<decimal>-7654321.12345</decimal>]
[<![CDATA[binary]]>]
[<enumeration>{A|B|C}</enumeration>]
</tag>
Where:
-
<tag>
is the tag for the root XML Element
-
<string>
is the start tag for an element with Extended ASCII string
-
<hex>
is the start tag for an element with a hexadecimal data
-
<int>
is the start tag for an element with a signed 32bit integer