Skip to main content

bacnet_types/enums/
object_level.rs

1// ===========================================================================
2// Object-level enums (Clause 12, 21)
3// ===========================================================================
4
5bacnet_enum! {
6    /// BACnet event state (Clause 12).
7    pub struct EventState(u32);
8
9    const NORMAL = 0;
10    const FAULT = 1;
11    const OFFNORMAL = 2;
12    const HIGH_LIMIT = 3;
13    const LOW_LIMIT = 4;
14    const LIFE_SAFETY_ALARM = 5;
15}
16
17bacnet_enum! {
18    /// BACnet binary present value (Clause 21).
19    pub struct BinaryPV(u32);
20
21    const INACTIVE = 0;
22    const ACTIVE = 1;
23}
24
25bacnet_enum! {
26    /// BACnet polarity (Clause 12).
27    pub struct Polarity(u32);
28
29    const NORMAL = 0;
30    const REVERSE = 1;
31}
32
33bacnet_enum! {
34    /// BACnet reliability (Clause 12).
35    pub struct Reliability(u32);
36
37    const NO_FAULT_DETECTED = 0;
38    const NO_SENSOR = 1;
39    const OVER_RANGE = 2;
40    const UNDER_RANGE = 3;
41    const OPEN_LOOP = 4;
42    const SHORTED_LOOP = 5;
43    const NO_OUTPUT = 6;
44    const UNRELIABLE_OTHER = 7;
45    const PROCESS_ERROR = 8;
46    const MULTI_STATE_FAULT = 9;
47    const CONFIGURATION_ERROR = 10;
48    // 11: reserved for a future addendum (135-2020 BACnetReliability production)
49    const COMMUNICATION_FAILURE = 12;
50    const MEMBER_FAULT = 13;
51    const MONITORED_OBJECT_FAULT = 14;
52    const TRIPPED = 15;
53    const LAMP_FAILURE = 16;
54    const ACTIVATION_FAILURE = 17;
55    const RENEW_DHCP_FAILURE = 18;
56    const RENEW_FD_REGISTRATION_FAILURE = 19;
57    const RESTART_AUTO_NEGOTIATION_FAILURE = 20;
58    const RESTART_FAILURE = 21;
59    const PROPRIETARY_COMMAND_FAILURE = 22;
60    const FAULTS_LISTED = 23;
61    const REFERENCED_OBJECT_FAULT = 24;
62    const MULTI_STATE_OUT_OF_RANGE = 25;
63}
64
65bacnet_enum! {
66    /// BACnet device status (Clause 12.11 (System_Status)).
67    pub struct DeviceStatus(u32);
68
69    const OPERATIONAL = 0;
70    const OPERATIONAL_READ_ONLY = 1;
71    const DOWNLOAD_REQUIRED = 2;
72    const DOWNLOAD_IN_PROGRESS = 3;
73    const NON_OPERATIONAL = 4;
74    const BACKUP_IN_PROGRESS = 5;
75}
76
77bacnet_enum! {
78    /// BACnet restart reason for a Device's Last_Restart_Reason (Clause 12.11).
79    pub struct RestartReason(u32);
80
81    const UNKNOWN = 0;
82    const COLDSTART = 1;
83    const WARMSTART = 2;
84    const DETECTED_POWER_LOST = 3;
85    const DETECTED_POWERED_OFF = 4;
86    const HARDWARE_WATCHDOG = 5;
87    const SOFTWARE_WATCHDOG = 6;
88    const SUSPENDED = 7;
89    const ACTIVATE_CHANGES = 8;
90}
91
92bacnet_enum! {
93    /// BACnet enable/disable (Clause 16.1).
94    pub struct EnableDisable(u32);
95
96    const ENABLE = 0;
97    /// Deprecated in revision 20; use DISABLE_INITIATION instead.
98    const DISABLE = 1;
99    const DISABLE_INITIATION = 2;
100}
101
102bacnet_enum! {
103    /// BACnet reinitialized state of device (Clause 16.5).
104    pub struct ReinitializedState(u32);
105
106    const COLDSTART = 0;
107    const WARMSTART = 1;
108    const START_BACKUP = 2;
109    const END_BACKUP = 3;
110    const START_RESTORE = 4;
111    const END_RESTORE = 5;
112    const ABORT_RESTORE = 6;
113    const ACTIVATE_CHANGES = 7;
114}
115
116bacnet_enum! {
117    /// BACnet file access method (Clause 21 production; File object,
118    /// Clause 12.13). Wire order mirrors the production: record-access
119    /// precedes stream-access.
120    pub struct FileAccessMethod(u32);
121
122    const RECORD_ACCESS = 0;
123    const STREAM_ACCESS = 1;
124}
125
126bacnet_enum! {
127    /// BACnet program state (Clause 12.22).
128    pub struct ProgramState(u32);
129
130    const IDLE = 0;
131    const LOADING = 1;
132    const RUNNING = 2;
133    const WAITING = 3;
134    const HALTED = 4;
135    const UNLOADING = 5;
136}
137
138bacnet_enum! {
139    /// BACnet program request (Clause 12.22).
140    pub struct ProgramChange(u32);
141
142    const READY = 0;
143    const LOAD = 1;
144    const RUN = 2;
145    const HALT = 3;
146    const RESTART = 4;
147    const UNLOAD = 5;
148}
149
150bacnet_enum! {
151    /// BACnet program error for Reason_For_Halt (Clause 12.22).
152    pub struct ProgramError(u32);
153
154    const NORMAL = 0;
155    const LOAD_FAILED = 1;
156    const INTERNAL = 2;
157    const PROGRAM = 3;
158    const OTHER = 4;
159}
160
161bacnet_enum! {
162    /// BACnet action (Clause 12.17).
163    pub struct Action(u32);
164
165    const DIRECT = 0;
166    const REVERSE = 1;
167}
168
169bacnet_enum! {
170    /// BACnet event type (Clause 12.12 (Event_Type)).
171    pub struct EventType(u32);
172
173    const CHANGE_OF_BITSTRING = 0;
174    const CHANGE_OF_STATE = 1;
175    const CHANGE_OF_VALUE = 2;
176    const COMMAND_FAILURE = 3;
177    const FLOATING_LIMIT = 4;
178    const OUT_OF_RANGE = 5;
179    // 6: kept clear for proprietary event types — the parameters ride the
180    //    complex-event-type CHOICE [6] of BACnetNotificationParameters, so
181    //    the enumeration itself assigns no tag-6 enumerand (Clause 21).
182    // 7: context tag 7 is deprecated (Clause 21 production comment).
183    const CHANGE_OF_LIFE_SAFETY = 8;
184    const EXTENDED = 9;
185    const BUFFER_READY = 10;
186    const UNSIGNED_RANGE = 11;
187    // 12: reserved
188    const ACCESS_EVENT = 13;
189    const DOUBLE_OUT_OF_RANGE = 14;
190    const SIGNED_OUT_OF_RANGE = 15;
191    const UNSIGNED_OUT_OF_RANGE = 16;
192    const CHANGE_OF_CHARACTERSTRING = 17;
193    const CHANGE_OF_STATUS_FLAGS = 18;
194    const CHANGE_OF_RELIABILITY = 19;
195    const NONE = 20;
196    const CHANGE_OF_DISCRETE_VALUE = 21;
197    const CHANGE_OF_TIMER = 22;
198}
199
200bacnet_enum! {
201    /// BACnet fault algorithm type (Clause 21.6).
202    pub struct FaultType(u32);
203
204    const NONE = 0;
205    const FAULT_CHARACTERSTRING = 1;
206    const FAULT_EXTENDED = 2;
207    const FAULT_LIFE_SAFETY = 3;
208    const FAULT_STATE = 4;
209    const FAULT_STATUS_FLAGS = 5;
210    const FAULT_OUT_OF_RANGE = 6;
211    const FAULT_LISTED = 7;
212}
213
214bacnet_enum! {
215    /// BACnet notify type (Clause 12.21).
216    pub struct NotifyType(u32);
217
218    const ALARM = 0;
219    const EVENT = 1;
220    const ACK_NOTIFICATION = 2;
221}
222
223bacnet_enum! {
224    /// BACnet backup and restore state (Clause 19.1).
225    pub struct BackupAndRestoreState(u32);
226
227    const IDLE = 0;
228    const PREPARING_FOR_BACKUP = 1;
229    const PREPARING_FOR_RESTORE = 2;
230    const PERFORMING_A_BACKUP = 3;
231    const PERFORMING_A_RESTORE = 4;
232    const BACKUP_FAILURE = 5;
233    const RESTORE_FAILURE = 6;
234}
235
236bacnet_enum! {
237    /// BACnet logging type (Clause 12.25 (Logging_Type)).
238    pub struct LoggingType(u32);
239
240    const POLLED = 0;
241    const COV = 1;
242    const TRIGGERED = 2;
243}