File tree 4 files changed +29
-0
lines changed
libraries/ESP8266WiFi/src
4 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -607,6 +607,18 @@ uint8_t* ESP8266WiFiSTAClass::BSSID(void) {
607
607
return reinterpret_cast <uint8_t *>(conf.bssid );
608
608
}
609
609
610
+ /* *
611
+ * Fill the current bssid / mac associated with the network if configured
612
+ * @param bssid pointer to uint8_t array with length WL_MAC_ADDR_LENGTH
613
+ * @return bssid uint8_t *
614
+ */
615
+ uint8_t * ESP8266WiFiSTAClass::BSSID (uint8_t * bssid) {
616
+ struct station_config conf;
617
+ wifi_station_get_config (&conf);
618
+ memcpy (bssid, conf.bssid , WL_MAC_ADDR_LENGTH);
619
+ return bssid;
620
+ }
621
+
610
622
/* *
611
623
* Return the current bssid / mac associated with the network if configured
612
624
* @return String bssid mac
Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ class ESP8266WiFiSTAClass: public LwipIntf {
79
79
String psk () const ;
80
80
81
81
uint8_t * BSSID ();
82
+ uint8_t * BSSID (uint8_t * bssid);
82
83
String BSSIDstr ();
83
84
84
85
int8_t RSSI ();
Original file line number Diff line number Diff line change @@ -259,6 +259,21 @@ uint8_t * ESP8266WiFiScanClass::BSSID(uint8_t i) {
259
259
return it->bssid ;
260
260
}
261
261
262
+ /* *
263
+ * fill MAC / BSSID of scanned wifi
264
+ * @param i specify from which network item want to get the information
265
+ * @param bssid pointer to uint8_t array with length WL_MAC_ADDR_LENGTH
266
+ * @return uint8_t * MAC / BSSID of scanned wifi
267
+ */
268
+ uint8_t * ESP8266WiFiScanClass::BSSID (uint8_t i, uint8_t * bssid) {
269
+ struct bss_info * it = reinterpret_cast <struct bss_info *>(_getScanInfoByIndex (i));
270
+ if (!it) {
271
+ return 0 ;
272
+ }
273
+ memcpy (bssid, it->bssid , WL_MAC_ADDR_LENGTH);
274
+ return bssid;
275
+ }
276
+
262
277
/* *
263
278
* return MAC / BSSID of scanned wifi
264
279
* @param i specify from which network item want to get the information
Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ class ESP8266WiFiScanClass {
48
48
uint8_t encryptionType (uint8_t networkItem);
49
49
int32_t RSSI (uint8_t networkItem);
50
50
uint8_t * BSSID (uint8_t networkItem);
51
+ uint8_t * BSSID (uint8_t networkItem, uint8_t * bssid);
51
52
String BSSIDstr (uint8_t networkItem);
52
53
int32_t channel (uint8_t networkItem);
53
54
bool isHidden (uint8_t networkItem);
You can’t perform that action at this time.
0 commit comments