Skip to main content

rodecaster_protocol/names/
wifi_scan_result.rs

1//! [`WifiScanResultParam`]: per-`WIFISCANRESULT`-node parameter family.
2
3// WIFISCANRESULT nodes carry a single property per scan result (confirmed
4// from capture, firmware 1.7.3): the SSID string. The device populates a
5// contiguous run of these nodes as WiFi scans complete; each holds one
6// discovered network's SSID (plus, empirically, encoding hints appended
7// with `----` separators, e.g. `"WLAN1000----PSK"`).
8wire_param_enum! {
9    /// A per-WiFi-scan-result parameter: the one flat property on each
10    /// `WIFISCANRESULT` node. The device populates these as WiFi scans
11    /// complete. Value is a String encoded as `SSID----ENCODING` (the
12    /// device appends the encryption type with a `----` separator).
13    WifiScanResultParam {
14    Ssid => "wifiScanResultSSID",
15    }
16}
17
18#[cfg(test)]
19mod tests {
20    use super::*;
21
22    #[test]
23    fn wifi_scan_result_param_round_trips() {
24        assert_eq!(
25            WifiScanResultParam::from_name("wifiScanResultSSID"),
26            WifiScanResultParam::Ssid
27        );
28        assert!(WifiScanResultParam::Ssid.is_known());
29        assert_eq!(WifiScanResultParam::Ssid.as_str(), "wifiScanResultSSID");
30    }
31}