File tree 2 files changed +5
-4
lines changed
2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change 3
3
#define SSID_MAX_LENGTH 32
4
4
5
5
int arduino::EthernetClass::begin (uint8_t *mac, unsigned long timeout, unsigned long responseTimeout) {
6
+ if (eth_if == nullptr ) {
7
+ return 0 ;
8
+ }
6
9
eth_if->set_dhcp (true );
7
10
return _begin (mac, timeout, responseTimeout);
8
11
}
@@ -94,4 +97,4 @@ void arduino::EthernetClass::MACAddress(uint8_t *mac_address)
94
97
macAddress (mac_address);
95
98
}
96
99
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 {
60
60
// Returns 0 if the DHCP configuration failed, and 1 if it succeeded
61
61
EthernetClass (EthernetInterface *_if)
62
62
: eth_if(_if){};
63
- EthernetClass (){};
64
63
65
64
int begin (uint8_t *mac = nullptr , unsigned long timeout = 60000 , unsigned long responseTimeout = 4000 );
66
65
EthernetLinkStatus linkStatus ();
@@ -116,8 +115,7 @@ class EthernetClass : public MbedSocketClass {
116
115
int _begin (uint8_t *mac, unsigned long timeout, unsigned long responseTimeout);
117
116
118
117
volatile EthernetLinkStatus _currentNetworkStatus = Unknown;
119
- EthernetInterface net;
120
- EthernetInterface *eth_if = &net;
118
+ EthernetInterface *eth_if = nullptr ;
121
119
arduino::IPAddress ipAddressFromSocketAddress (SocketAddress socketAddress);
122
120
};
123
121
You can’t perform that action at this time.
0 commit comments