Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CC32xx set mac feature #478

Merged
merged 3 commits into from
Nov 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/freertos_drivers/net_cc32xx/CC32xxWiFi.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,14 @@ void CC32xxWiFi::wlan_mac(uint8_t mac[6])
sl_NetCfgGet(SL_NETCFG_MAC_ADDRESS_GET, nullptr, &len, mac);
}

/*
* CC32xxWiFi::wlan_set_mac()
*/
void CC32xxWiFi::wlan_set_mac(uint8_t mac[6])
{
sl_NetCfgSet(SL_NETCFG_MAC_ADDRESS_SET, 1, 6, mac);
}

/*
* CC32xxWiFi::test_mode_start()
*/
Expand Down
9 changes: 9 additions & 0 deletions src/freertos_drivers/net_cc32xx/CC32xxWiFi.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,15 @@ public:
*/
void wlan_mac(uint8_t mac[6]);

/** Sets the device MAC address. WARNING. The MAC address will be
* persistently set to the value indicated. Only a factory reset of the
* device can undo this operation. After calling this API there is no way
* to recover the factory MAC address. Make sure not to call this API too
* many times in the lifetime of the product, as flash wear is a concern.
* @param mac 6 byte array which holds the desired MAC address.
*/
void wlan_set_mac(uint8_t mac[6]);

/** Get the assigned IP address.
* @return assigned IP address, else 0 if not assigned
*/
Expand Down