File tree 4 files changed +14
-20
lines changed
4 files changed +14
-20
lines changed Original file line number Diff line number Diff line change @@ -97,14 +97,14 @@ void printCurrentNet() {
97
97
}
98
98
99
99
void printMacAddress (byte mac[]) {
100
- for (int i = 5 ; i >= 0 ; i--) {
100
+ for (int i = 0 ; i < 6 ; i++) {
101
+ if (i > 0 ) {
102
+ Serial.print (" :" );
103
+ }
101
104
if (mac[i] < 16 ) {
102
105
Serial.print (" 0" );
103
106
}
104
107
Serial.print (mac[i], HEX);
105
- if (i > 0 ) {
106
- Serial.print (" :" );
107
- }
108
108
}
109
109
Serial.println ();
110
110
}
Original file line number Diff line number Diff line change 5
5
connect to any network, so no encryption scheme is specified.
6
6
7
7
Circuit:
8
- * Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)
8
+ * Portenta C33
9
9
10
10
created 13 July 2010
11
11
by dlf (Metodo2 srl)
@@ -108,14 +108,14 @@ void printEncryptionType(int thisType) {
108
108
}
109
109
110
110
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
+ }
112
115
if (mac[i] < 16 ) {
113
116
Serial.print (" 0" );
114
117
}
115
118
Serial.print (mac[i], HEX);
116
- if (i > 0 ) {
117
- Serial.print (" :" );
118
- }
119
119
}
120
120
Serial.println ();
121
121
}
Original file line number Diff line number Diff line change 6
6
BSSID and WiFi channel are printed
7
7
8
8
Circuit:
9
- * Board with NINA module (Arduino MKR WiFi 1010, MKR VIDOR 4000 and Uno WiFi Rev.2)
9
+ * Portenta C33
10
10
11
11
This example is based on ScanNetworks
12
12
@@ -130,14 +130,14 @@ void print2Digits(byte thisByte) {
130
130
}
131
131
132
132
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
+ }
134
137
if (mac[i] < 16 ) {
135
138
Serial.print (" 0" );
136
139
}
137
140
Serial.print (mac[i], HEX);
138
- if (i > 0 ) {
139
- Serial.print (" :" );
140
- }
141
141
}
142
142
Serial.println ();
143
143
}
Original file line number Diff line number Diff line change @@ -172,12 +172,6 @@ uint8_t* CWifi::macAddress(uint8_t* mac) {
172
172
/* -------------------------------------------------------------------------- */
173
173
if (ni != nullptr ) {
174
174
if (ni->getMacAddress (mac) == WL_MAC_ADDR_LENGTH) {
175
- // internal mac address representation is inverted
176
- for (int i = 0 ; i<3 ; i++) {
177
- auto tmp = mac[i];
178
- mac[i] = mac[5 -i];
179
- mac[5 -i] = tmp;
180
- }
181
175
return mac;
182
176
}
183
177
}
You can’t perform that action at this time.
0 commit comments