Skip to content

Commit a66db5b

Browse files
committed
Update mbed to 6.0.0-pre
1 parent 224cf4c commit a66db5b

File tree

103 files changed

+1952
-1058
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1952
-1058
lines changed

cores/arduino/mbed/components/wifi/esp8266-driver/ESP8266/ESP8266.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_API_PRESENT)
2121
#include <stdint.h>
2222

23-
#include "drivers/UARTSerial.h"
23+
#include "drivers/BufferedSerial.h"
2424
#include "features/netsocket/nsapi_types.h"
2525
#include "features/netsocket/WiFiAccessPoint.h"
2626
#include "PinNames.h"
@@ -43,6 +43,9 @@
4343
#ifndef ESP8266_MISC_TIMEOUT
4444
#define ESP8266_MISC_TIMEOUT 2000
4545
#endif
46+
#ifndef ESP8266_DNS_TIMEOUT
47+
#define ESP8266_DNS_TIMEOUT 15000
48+
#endif
4649

4750
#define ESP8266_SCAN_TIME_MIN 0 // [ms]
4851
#define ESP8266_SCAN_TIME_MAX 1500 // [ms]
@@ -255,10 +258,10 @@ class ESP8266 {
255258
*
256259
* @param id id of socket to send to
257260
* @param data data to be sent
258-
* @param amount amount of data to be sent - max 1024
259-
* @return NSAPI_ERROR_OK in success, negative error code in failure
261+
* @param amount amount of data to be sent - max 2048
262+
* @return number of bytes on success, negative error code in failure
260263
*/
261-
nsapi_error_t send(int id, const void *data, uint32_t amount);
264+
nsapi_size_or_error_t send(int id, const void *data, uint32_t amount);
262265

263266
/**
264267
* Receives datagram from an open UDP socket
@@ -424,7 +427,7 @@ class ESP8266 {
424427
mbed::Callback<void()> _callback;
425428

426429
// UART settings
427-
mbed::UARTSerial _serial;
430+
mbed::BufferedSerial _serial;
428431
PinName _serial_rts;
429432
PinName _serial_cts;
430433
rtos::Mutex _smutex; // Protect serial port access
@@ -444,6 +447,7 @@ class ESP8266 {
444447
// data follows
445448
} *_packets, * *_packets_end;
446449
void _clear_socket_packets(int id);
450+
void _clear_socket_sending(int id);
447451
int _sock_active_id;
448452

449453
// Memory statistics
@@ -469,7 +473,8 @@ class ESP8266 {
469473
void _oob_tcp_data_hdlr();
470474
void _oob_ready();
471475
void _oob_scan_results();
472-
void _oob_ok_received();
476+
void _oob_send_ok_received();
477+
void _oob_send_fail_received();
473478

474479
// OOB state variables
475480
int _connect_error;
@@ -480,7 +485,7 @@ class ESP8266 {
480485
bool _error;
481486
bool _busy;
482487
bool _reset_done;
483-
bool _ok_received;
488+
int _sock_sending_id;
484489

485490
// Modem's address info
486491
char _ip_buffer[16];
@@ -495,6 +500,7 @@ class ESP8266 {
495500
char *tcp_data;
496501
int32_t tcp_data_avbl; // Data waiting on modem
497502
int32_t tcp_data_rcvd;
503+
bool send_fail; // Received 'SEND FAIL'. Expect user will close the socket.
498504
};
499505
struct _sock_info _sock_i[SOCKET_COUNT];
500506

cores/arduino/mbed/components/wifi/esp8266-driver/ESP8266Interface.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,25 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface {
228228
* version is chosen by the stack (defaults to NSAPI_UNSPEC)
229229
* @return 0 on success, negative error code on failure
230230
*/
231+
#if MBED_CONF_ESP8266_BUILT_IN_DNS
232+
nsapi_error_t gethostbyname(const char *name, SocketAddress *address, nsapi_version_t version, const char *interface_name);
233+
#else
231234
using NetworkInterface::gethostbyname;
235+
#endif
236+
237+
using NetworkInterface::gethostbyname_async;
238+
using NetworkInterface::gethostbyname_async_cancel;
232239

233240
/** Add a domain name server to list of servers to query
234241
*
235242
* @param addr Destination for the host address
236243
* @return 0 on success, negative error code on failure
237244
*/
245+
#if MBED_CONF_ESP8266_BUILT_IN_DNS
246+
nsapi_error_t add_dns_server(const SocketAddress &address, const char *interface_name);
247+
#else
238248
using NetworkInterface::add_dns_server;
249+
#endif
239250

240251
/** @copydoc NetworkStack::setsockopt
241252
*/

0 commit comments

Comments
 (0)