Encoding Notes; String Encoding; Binary Array Encoding - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Types Supported in the XML Marshaller (Cont.)
ARRAY -
Binary
Encoded

Encoding notes:

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.
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&#x0D;</data>
- or -
<data>My Name is Jimmy Buffet &#13;</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:
NetLinx Programming Language Reference Guide
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.
The encoding XML will not contain any white space. This includes
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,
<!-- -->
Character Escape Version
&lt;
<
&gt;
>
&amp;
&
&apos;
'
&quot;
"
<array>
<name><MyName></name>
<type>Type</type>
<curLength>100</curLength>
<encoded>
</encoded>
</array>
, will be ignored in decode.
CHAR
arrays will be encoded/decoded as a string
Appendix A: Marshalling Protocol
<style>LE or BE</ style >
<size>1,2,4,8</size>
<data>01020304</data>
CR
,
LF
pairs.
219

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents