1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! The constructed value of a Lighting Output's Lighting_Command (Clause
//! 12.54).
use crateLightingOperation;
/// `BACnetLightingCommand` (Clause 21): a lighting operation and the
/// parameters it may carry.
///
/// A Lighting Output serves the last one written as Lighting_Command, and a
/// Channel can pass one to its members (Clause 12.53). On the wire it is a
/// SEQUENCE of primitive context tags in ascending order: the operation `[0]`,
/// then whichever of the target level `[1]`, ramp rate `[2]`, step increment
/// `[3]` (each a REAL), fade time `[4]` and priority `[5]` (each an Unsigned)
/// are present. The `bacnet-encoding` crate owns the codec.
///
/// The type holds any values that fit its fields. Which fields an operation
/// uses, and their ranges, are for the object that takes the command to
/// check; a Lighting Output does so on every write (Table 12-67).
///
/// ```
/// use bacnet_types::constructed::BACnetLightingCommand;
/// use bacnet_types::enums::LightingOperation;
///
/// // Fade to 40 % over two seconds at priority 8.
/// let fade = BACnetLightingCommand {
/// target_level: Some(40.0),
/// fade_time: Some(2_000),
/// priority: Some(8),
/// ..BACnetLightingCommand::new(LightingOperation::FADE_TO)
/// };
/// assert_eq!(fade.ramp_rate, None);
/// ```