fixes the credentials storage, copies them internally rather than just a pointer to external storage

pull/8637/head
Ammad Rehmat 2018-10-29 17:32:41 +05:00 committed by Cruz Monrreal II
parent 07588db248
commit 570329c0c2
2 changed files with 4 additions and 4 deletions

View File

@ -220,8 +220,8 @@ nsapi_error_t OdinWiFiInterface::set_credentials(const char *ssid, const char *p
osStatus res = _mutex.lock();
MBED_ASSERT(res == osOK);
_sta.ssid = ssid;
_sta.passwd = pass;
strncpy(_sta.ssid, ssid, cbWLAN_SSID_MAX_LENGTH);
strncpy(_sta.passwd, pass, cbWLAN_MAX_PASSPHRASE_LENGTH);
_sta.security = security;
res = _mutex.unlock();

View File

@ -262,8 +262,8 @@ private:
};
struct sta_s {
const char *ssid;
const char *passwd;
char ssid[cbWLAN_SSID_MAX_LENGTH];
char passwd[cbWLAN_MAX_PASSPHRASE_LENGTH];
nsapi_security_t security;
uint8_t channel;
int timeout_ms;