File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 33#define SSID_MAX_LENGTH 32
44
55int arduino::EthernetClass::begin (uint8_t *mac, unsigned long timeout, unsigned long responseTimeout) {
6+ if (eth_if == nullptr ) {
7+ return 0 ;
8+ }
69 eth_if->set_dhcp (true );
710 return _begin (mac, timeout, responseTimeout);
811}
@@ -94,4 +97,4 @@ void arduino::EthernetClass::MACAddress(uint8_t *mac_address)
9497 macAddress (mac_address);
9598}
9699
97- arduino::EthernetClass Ethernet;
100+ arduino::EthernetClass Ethernet ( static_cast <EthernetInterface*>(EthInterface::get_default_instance())) ;
Original file line number Diff line number Diff line change @@ -60,7 +60,6 @@ class EthernetClass : public MbedSocketClass {
6060 // Returns 0 if the DHCP configuration failed, and 1 if it succeeded
6161 EthernetClass (EthernetInterface *_if)
6262 : eth_if(_if){};
63- EthernetClass (){};
6463
6564 int begin (uint8_t *mac = nullptr , unsigned long timeout = 60000 , unsigned long responseTimeout = 4000 );
6665 EthernetLinkStatus linkStatus ();
@@ -116,8 +115,7 @@ class EthernetClass : public MbedSocketClass {
116115 int _begin (uint8_t *mac, unsigned long timeout, unsigned long responseTimeout);
117116
118117 volatile EthernetLinkStatus _currentNetworkStatus = Unknown;
119- EthernetInterface net;
120- EthernetInterface *eth_if = &net;
118+ EthernetInterface *eth_if = nullptr ;
121119 arduino::IPAddress ipAddressFromSocketAddress (SocketAddress socketAddress);
122120};
123121
You can’t perform that action at this time.
0 commit comments