@@ -8,7 +8,7 @@ int EthernetClass::begin(unsigned long timeout, unsigned long responseTimeout)
88 stm32_eth_init (NULL , NULL , NULL , NULL );
99
1010 // Now try to get our config info from a DHCP server
11- int ret = _dhcp->beginWithDHCP (mac_address , timeout, responseTimeout);
11+ int ret = _dhcp->beginWithDHCP (NULL , timeout, responseTimeout);
1212 if (ret == 1 ) {
1313 _dnsServerAddress = _dhcp->getDnsServerIp ();
1414 }
@@ -58,7 +58,6 @@ int EthernetClass::begin(uint8_t *mac_address, unsigned long timeout, unsigned l
5858 if (ret == 1 ) {
5959 _dnsServerAddress = _dhcp->getDnsServerIp ();
6060 }
61- MACAddress (mac_address);
6261 return ret;
6362}
6463
@@ -86,14 +85,13 @@ void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dn
8685 begin (mac_address, local_ip, dns_server, gateway, subnet);
8786}
8887
89- void EthernetClass::begin (uint8_t *mac , IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
88+ void EthernetClass::begin (uint8_t *mac_address , IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet)
9089{
91- stm32_eth_init (mac , local_ip.raw_address (), gateway.raw_address (), subnet.raw_address ());
90+ stm32_eth_init (mac_address , local_ip.raw_address (), gateway.raw_address (), subnet.raw_address ());
9291 /* If there is a local DHCP informs it of our manual IP configuration to
9392 prevent IP conflict */
9493 stm32_DHCP_manual_config ();
9594 _dnsServerAddress = dns_server;
96- MACAddress (mac);
9795}
9896
9997EthernetLinkStatus EthernetClass::linkStatus ()
@@ -133,19 +131,14 @@ void EthernetClass::schedule(void)
133131 stm32_eth_scheduler ();
134132}
135133
136- void EthernetClass::MACAddress ( uint8_t *mac )
134+ void EthernetClass::setMACAddress ( const uint8_t *mac_address )
137135{
138- mac_address[0 ] = mac[0 ];
139- mac_address[1 ] = mac[1 ];
140- mac_address[2 ] = mac[2 ];
141- mac_address[3 ] = mac[3 ];
142- mac_address[4 ] = mac[4 ];
143- mac_address[5 ] = mac[5 ];
136+ stm32_eth_set_macaddr (mac_address);
144137}
145138
146- uint8_t * EthernetClass::MACAddress (void )
139+ void EthernetClass::MACAddress (uint8_t *mac_address )
147140{
148- return mac_address;
141+ stm32_eth_get_macaddr ( mac_address) ;
149142}
150143
151144IPAddress EthernetClass::localIP ()
0 commit comments