Added hidden ssid parameter

This commit is contained in:
CommanderRedYT
2022-05-25 03:10:56 +02:00
parent 840c43ef0e
commit 5eac6fd671
4 changed files with 6 additions and 1 deletions

View File

@ -12,3 +12,4 @@ struct WifiApIpAccessor : public NewSettingsAccessor<wifi_stack::ip_address_t> {
struct WifiApMaskAccessor : public NewSettingsAccessor<wifi_stack::ip_address_t> { ConfigWrapper<wifi_stack::ip_address_t> &getConfig() const override { return configs.wifiApMask; } }; struct WifiApMaskAccessor : public NewSettingsAccessor<wifi_stack::ip_address_t> { ConfigWrapper<wifi_stack::ip_address_t> &getConfig() const override { return configs.wifiApMask; } };
struct WifiApChannelAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.wifiApChannel; } }; struct WifiApChannelAccessor : public NewSettingsAccessor<uint8_t> { ConfigWrapper<uint8_t> &getConfig() const override { return configs.wifiApChannel; } };
struct WifiApAuthmodeAccessor : public NewSettingsAccessor<wifi_auth_mode_t> { ConfigWrapper<wifi_auth_mode_t> &getConfig() const override { return configs.wifiApAuthmode; } }; struct WifiApAuthmodeAccessor : public NewSettingsAccessor<wifi_auth_mode_t> { ConfigWrapper<wifi_auth_mode_t> &getConfig() const override { return configs.wifiApAuthmode; } };
struct WiFiApHiddenAccessor : public NewSettingsAccessor<bool> { ConfigWrapper<bool> &getConfig() const override { return configs.wifiApHidden; } };

View File

@ -46,6 +46,7 @@ constexpr char TEXT_CHANNEL[] = "AP Channel";
constexpr char TEXT_CHANNEL_FORMATTED[] = "&sChannel: &f"; constexpr char TEXT_CHANNEL_FORMATTED[] = "&sChannel: &f";
constexpr char TEXT_AUTHMODE[] = "AP Authmode"; constexpr char TEXT_AUTHMODE[] = "AP Authmode";
constexpr char TEXT_AUTHMODE_FORMATTED[] = "&sAuthmode: "; constexpr char TEXT_AUTHMODE_FORMATTED[] = "&sAuthmode: ";
constexpr char TEXT_HIDDEN[] = "AP Hidden";
class WifiApClientsAction : public virtual ActionInterface class WifiApClientsAction : public virtual ActionInterface
{ {
@ -106,6 +107,7 @@ WifiApSettingsMenu::WifiApSettingsMenu()
{ {
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ENABLED>, BobbyCheckbox, WifiApEnabledAccessor>>(); constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_ENABLED>, BobbyCheckbox, WifiApEnabledAccessor>>();
//constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DISABLEWHENONLINE>, BobbyCheckbox, WifiApDisableWhenOnlineAccessor>>(); //constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_DISABLEWHENONLINE>, BobbyCheckbox, WifiApDisableWhenOnlineAccessor>>();
constructMenuItem<makeComponent<MenuItem, StaticText<TEXT_HIDDEN>, BobbyCheckbox, WiFiApHiddenAccessor>>();
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_SSID_FORMATTED, WifiApSsidAccessor>, PushScreenAction<ApSsidChangeScreen>>>(); constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_SSID_FORMATTED, WifiApSsidAccessor>, PushScreenAction<ApSsidChangeScreen>>>();
constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_KEY_FORMATTED, WifiApKeyAccessor>, PushScreenAction<ApKeyChangeScreen>>>(); constructMenuItem<makeComponent<MenuItem, TextWithValueHelper<TEXT_KEY_FORMATTED, WifiApKeyAccessor>, PushScreenAction<ApKeyChangeScreen>>>();
constructMenuItem<makeComponent<MenuItem, WifiApMacText, DummyAction>>(); constructMenuItem<makeComponent<MenuItem, WifiApMacText, DummyAction>>();

View File

@ -247,6 +247,7 @@ public:
ConfigWrapperLegacy<wifi_stack::ip_address_t> wifiApMask{wifi_stack::ip_address_t{255, 255, 255, 0},DoReset, {}, "wifiApMask" }; ConfigWrapperLegacy<wifi_stack::ip_address_t> wifiApMask{wifi_stack::ip_address_t{255, 255, 255, 0},DoReset, {}, "wifiApMask" };
ConfigWrapperLegacy<uint8_t> wifiApChannel {1, DoReset, MinMaxValue<uint8_t, 1, 14>, "wifiApChannel" }; ConfigWrapperLegacy<uint8_t> wifiApChannel {1, DoReset, MinMaxValue<uint8_t, 1, 14>, "wifiApChannel" };
ConfigWrapperLegacy<wifi_auth_mode_t> wifiApAuthmode{WIFI_AUTH_WPA2_PSK, DoReset, {}, "wifiApAuthmode" }; ConfigWrapperLegacy<wifi_auth_mode_t> wifiApAuthmode{WIFI_AUTH_WPA2_PSK, DoReset, {}, "wifiApAuthmode" };
ConfigWrapperLegacy<bool> wifiApHidden {false, DoReset, {}, "wifiApHidden" };
ConfigWrapperLegacy<bool> timeServerEnabled {true, DoReset, {}, "timeServerEnabl" }; ConfigWrapperLegacy<bool> timeServerEnabled {true, DoReset, {}, "timeServerEnabl" };
ConfigWrapperLegacy<std::string> timeServer {"europe.pool.ntp.org", DoReset, StringMaxSize<64>, "timeServer" }; ConfigWrapperLegacy<std::string> timeServer {"europe.pool.ntp.org", DoReset, StringMaxSize<64>, "timeServer" };
@ -586,6 +587,7 @@ public:
x(wifiApMask) \ x(wifiApMask) \
x(wifiApChannel) \ x(wifiApChannel) \
x(wifiApAuthmode) \ x(wifiApAuthmode) \
x(wifiApHidden) \
\ \
x(timeServerEnabled) \ x(timeServerEnabled) \
x(timeServer) \ x(timeServer) \

View File

@ -137,7 +137,7 @@ std::optional<wifi_stack::ap_config> createApConfig()
}, },
.channel = configs.wifiApChannel.value(), .channel = configs.wifiApChannel.value(),
.authmode = configs.wifiApAuthmode.value(), .authmode = configs.wifiApAuthmode.value(),
.ssid_hidden = false, .ssid_hidden = configs.wifiApHidden.value(),
.max_connection = 4, .max_connection = 4,
.beacon_interval = 100, .beacon_interval = 100,
.long_range = false .long_range = false