File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -483,12 +483,14 @@ const char* CWifi::SSID() {
483483 if (modem.write (string (PROMPT (_MODE)),res, " %s" , CMD_READ (_MODE))) {
484484 if (atoi (res.c_str ()) == 1 ) {
485485 if (modem.write (string (PROMPT (_GETSSID)), res, CMD_READ (_GETSSID))) {
486- return res.c_str ();
486+ ssid = res;
487+ return ssid.c_str ();
487488 }
488489 }
489490 else if (atoi (res.c_str ()) == 2 ) {
490491 if (modem.write (string (PROMPT (_GETSOFTAPSSID)), res, CMD_READ (_GETSOFTAPSSID))) {
491- return res.c_str ();
492+ apssid = res;
493+ return apssid.c_str ();
492494 }
493495 }
494496 }
@@ -521,7 +523,8 @@ const char* CWifi::softAPSSID() {
521523/* -------------------------------------------------------------------------- */
522524 string res = " " ;
523525 if (modem.write (string (PROMPT (_GETSOFTAPSSID)), res, CMD_READ (_GETSOFTAPSSID))) {
524- return res.c_str ();
526+ apssid = res;
527+ return apssid.c_str ();
525528 }
526529 return " " ;
527530}
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ class CWifi {
3535 unsigned long _timeout;
3636 uint8_t mac[6 ];
3737 std::vector<CAccessPoint> access_points;
38+ std::string ssid;
39+ std::string apssid;
3840
3941
4042 IPAddress ip_ap = DEFAULT_IP_AP_ADDRESS;
You can’t perform that action at this time.
0 commit comments