Open Model Railroad Network (OpenMRN)
Loading...
Searching...
No Matches
Esp32WiFiConfiguration.hxx
Go to the documentation of this file.
1
35#ifndef _FREERTOS_DRIVERS_ESP32_ESP32WIFICONFIG_HXX_
36#define _FREERTOS_DRIVERS_ESP32_ESP32WIFICONFIG_HXX_
37
40
41namespace openmrn_arduino
42{
43
46{
47public:
50 static constexpr const char *BOOLEAN_MAP =
51 "<relation><property>0</property><value>No</value></relation>"
52 "<relation><property>1</property><value>Yes</value></relation>";
53
55 static constexpr const char *WIFI_POWER_SAVE_NAME =
56 "WiFi Power Savings Mode";
57
59 static constexpr const char *WIFI_POWER_SAVE_DESC =
60 "When enabled this allows the ESP32 WiFi radio to use power savings "
61 "mode which puts the radio to sleep except to receive beacon updates "
62 "from the connected SSID. This should generally not need to be "
63 "enabled unless you are powering the ESP32 from a battery.";
64
66 static constexpr const char *HUB_NAME = "Hub Configuration";
67
69 static constexpr const char *HUB_DESC =
70 "Configuration settings for an OpenLCB Hub";
71
73 static constexpr const char *CONN_MODE_NAME = "Connection Mode";
74
76 static constexpr const char *CONN_MODE_DESC =
77 "Defines whether to allow accepting connections (according to the Hub "
78 "configuration), making a connection (according to the Uplink "
79 "configuration), or both.\nThis setting can be set to Disabled if the "
80 "ESP32 will be using the TWAI (CAN) driver instead for the connection "
81 "to other nodes.\nNote: it is not recommended to enable the Hub "
82 "functionality on single-core ESP32 models.";
83
86 static constexpr const char *CONN_MODE_MAP =
87 "<relation><property>0</property><value>Disabled</value></relation>"
88 "<relation><property>1</property><value>Uplink Only</value></relation>"
89 "<relation><property>2</property><value>Hub Only</value></relation>"
90 "<relation><property>3</property><value>Hub+Uplink</value></relation>";
91
93 static constexpr const char *HUB_LISTENER_PORT_NAME = "Hub Listener Port";
94
96 static constexpr const char *HUB_LISTENER_PORT_DESC =
97 "Defines the TCP/IP listener port this node will use when operating "
98 "as a hub. Most of the time this does not need to be changed.";
99
101 static constexpr const char *UPLINK_NAME = "Node Uplink Configuration";
102
104 static constexpr const char *UPLINK_DESC =
105 "Configures how this node will connect to other nodes.";
106};
107
109CDI_GROUP(HubConfiguration);
122
124CDI_GROUP(WiFiConfiguration);
130 Min(0), Max(1), Default(0), /* Off */
136 Min(0), Max(3), Default(1), /* Uplink only */
139CDI_GROUP_ENTRY(hub, HubConfiguration,
144 openlcb::TcpClientConfig<openlcb::TcpClientDefaultParams>,
147CDI_GROUP_ENTRY(reserved, openlcb::BytesConfigEntry<6>, Hidden(true));
149
150} // namespace openmrn_arduino
151
152using openmrn_arduino::WiFiConfiguration;
153
154#endif // _FREERTOS_DRIVERS_ESP32_ESP32WIFICONFIG_HXX_
#define CDI_GROUP_END()
Closes a CDI group structure definition.
#define CDI_GROUP(GroupName, ARGS...)
Starts a CDI group.
#define CDI_GROUP_ENTRY(NAME, TYPE, ARGS...)
Adds an entry to a CDI group.
Implementation class for internal data bytes configuration entries.
Implementation class for numeric configuration entries, templated by the integer type.
Implementation class for string configuration entries.
static constexpr const char * SERVICE_NAME
Visible name of the service name field in the auto address group.
static constexpr const char * SERVICE_DESCR
Visible description of the service name field in the auto address group.
static constexpr int DEFAULT_PORT
Default value for the port number field.
Names and Descriptions for all ESP32 exposed WiFi configuration options.
static constexpr const char * WIFI_POWER_SAVE_DESC
Visible description for the WiFi Power Savings mode.
static constexpr const char * HUB_DESC
Visible description for the Hub Configuration group.
static constexpr const char * BOOLEAN_MAP
<map> of possible keys and descriptive values to show to the user for the wifi_sleep and hub_mode fie...
static constexpr const char * HUB_LISTENER_PORT_NAME
Visible name for the hub_listener_port field.
static constexpr const char * CONN_MODE_NAME
Visible name for the hub/uplink enable field.
static constexpr const char * CONN_MODE_MAP
<map> of possible keys and descriptive values to show to the user for the connection_mode fields.
static constexpr const char * HUB_NAME
Visible name for the Hub Configuration group.
static constexpr const char * WIFI_POWER_SAVE_NAME
Visible name for the WiFi Power Savings mode.
static constexpr const char * UPLINK_DESC
Visible name for the link_config group.
static constexpr const char * HUB_LISTENER_PORT_DESC
Visible name for the hub_listener_port field.
static constexpr const char * CONN_MODE_DESC
Visible description for the hub/uplink enable field.
static constexpr const char * UPLINK_NAME
Visible name for the link_config group.