wled_json_api_library/structures/cfg/
cfg_nw.rs

1use serde;
2use serde::{Serialize, Deserialize};
3use crate::structures::none_function;
4
5
6
7#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct Nw {
10    /// honestly no idea why this is a vector, WLED source only uses one element
11    #[serde(skip_serializing_if = "Option::is_none")]
12    #[serde(default = "none_function")]
13    pub ins: Option<Vec<In>>,
14}
15
16#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
17#[serde(rename_all = "camelCase")]
18pub struct In {
19    /// SSID of the network to connect to
20    #[serde(skip_serializing_if = "Option::is_none")]
21    #[serde(default = "none_function")]
22    pub ssid: Option<String>,
23
24    /// Length of the wifi password
25    #[serde(skip_serializing_if = "Option::is_none")]
26    #[serde(default = "none_function")]
27    pub pskl: Option<usize>,
28
29    /// static IP of ESP
30    #[serde(skip_serializing_if = "Option::is_none")]
31    #[serde(default = "none_function")]
32    pub ip: Option<[u8; 4]>,
33
34    /// gateway (router) IP
35    #[serde(skip_serializing_if = "Option::is_none")]
36    #[serde(default = "none_function")]
37    pub gw: Option<[u8; 4]>,
38
39    /// most common subnet in home networks is 255:255:255:0
40    #[serde(skip_serializing_if = "Option::is_none")]
41    #[serde(default = "none_function")]
42    pub sn: Option<[u8; 4]>,
43}