@@ -170,14 +170,23 @@ struct WiFiConfig_t : BaseConfigModel
170170 // default constructor used for loading
171171 WiFiConfig_t (Preferences* pref) : BaseConfigModel(pref) {}
172172
173- WiFiConfig_t (Preferences* pref, const uint8_t index, std::string name, std::string ssid, std::string password, const uint8_t channel, const uint8_t power)
174- : BaseConfigModel(pref), index(index), name(std::move(name)), ssid(std::move(ssid)), password(std::move(password)), channel(channel), power(power)
173+ WiFiConfig_t (Preferences* pref, const uint8_t index, std::string name, std::string ssid, std::string bssid, std::string password, const uint8_t channel,
174+ const uint8_t power)
175+ : BaseConfigModel(pref),
176+ index (index),
177+ name(std::move(name)),
178+ ssid(std::move(ssid)),
179+ bssid(std::move(bssid)),
180+ password(std::move(password)),
181+ channel(channel),
182+ power(power)
175183 {
176184 }
177185
178186 uint8_t index;
179187 std::string name;
180188 std::string ssid;
189+ std::string bssid;
181190 std::string password;
182191 uint8_t channel;
183192 uint8_t power;
@@ -190,6 +199,7 @@ struct WiFiConfig_t : BaseConfigModel
190199 auto const iter_str = std::string (Helpers::itoa (index, buffer, 10 ));
191200 this ->name = this ->pref ->getString ((" name" + iter_str).c_str (), " " );
192201 this ->ssid = this ->pref ->getString ((" ssid" + iter_str).c_str (), " " );
202+ this ->bssid = this ->pref ->getString ((" bssid" + iter_str).c_str (), " " );
193203 this ->password = this ->pref ->getString ((" password" + iter_str).c_str (), " " );
194204 this ->channel = this ->pref ->getUInt ((" channel" + iter_str).c_str ());
195205 this ->power = this ->pref ->getUInt ((" power" + iter_str).c_str ());
@@ -204,6 +214,7 @@ struct WiFiConfig_t : BaseConfigModel
204214
205215 this ->pref ->putString ((" name" + iter_str).c_str (), this ->name .c_str ());
206216 this ->pref ->putString ((" ssid" + iter_str).c_str (), this ->ssid .c_str ());
217+ this ->pref ->putString ((" bssid" + iter_str).c_str (), this ->bssid .c_str ());
207218 this ->pref ->putString ((" password" + iter_str).c_str (), this ->password .c_str ());
208219 this ->pref ->putUInt ((" channel" + iter_str).c_str (), this ->channel );
209220 this ->pref ->putUInt ((" power" + iter_str).c_str (), this ->power );
@@ -213,8 +224,8 @@ struct WiFiConfig_t : BaseConfigModel
213224
214225 std::string toRepresentation ()
215226 {
216- return Helpers::format_string (" {\" name\" : \" %s\" , \" ssid\" : \" %s\" , \" password\" : \" %s\" , \" channel\" : %u, \" power\" : %u}" , this -> name . c_str () ,
217- this ->ssid .c_str (), this ->password .c_str (), this ->channel , this ->power );
227+ return Helpers::format_string (" {\" name\" : \" %s\" , \" ssid\" : \" %s\" , \" bssid \" : \" %s \" , \" password\" : \" %s\" , \" channel\" : %u, \" power\" : %u}" ,
228+ this ->name . c_str (), this -> ssid . c_str (), this -> bssid .c_str (), this ->password .c_str (), this ->channel , this ->power );
218229 };
219230};
220231
0 commit comments