2.2.1.1 Fundamental Data Types
The RDS Transport Protocol encodes the fundamental datatype within an RDS Transport Protocol message by writing a 2-byte constant that identifies the datatype followed by the data in a format corresponding to the constant. Data structure encodings in the RDS Transport Protocol are defined in terms of the following fundamental data types:
BIT: A single bit value of either 0 or 1.
BIT = %b0 / %b1
BYTE: An unsigned single byte (8-bit) value. The range is 0 to 255.
Designated datatype: VT-UI1
BYTE = 8BIT
VARIANT-BOOL: An unsigned 2-byte (16-bit) value. Value %x00.00 corresponds to boolean "false". Value %xFF.FF corresponds to boolean "true".
VARIANT-BOOL = %x00.00 / %xFF.FF
WORD: An unsigned 2-byte (16-bit) value usually used as a set of bit flags. The range as a numeric value is 0 to 65535.<3>
WORD = 16BIT
USHORT: An unsigned 2-byte (16-bit) value. The range is 0 to 65535.
USHORT = 2BYTE
DWORD: An unsigned 4-byte (32-bit) value usually used as a set of bit flags. The range when used as a numeric value is 0 to (2^32)-1.<4>
DWORD = 32BIT;
LONG: A signed 4-byte (32-bit) value. The range is -(2^31) to (2^31)-1.<5>
LONG = 4BYTE;
ULONG: An unsigned 4-byte (32-bit) value. The range is 0 to (2^32)-1.<6>
ULONG = 4BYTE
FLOAT: A single-precision floating-point value. The range is -2^104 to 2^128, as specified in [IEEE754].<7>
FLOAT = 4BYTE
DOUBLE: A double-precision floating-point number, as specified in [IEEE754].<8>
DOUBLE = 8BYTE
VARIANT: A variant data type that can be used to hold any single, scalar, fixed-size data type. Sixteen bytes are allocated to support the variant sizes of different data types, from 1 byte (BYTE) to 16 bytes (GUID).
VARIANT = 16BYTE
RESERVEDBIT: A BIT value used for padding that does not transmit information. Unlike ZEROBIT (defined later), which MUST be %b0, the value of the RESERVEDBIT field MAY be %b1, although this MUST be treated as if the value was %b0. RESERVEDBIT fields SHOULD<9> be set to %b0 and MUST be ignored on receipt.
RESERVEDBIT = BIT
RESERVEDBYTE: A BYTE value used for padding that does not transmit information. Unlike ZEROBYTE (defined later), which MUST be %b00, the value of the RESERVEDBYTE field MAY be a value other than %b00, although this MUST be treated as if the value were %b00. RESERVEDBYTE fields SHOULD<10> be set to %x00 and MUST be ignored on receipt.
RESERVEDBYTE = BYTE
GUID: A 16-byte value used to uniquely identify a specific data object, as specified in [MS-DTYP] section 2.3.4. It is commonly represented in the following hexadecimal form: "{12345678-1234-1234-1234-123456789ABC}".
GUID = 16BYTE
UNICODECHAR: A single Unicode character in the UTF-16LE encoding, as specified in [UNICODE].
UNICODECHAR = 1*(2BYTE)
UNICODESTRING: A non-null-terminated string of Unicode characters.
UNICODESTRING = *UNICODECHAR
ASCIICHAR: A single-byte ASCII character. Encoding details are specified in [US-ASCII].
ASCIICHAR = BYTE
ASCIISTRING: A non-null-terminated string of ASCII characters.
ASCIISTRING = *ASCIICHAR
LENGTH-PREFIXED-STRING: A Unicode character string prefixed by its length in characters and not terminated by null.
LENGTH-PREFIXED-STRING = StringLength *UNICODECHAR
StringLength: A 2-byte (16-bit) value that specifies the number of Unicode characters in the string. The maximum length value is 65535.
StringLength = USHORT
BYTECOUNT-PREFIXED-STRING: A Unicode character string prefixed by its length in bytes and not terminated by null.
BYTECOUNT-PREFIXED-STRING = StringBytes *UNICODECHAR
StringBytes: A 2-byte (16-bit) value that specifies the string's length in bytes. Note that since a Unicode character is at least 2-bytes, the maximum string length in characters supported by this datatype is 32767.
StringBytes = USHORT
LENGTH-PREFIXED-BYTE-ARRAY: An array prefixed by its length in bytes.
LENGTH-PREFIXED-BYTE-ARRAY = NumberOfBytes *BYTE
NumberOfBytes: A 4-byte (32-bit) value that denotes the number of bytes in a byte array. The maximum size of the corresponding byte array is (2^32)-1.
NumberOfBytes = ULONG
These data types have several associated constants and subsets of the data types' ranges, which are commonly used by the protocol:
-
ZEROBYTE = %x00 ZEROLONG = 4ZEROBYTE ZEROULONG = 4ZEROBYTE NULL-BPS = %x00.00 () NULLINDICATOR = %x01 DIGIT = "0" / NONZERODIGIT NONZERODIGIT = "1" / "2" / "3" / "4" / "5" / "6" / "7" / "8" / "9" CRLF = %x0D %x0A NUMBER = "0" / (NONZERODIGIT *(DIGIT)) ZEROBIT = %b0