Skip to content

Commit 6056c99

Browse files
committed
WiFiS3 - macAddress() return normal bytes ordering
BSSID was not reversed so examples printed it reversed
1 parent 9a838ba commit 6056c99

File tree

4 files changed

+14
-15
lines changed

4 files changed

+14
-15
lines changed

Diff for: libraries/WiFiS3/examples/ConnectWithWPA/ConnectWithWPA.ino

+4-4
Original file line numberDiff line numberDiff line change
@@ -100,14 +100,14 @@ void printCurrentNet() {
100100
}
101101

102102
void printMacAddress(byte mac[]) {
103-
for (int i = 5; i >= 0; i--) {
103+
for (int i = 0; i < 6; i++) {
104+
if (i > 0) {
105+
Serial.print(":");
106+
}
104107
if (mac[i] < 16) {
105108
Serial.print("0");
106109
}
107110
Serial.print(mac[i], HEX);
108-
if (i > 0) {
109-
Serial.print(":");
110-
}
111111
}
112112
Serial.println();
113113
}

Diff for: libraries/WiFiS3/examples/ScanNetworks/ScanNetworks.ino

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
connect to any network, so no encryption scheme is specified.
66
77
Circuit:
8-
* Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)
8+
* Uno R4 WiFi
99
1010
created 13 July 2010
1111
by dlf (Metodo2 srl)
@@ -108,14 +108,14 @@ void printEncryptionType(int thisType) {
108108

109109

110110
void printMacAddress(byte mac[]) {
111-
for (int i = 5; i >= 0; i--) {
111+
for (int i = 0; i < 6; i++) {
112+
if (i > 0) {
113+
Serial.print(":");
114+
}
112115
if (mac[i] < 16) {
113116
Serial.print("0");
114117
}
115118
Serial.print(mac[i], HEX);
116-
if (i > 0) {
117-
Serial.print(":");
118-
}
119119
}
120120
Serial.println();
121121
}

Diff for: libraries/WiFiS3/examples/ScanNetworksAdvanced/ScanNetworksAdvanced.ino

+5-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
BSSID and WiFi channel are printed
77
88
Circuit:
9-
* Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)
9+
* Uno R4 WiFi
1010
1111
This example is based on ScanNetworks
1212
@@ -130,14 +130,14 @@ void print2Digits(byte thisByte) {
130130
}
131131

132132
void printMacAddress(byte mac[]) {
133-
for (int i = 5; i >= 0; i--) {
133+
for (int i = 0; i < 6; i++) {
134+
if (i > 0) {
135+
Serial.print(":");
136+
}
134137
if (mac[i] < 16) {
135138
Serial.print("0");
136139
}
137140
Serial.print(mac[i], HEX);
138-
if (i > 0) {
139-
Serial.print(":");
140-
}
141141
}
142142
Serial.println();
143143
}

Diff for: libraries/WiFiS3/src/WiFi.h

-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ class CWifi {
3333
private:
3434
void _config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2);
3535
unsigned long _timeout;
36-
uint8_t mac[6];
3736
std::vector<CAccessPoint> access_points;
3837
std::string ssid;
3938
std::string apssid;

0 commit comments

Comments
 (0)