|--7--|--6--|--5--|--4--|--3--|--2--|--1--|--0--|
| tag number |class| len/val/type |
|-----|-----|-----|-----|-----|-----|-----|-----|
Tag numbers 0 - 14 are contained in bits 7 through 4.
A tag number of 15 indicates an extended tag is held in the following byte.
The tag length is contained in bits 2 through 0.
A length of 5 indicates and extended length is held in the following byte, or the byte following the extended tag number, if one exists.
If the extended length contains 254, the extended length is contained in the following two bytes.
If the extended length contains 255, the extended length is contained in the following four bytes.
(who dreamed this stuff up?)
class = 0 => application tag
class = 1 => context specific tag
If the tag is an application tag, then the tag number indicates the type, shown below, and the meaning is position dependent in the context of the whole message.
Tag Types |
---|
0 | Null |
1 | Boolean |
2 | Unsigned Integer |
3 | Signed Integer |
4 | Real (ANSI 754 Floating Point) |
5 | Double (ANSI 754 Double) |
6 | Octet String |
7 | Character String |
8 | Bit String |
9 | Enumerated |
10 | Date |
11 | Time |
12 | BACnet Object Identifier |
13 | Reserved |
14 | Reserved |
15 | Reserved |