
Appendix A: Marshalling Protocol
219
NetLinx Programming Language Reference Guide
Encoding notes:
The encoding XML will not contain any white space. This includes
CR
,
LF
pairs.
The decoding XML may contain white spaces. They will be ignored according to standard
XML rules (i.e. Spaces as between tags are read.)
Array may be encoded or decoded as binary encoded data
XML comments,
<!-- -->
, will be ignored in decode.
String encoding
NetLinx has no native string type, but since it is a common type the encoding/decoding of the string data
will be logically handled so the XML remains concise.
CHAR
arrays will be encoded/decoded as a string
type, printable ASCII characters appear as ASCII, and non-printable characters appear as escaped
decimal or hex code,
&#<decimal code>
; or
&#x<hex code>;
. An example string would be:
<data>My Name is Jimmy Buffet
</data>
- or -
<data>My Name is Jimmy Buffet </data>
Additionally, some characters have a more readable syntax. These characters are invalid in XML; so, the
following characters can be encoded in the above format or the following format:
Binary array encoding
Arrays can optionally be encoded/decoded as pairs of ASCII-encoded HEX. The pairs of ASCII-
encoded HEX needs to be padded to the size of the data so a 4-byte data value needs to have 4 bytes that
represent it. There are no spaces between pairs, and the default is Big-Endian. Little Endian can be
encoded or decoded as an option. The HEX letters may appear as upper or lower case and are by default
upper case. Any example of a 2-byte (signed or unsigned) array containing the value 1,2,3,4,1,12,13,14
is:
Types Supported in the XML Marshaller (Cont.)
ARRAY -
Binary
Encoded
Array of any one of the types in this table except struc-
tures. This is the default for all non-CHAR arrays but
CHAR arrays can use this encoding as well. The type
of the parent is the type of the entire array. Type is
optional and generally not included. Current Length is
optional. Style is LE for little endian or BE for big
endian. BE is the default. Size indicates the byte size
but not the type. ByteSize=4 is used for LONG,
SLONG, and FLOAT and means that 8 nibbles will be
present for each element being encoded/decoded.
<array>
<name><MyName></name>
<type>Type</type>
<curLength>100</curLength>
<encoded>
<style>LE or BE</ style >
<size>1,2,4,8</size>
<data>01020304</data>
</encoded>
</array>
Character Escape Version
<
<
>
>
&
&
'
'
"
"
Содержание NETLINX PROGRAMMING LANGUAGE
Страница 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Страница 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Страница 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Страница 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Страница 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Страница 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Страница 114: ...Mainline 98 NetLinx Programming Language Reference Guide FIG 1 Message and Mainline Processing in the NetLinx System...
Страница 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Страница 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Страница 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Страница 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...