Skip to content

Commit

Permalink
Merge pull request #385 from pennam/c33-mac-address
Browse files Browse the repository at this point in the history
Portenta C33 WiFi: get STA MAC address as default
  • Loading branch information
pennam authored Nov 20, 2024
2 parents b2cfa2c + 0bf43f1 commit 273873d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions libraries/WiFi/src/WiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,13 @@ void CWifi::end(void) {
/* -------------------------------------------------------------------------- */
uint8_t* CWifi::macAddress(uint8_t* mac) {
/* -------------------------------------------------------------------------- */
if(ni != nullptr) {
if(ni->getMacAddress(mac) == WL_MAC_ADDR_LENGTH) {
return mac;
}
if(ni == nullptr) {
ni = CLwipIf::getInstance().get(NI_WIFI_STATION);
}

if(ni->getMacAddress(mac) != WL_MAC_ADDR_LENGTH) {
memset(mac, 0x00, 6);
}
memset(mac,0x00,6);
return mac;
}

Expand Down

0 comments on commit 273873d

Please sign in to comment.