Skip to content

Commit 9b3d616

Browse files
committed
binary mountpoint override not available, restore String instead of std::string
1 parent da857ac commit 9b3d616

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
@@ -316,10 +316,9 @@ unsigned long arduino::WiFiClass::getTime() {
316316

317317
#if defined(COMPONENT_4343W_FS)
318318

319-
#define WIFI_FIRMWARE_NAME "4343WA1.BIN"
319+
#define WIFI_FIRMWARE_PATH "/wlan/4343WA1.BIN"
320320

321321
bool firmware_available = false;
322-
static std::string fullname;
323322

324323
#include "wiced_filesystem.h"
325324
#include "resources.h"
@@ -342,21 +341,17 @@ wiced_result_t whd_firmware_check_hook(const char *mounted_name, int mount_err)
342341
{
343342
DIR *dir;
344343
struct dirent *ent;
345-
std::string dir_name(mounted_name);
344+
String dir_name(mounted_name);
346345
if(mount_err) {
347346
wiced_filesystem_mount_error();
348347
} else {
349348
if ((dir = opendir(mounted_name)) != NULL) {
350349
// print all the files and directories within directory
351350
while ((ent = readdir(dir)) != NULL) {
352-
fullname = "/"+ dir_name + "/" + std::string(ent->d_name);
353-
if (std::string(ent->d_name) == WIFI_FIRMWARE_NAME) {
351+
String fullname = "/" + dir_name + "/" + String(ent->d_name);
352+
if (fullname == WIFI_FIRMWARE_PATH) {
354353
closedir(dir);
355354
firmware_available = true;
356-
// Update Mbed resource default mount point /wlan
357-
wifi_firmware_image.val.fs.filename = (const char*)fullname.c_str();
358-
//Serial.println(fullname.c_str());
359-
//Serial.println((char*)(wifi_firmware_image.val.fs.filename));
360355
return WICED_SUCCESS;
361356
}
362357
}

0 commit comments

Comments
 (0)