Skip to content

Commit

Permalink
WiFiS3 - macAddress() return normal bytes ordering
Browse files Browse the repository at this point in the history
BSSID was not reversed so examples printed it reversed
  • Loading branch information
JAndrassy committed Nov 10, 2023
1 parent 9a838ba commit 6056c99
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 15 deletions.
8 changes: 4 additions & 4 deletions libraries/WiFiS3/examples/ConnectWithWPA/ConnectWithWPA.ino
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ void printCurrentNet() {
}

void printMacAddress(byte mac[]) {
for (int i = 5; i >= 0; i--) {
for (int i = 0; i < 6; i++) {
if (i > 0) {
Serial.print(":");
}
if (mac[i] < 16) {
Serial.print("0");
}
Serial.print(mac[i], HEX);
if (i > 0) {
Serial.print(":");
}
}
Serial.println();
}
10 changes: 5 additions & 5 deletions libraries/WiFiS3/examples/ScanNetworks/ScanNetworks.ino
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
connect to any network, so no encryption scheme is specified.
Circuit:
* Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)
* Uno R4 WiFi
created 13 July 2010
by dlf (Metodo2 srl)
Expand Down Expand Up @@ -108,14 +108,14 @@ void printEncryptionType(int thisType) {


void printMacAddress(byte mac[]) {
for (int i = 5; i >= 0; i--) {
for (int i = 0; i < 6; i++) {
if (i > 0) {
Serial.print(":");
}
if (mac[i] < 16) {
Serial.print("0");
}
Serial.print(mac[i], HEX);
if (i > 0) {
Serial.print(":");
}
}
Serial.println();
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
BSSID and WiFi channel are printed
Circuit:
* Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)
* Uno R4 WiFi
This example is based on ScanNetworks
Expand Down Expand Up @@ -130,14 +130,14 @@ void print2Digits(byte thisByte) {
}

void printMacAddress(byte mac[]) {
for (int i = 5; i >= 0; i--) {
for (int i = 0; i < 6; i++) {
if (i > 0) {
Serial.print(":");
}
if (mac[i] < 16) {
Serial.print("0");
}
Serial.print(mac[i], HEX);
if (i > 0) {
Serial.print(":");
}
}
Serial.println();
}
1 change: 0 additions & 1 deletion libraries/WiFiS3/src/WiFi.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class CWifi {
private:
void _config(IPAddress local_ip, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2);
unsigned long _timeout;
uint8_t mac[6];
std::vector<CAccessPoint> access_points;
std::string ssid;
std::string apssid;
Expand Down

0 comments on commit 6056c99

Please sign in to comment.