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
//! [`TestParam`]: the singleton `TEST`-node parameter family.
// The two properties the TEST node carries (confirmed from capture, firmware
// 1.7.3). Diagnostic / factory-test channels: writing `AllLedsWhite` turns
// every front-panel LED white for hardware inspection; `ToneGeneration`
// selects an internal test tone.
wire_param_enum! {
/// A device-diagnostic parameter: the two flat properties on the
/// singleton `TEST` node. `AllLedsWhite` is a factory-test command
/// (writing `Int(1)` engages the all-LEDs-white mode; verified on Duo
/// fw 1.7.3, write persists across refresh); `ToneGeneration` selects
/// an internal test-tone source for audio-path verification. Both wire
/// types are `Int`; the crate types the property name only.
///
/// Firmware wire name preserves the capitalized "LEDS" (`allLEDSWhite`).
TestParam {
AllLedsWhite => "allLEDSWhite",
ToneGeneration => "toneGeneration",
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_param_round_trips() {
for p in [TestParam::AllLedsWhite, TestParam::ToneGeneration] {
assert_eq!(TestParam::from_name(p.as_str()), p);
assert!(p.is_known());
}
}
#[test]
fn test_param_preserves_leds_capitalization() {
assert_eq!(TestParam::AllLedsWhite.as_str(), "allLEDSWhite");
}
}