Skip to content

Commit 29b84df

Browse files
committed
Merge branch 'main' of github.com:arduino/ArduinoCore-mbed
2 parents 0c6b337 + 31f8045 commit 29b84df

File tree

5 files changed

+20
-5
lines changed

5 files changed

+20
-5
lines changed

Diff for: libraries/Ethernet/src/Ethernet.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ int arduino::EthernetClass::begin(uint8_t *mac, unsigned long timeout, unsigned
88
_initializerCallback();
99
if (eth_if == nullptr) return 0;
1010
}
11+
eth_if->set_dhcp(true);
12+
_begin(mac, timeout, responseTimeout);
13+
}
1114

15+
int arduino::EthernetClass::_begin(uint8_t *mac, unsigned long timeout, unsigned long responseTimeout) {
1216
if (mac != nullptr) {
1317
eth_if->get_emac().set_hwaddr(mac);
1418
}
@@ -53,7 +57,7 @@ int arduino::EthernetClass::begin(uint8_t *mac, IPAddress ip, IPAddress dns, IPA
5357
eth_if->set_network(_ip, _netmask, _gateway);
5458
eth_if->add_dns_server(_dnsServer1, nullptr);
5559

56-
auto ret = begin(mac, timeout, responseTimeout);
60+
auto ret = _begin(mac, timeout, responseTimeout);
5761
return ret;
5862
}
5963

Diff for: libraries/Ethernet/src/Ethernet.h

+2
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ class EthernetClass : public MbedSocketClass {
116116
constexpr static int maintain () { return DHCP_CHECK_NONE; }
117117

118118
private:
119+
int _begin(uint8_t *mac, unsigned long timeout, unsigned long responseTimeout);
120+
119121
volatile EthernetLinkStatus _currentNetworkStatus = Unknown;
120122
EthernetInterface net;
121123
EthernetInterface *eth_if = &net;

Diff for: libraries/GSM/src/GSMDebug.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -188,14 +188,16 @@ const char * arduino::GSMClass::getRegistrationStateString(const mbed::CellularN
188188

189189
void arduino::GSMClass::onStatusChange(nsapi_event_t ev, intptr_t in) {
190190

191-
if(ev == CellularStateRetryEvent) {
191+
cellular_event_status event = (cellular_event_status)ev;
192+
193+
if(event == CellularStateRetryEvent) {
192194
feedWatchdog();
193195
}
194196

195197
#if GSM_DEBUG_ENABLE
196198
const cell_callback_data_t *data = (const cell_callback_data_t *)in;
197199

198-
switch(ev)
200+
switch(event)
199201
{
200202
case CellularDeviceReady:
201203
{

Diff for: libraries/SFU/src/SFU.cpp

+5-2
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,17 @@ int SFU::begin() {
2121
if (err) {
2222
err = getFileSystem().reformat(&bd);
2323
}
24+
return err;
2425
}
2526

2627
int SFU::download(const char* url) {
27-
// No download at the moment, allow the user to upload a file via mass storage
28+
// No download at the moment, allow the user to upload a file via mass storage
29+
return 0;
2830
}
2931

3032
int SFU::apply() {
31-
// No autoreboot
33+
// No autoreboot
34+
return 0;
3235
}
3336

3437
#ifdef ADD_USB_MSD

Diff for: libraries/WiFi/src/WiFi.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ int arduino::WiFiClass::beginAP(const char* ssid, const char* passphrase, uint8_
6969
//Set ap ssid, password and channel
7070
softAPInterface->set_network(_ip, _netmask, _gateway);
7171
nsapi_error_t result = softAPInterface->start(ssid, passphrase, NSAPI_SECURITY_WPA2, channel, true /* dhcp server */, NULL, true /* cohexistance */);
72+
if (result != NSAPI_ERROR_OK) {
73+
_currentNetworkStatus = WL_AP_FAILED;
74+
return _currentNetworkStatus;
75+
}
7276

7377
nsapi_error_t registrationResult;
7478
softAPInterface->unregister_event_handler();

0 commit comments

Comments
 (0)