Skip to content

Commit d478399

Browse files
committed
Merge remote-tracking branch 'origin/wifi_leven_dev' into wifi_leven_dev
Former-commit-id: 6a75cfb
2 parents 6739d37 + e457c5e commit d478399

File tree

2 files changed

+32
-13
lines changed

2 files changed

+32
-13
lines changed

libraries/WiFiS3/src/WiFi.cpp

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -421,26 +421,45 @@ uint8_t CWifi::channel(uint8_t networkItem) {
421421

422422
/* -------------------------------------------------------------------------- */
423423
const char* CWifi::SSID() {
424-
/* -------------------------------------------------------------------------- */
425-
return "";
424+
/* -------------------------------------------------------------------------- */
425+
string res = "";
426+
if(modem.write(string(PROMPT(_GETSSID)), res, CMD_READ(_GETSSID))) {
427+
return res.c_str();
428+
}
429+
return "";
426430
}
427431

428432
/* -------------------------------------------------------------------------- */
429433
uint8_t* CWifi::BSSID(uint8_t* bssid) {
430434
/* -------------------------------------------------------------------------- */
431-
return nullptr;
435+
string res = "";
436+
if(modem.write(string(PROMPT(_GETBSSID)), res, CMD_READ(_GETBSSID))) {
437+
Serial.print("BSSID: ");
438+
Serial.println(res.c_str());
439+
macStr2macArray(bssid, res.c_str());
440+
return bssid;
441+
}
442+
return nullptr;
432443
}
433444

434445
/* -------------------------------------------------------------------------- */
435446
int32_t CWifi::RSSI() {
436-
/* -------------------------------------------------------------------------- */
437-
return 0;
447+
/* -------------------------------------------------------------------------- */
448+
string res = "";
449+
if(modem.write(string(PROMPT(_GETRSSI)), res, CMD_READ(_GETRSSI))) {
450+
return atoi(res.c_str());
451+
}
452+
return 0;
438453
}
439454

440455
/* -------------------------------------------------------------------------- */
441-
uint8_t CWifi::encryptionType() {
456+
const char* CWifi::softAPSSID() {
442457
/* -------------------------------------------------------------------------- */
443-
return 0;
458+
string res = "";
459+
if(modem.write(string(PROMPT(_GETSOFTAPSSID)), res, CMD_READ(_GETSOFTAPSSID))) {
460+
return res.c_str();
461+
}
462+
return "";
444463
}
445464

446465
/* -------------------------------------------------------------------------- */

libraries/WiFiS3/src/WiFi.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ class CWifi {
177177

178178
/*
179179
* Return the current BSSID associated with the network.
180-
* It is the MAC address of the Access Point
181180
*
182181
* return: pointer to uint8_t array with length WL_MAC_ADDR_LENGTH
183182
*/
@@ -192,11 +191,12 @@ class CWifi {
192191
int32_t RSSI();
193192

194193
/*
195-
* Return the Encryption Type associated with the network
196-
*
197-
* return: one value of wl_enc_type enum
198-
*/
199-
uint8_t encryptionType();
194+
* Return the current SSID associated with to the soft AP
195+
*
196+
* return: ssid string
197+
*/
198+
const char* softAPSSID();
199+
200200

201201
/*
202202
* Start scan WiFi networks available

0 commit comments

Comments
 (0)