@@ -222,7 +222,7 @@ void BootWiFi::bootWiFi2() {
222
222
m_wifi.setWifiEventHandler (new BootWifiEventHandler (this ));
223
223
if (checkOverrideGpio ()) {
224
224
ESP_LOGD (LOG_TAG, " - GPIO override detected" );
225
- m_wifi.startAP (" Duktape " , " Duktape " );
225
+ m_wifi.startAP (m_ssid, m_password );
226
226
} else {
227
227
// There was NO GPIO override, proceed as normal. This means we retrieve
228
228
// our stored access point information of the access point we should connect
@@ -249,19 +249,30 @@ void BootWiFi::bootWiFi2() {
249
249
// point that serves up a web server and allow a browser user to specify
250
250
// the details that will be eventually used to allow us to connect
251
251
// as a station.
252
- m_wifi.startAP (" Duktape " , " Duktape " );
252
+ m_wifi.startAP (m_ssid, m_password );
253
253
} // We do NOT have connection info
254
254
}
255
255
ESP_LOGD (LOG_TAG, " << bootWiFi2" );
256
256
} // bootWiFi2
257
257
258
258
259
+ /* *
260
+ * @brief Set the userid/password pair that will be used for the ESP32 access point.
261
+ * @param [in] ssid The network id of the ESP32 when it becomes an access point.
262
+ * @param [in] password The password for the ESP32 when it becomes an access point.
263
+ */
264
+ void BootWiFi::setAccessPointCredentials (std::string ssid, std::string password) {
265
+ m_ssid = ssid;
266
+ m_password = password;
267
+ } // setAccessPointCredentials
268
+
259
269
260
270
void BootWiFi::boot () {
261
271
ESP_LOGD (LOG_TAG, " >> boot" );
262
272
ESP_LOGD (LOG_TAG, " +----------+" );
263
273
ESP_LOGD (LOG_TAG, " | BootWiFi |" );
264
274
ESP_LOGD (LOG_TAG, " +----------+" );
275
+ ESP_LOGD (LOG_TAG, " Access point credentials: %s/%s" , m_ssid.c_str (), m_password.c_str ());
265
276
m_completeSemaphore.take (" boot" ); // Take the semaphore which will be unlocked when we complete booting.
266
277
bootWiFi2 ();
267
278
m_completeSemaphore.wait (" boot" ); // Wait for the semaphore that indicated we have completed booting.
@@ -270,4 +281,5 @@ void BootWiFi::boot() {
270
281
271
282
BootWiFi::BootWiFi () {
272
283
m_httpServerStarted = false ;
284
+ setAccessPointCredentials (" esp32" , " password" );
273
285
}
0 commit comments