Skip to content

Commit 93f228c

Browse files
committed
binary mountpoint override not available, restore String instead of std::string
1 parent bd03261 commit 93f228c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

libraries/WiFi/src/WiFi.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,9 @@ void arduino::WiFiClass::feedWatchdog()
328328

329329
#if defined(COMPONENT_4343W_FS)
330330

331-
#define WIFI_FIRMWARE_NAME "4343WA1.BIN"
331+
#define WIFI_FIRMWARE_PATH "/wlan/4343WA1.BIN"
332332

333333
bool firmware_available = false;
334-
static std::string fullname;
335334

336335
#include "wiced_filesystem.h"
337336
#include "resources.h"
@@ -354,21 +353,17 @@ wiced_result_t whd_firmware_check_hook(const char *mounted_name, int mount_err)
354353
{
355354
DIR *dir;
356355
struct dirent *ent;
357-
std::string dir_name(mounted_name);
356+
String dir_name(mounted_name);
358357
if(mount_err) {
359358
wiced_filesystem_mount_error();
360359
} else {
361360
if ((dir = opendir(mounted_name)) != NULL) {
362361
// print all the files and directories within directory
363362
while ((ent = readdir(dir)) != NULL) {
364-
fullname = "/"+ dir_name + "/" + std::string(ent->d_name);
365-
if (std::string(ent->d_name) == WIFI_FIRMWARE_NAME) {
363+
String fullname = "/" + dir_name + "/" + String(ent->d_name);
364+
if (fullname == WIFI_FIRMWARE_PATH) {
366365
closedir(dir);
367366
firmware_available = true;
368-
// Update Mbed resource default mount point /wlan
369-
wifi_firmware_image.val.fs.filename = (const char*)fullname.c_str();
370-
//Serial.println(fullname.c_str());
371-
//Serial.println((char*)(wifi_firmware_image.val.fs.filename));
372367
return WICED_SUCCESS;
373368
}
374369
}

0 commit comments

Comments
 (0)