/* Brief Set the MAC address used by Wi-Fi chip */
sl_status_t sl_wfx_set_mac_address(const sl_wfx_mac_address_t *mac, sl_wfx_interface_t interface)
/* Brief Set the MAC address used by Wi-Fi chip */
sl_status_t sl_wfx_set_mac_address(const sl_wfx_mac_address_t *mac, sl_wfx_interface_t interface)
{
  sl_status_t result;
  sl_wfx_set_mac_address_req_body_t payload;
  memcpy(&payload.mac_addr, &mac->octet, sizeof(payload.mac_addr));
  result = sl_wfx_send_command(SL_WFX_SET_MAC_ADDRESS_REQ_ID, &payload,
                               sizeof(payload), interface, NULL);
  if (result == SL_STATUS_OK) {
    if (interface == SL_WFX_STA_INTERFACE) {
      memcpy(&(sl_wfx_context->mac_addr_0.octet), mac->octet,
             sizeof(sl_wfx_mac_address_t));
    }
    if (interface == SL_WFX_SOFTAP_INTERFACE) {
      memcpy(&(sl_wfx_context->mac_addr_1.octet), mac->octet,
             sizeof(sl_wfx_mac_address_t));
    }
  }
  return result;
}