Skip to content

Commit 1bbcfff

Browse files
author
Cruz Monrreal
authored
Merge pull request #8566 from u-blox/github8520issue
Wifi: ublox fix to keep the credentials stored
2 parents 9226c58 + 74ce0b7 commit 1bbcfff

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,8 +220,8 @@ nsapi_error_t OdinWiFiInterface::set_credentials(const char *ssid, const char *p
220220
osStatus res = _mutex.lock();
221221
MBED_ASSERT(res == osOK);
222222

223-
_sta.ssid = ssid;
224-
_sta.passwd = pass;
223+
strncpy(_sta.ssid, ssid, cbWLAN_SSID_MAX_LENGTH);
224+
strncpy(_sta.passwd, pass, cbWLAN_MAX_PASSPHRASE_LENGTH);
225225
_sta.security = security;
226226

227227
res = _mutex.unlock();

targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_MODULE_UBLOX_ODIN_W2/sdk/ublox-odin-w2-drivers/OdinWiFiInterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@ class OdinWiFiInterface : public WiFiInterface, public EMACInterface
262262
};
263263

264264
struct sta_s {
265-
const char *ssid;
266-
const char *passwd;
265+
char ssid[cbWLAN_SSID_MAX_LENGTH];
266+
char passwd[cbWLAN_MAX_PASSPHRASE_LENGTH];
267267
nsapi_security_t security;
268268
uint8_t channel;
269269
int timeout_ms;

0 commit comments

Comments
 (0)