Skip to main content

bacnet_types/enums/
network.rs

1// ===========================================================================
2// Network layer enums (Clause 6)
3// ===========================================================================
4
5bacnet_enum! {
6    /// NPDU network priority levels (Clause 6.2.2).
7    pub struct NetworkPriority(u8);
8
9    const NORMAL = 0;
10    const URGENT = 1;
11    const CRITICAL_EQUIPMENT = 2;
12    const LIFE_SAFETY = 3;
13}
14
15bacnet_enum! {
16    /// Network layer message types (Clause 6.2.4).
17    pub struct NetworkMessageType(u8);
18
19    const WHO_IS_ROUTER_TO_NETWORK = 0x00;
20    const I_AM_ROUTER_TO_NETWORK = 0x01;
21    const I_COULD_BE_ROUTER_TO_NETWORK = 0x02;
22    const REJECT_MESSAGE_TO_NETWORK = 0x03;
23    const ROUTER_BUSY_TO_NETWORK = 0x04;
24    const ROUTER_AVAILABLE_TO_NETWORK = 0x05;
25    const INITIALIZE_ROUTING_TABLE = 0x06;
26    const INITIALIZE_ROUTING_TABLE_ACK = 0x07;
27    const ESTABLISH_CONNECTION_TO_NETWORK = 0x08;
28    const DISCONNECT_CONNECTION_TO_NETWORK = 0x09;
29    const CHALLENGE_REQUEST = 0x0A;
30    const SECURITY_PAYLOAD = 0x0B;
31    const SECURITY_RESPONSE = 0x0C;
32    const REQUEST_KEY_UPDATE = 0x0D;
33    const UPDATE_KEY_SET = 0x0E;
34    const UPDATE_DISTRIBUTION_KEY = 0x0F;
35    const REQUEST_MASTER_KEY = 0x10;
36    const SET_MASTER_KEY = 0x11;
37    const WHAT_IS_NETWORK_NUMBER = 0x12;
38    const NETWORK_NUMBER_IS = 0x13;
39}
40
41bacnet_enum! {
42    /// Reject-Message-To-Network reason codes (Clause 6.4.4).
43    pub struct RejectMessageReason(u8);
44
45    const OTHER = 0;
46    const NOT_DIRECTLY_CONNECTED = 1;
47    const ROUTER_BUSY = 2;
48    const UNKNOWN_MESSAGE_TYPE = 3;
49    const MESSAGE_TOO_LONG = 4;
50    /// Removed per 135-2020
51    const REMOVED_5 = 5;
52    const ADDRESSING_ERROR = 6;
53}