Skip to main content

bacnet_types/enums/
lighting.rs

1// ===========================================================================
2// Lighting enums (Clause 12.54, 12.55)
3// ===========================================================================
4
5bacnet_enum! {
6    /// BACnet binary lighting present value (Clause 21).
7    pub struct BinaryLightingPV(u32);
8
9    const OFF = 0;
10    const ON = 1;
11    const WARN = 2;
12    const WARN_OFF = 3;
13    const WARN_RELINQUISH = 4;
14    const STOP = 5;
15}
16
17bacnet_enum! {
18    /// BACnet lighting operation (Clause 12.54).
19    pub struct LightingOperation(u32);
20
21    const NONE = 0;
22    const FADE_TO = 1;
23    const RAMP_TO = 2;
24    const STEP_UP = 3;
25    const STEP_DOWN = 4;
26    const STEP_ON = 5;
27    const STEP_OFF = 6;
28    const WARN = 7;
29    const WARN_OFF = 8;
30    const WARN_RELINQUISH = 9;
31    const STOP = 10;
32}
33
34bacnet_enum! {
35    /// BACnet lighting in-progress state (Clause 12.54).
36    pub struct LightingInProgress(u32);
37
38    const IDLE = 0;
39    const FADE_ACTIVE = 1;
40    const RAMP_ACTIVE = 2;
41    const NOT_CONTROLLED = 3;
42    const OTHER = 4;
43    /// Tracking_Value is held inside a Lighting Output's trims while
44    /// Present_Value lies outside them, or is following a trim change
45    /// (Addendum 135-2020ca part 5).
46    const TRIM_ACTIVE = 5;
47}
48
49bacnet_enum! {
50    /// BACnet lighting transition kind (Clause 21).
51    pub struct LightingTransition(u32);
52
53    const NONE = 0;
54    const FADE = 1;
55    const RAMP = 2;
56}
57
58// ===========================================================================
59// Color enums (Addendum 135-2020ca)
60// ===========================================================================
61
62bacnet_enum! {
63    /// BACnet colour operation: the `operation` of a `BACnetColorCommand`
64    /// (Addendum 135-2020ca, Clause 21).
65    ///
66    /// A Color object takes FADE_TO_COLOR and STOP; a Color Temperature
67    /// object takes the four CCT operations and STOP. The addendum doesn't
68    /// open the enumeration to vendors, so neither object takes any other
69    /// value.
70    pub struct ColorOperation(u32);
71
72    const NONE = 0;
73    const FADE_TO_COLOR = 1;
74    const FADE_TO_CCT = 2;
75    const RAMP_TO_CCT = 3;
76    const STEP_UP_CCT = 4;
77    const STEP_DOWN_CCT = 5;
78    const STOP = 6;
79}
80
81bacnet_enum! {
82    /// BACnet colour in-progress state, which both colour object types
83    /// report as In_Progress (Addendum 135-2020ca, Clause 21). A Color
84    /// object has no ramp, so it never reports RAMP_ACTIVE.
85    pub struct ColorOperationInProgress(u32);
86
87    const IDLE = 0;
88    const FADE_ACTIVE = 1;
89    const RAMP_ACTIVE = 2;
90    const NOT_CONTROLLED = 3;
91    const OTHER = 4;
92}
93
94bacnet_enum! {
95    /// BACnet colour transition: how either colour object type moves to a
96    /// Present_Value written to it (Addendum 135-2020ca, Clause 21). A Color
97    /// object takes NONE and FADE only.
98    pub struct ColorTransition(u32);
99
100    const NONE = 0;
101    const FADE = 1;
102    const RAMP = 2;
103}