@@ -8,7 +8,7 @@ int EthernetClass::begin(unsigned long timeout, unsigned long responseTimeout)
8
8
stm32_eth_init (NULL , NULL , NULL , NULL );
9
9
10
10
// 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);
12
12
if (ret == 1 ) {
13
13
_dnsServerAddress = _dhcp->getDnsServerIp ();
14
14
}
@@ -58,7 +58,6 @@ int EthernetClass::begin(uint8_t *mac_address, unsigned long timeout, unsigned l
58
58
if (ret == 1 ) {
59
59
_dnsServerAddress = _dhcp->getDnsServerIp ();
60
60
}
61
- MACAddress (mac_address);
62
61
return ret;
63
62
}
64
63
@@ -86,14 +85,13 @@ void EthernetClass::begin(uint8_t *mac_address, IPAddress local_ip, IPAddress dn
86
85
begin (mac_address, local_ip, dns_server, gateway, subnet);
87
86
}
88
87
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)
90
89
{
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 ());
92
91
/* If there is a local DHCP informs it of our manual IP configuration to
93
92
prevent IP conflict */
94
93
stm32_DHCP_manual_config ();
95
94
_dnsServerAddress = dns_server;
96
- MACAddress (mac);
97
95
}
98
96
99
97
EthernetLinkStatus EthernetClass::linkStatus ()
@@ -133,19 +131,14 @@ void EthernetClass::schedule(void)
133
131
stm32_eth_scheduler ();
134
132
}
135
133
136
- void EthernetClass::MACAddress ( uint8_t *mac )
134
+ void EthernetClass::setMACAddress ( const uint8_t *mac_address )
137
135
{
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);
144
137
}
145
138
146
- uint8_t * EthernetClass::MACAddress (void )
139
+ void EthernetClass::MACAddress (uint8_t *mac_address )
147
140
{
148
- return mac_address;
141
+ stm32_eth_get_macaddr ( mac_address) ;
149
142
}
150
143
151
144
IPAddress EthernetClass::localIP ()
0 commit comments