There was an error while loading. Please reload this page.
1 parent 7fd7c9a commit d9fa625Copy full SHA for d9fa625
libraries/Ethernet/src/EthernetServer.cpp
@@ -0,0 +1,18 @@
1
+#include "EthernetServer.h"
2
+
3
+arduino::EthernetClient arduino::EthernetServer::available(uint8_t* status) {
4
+ EthernetClient client;
5
+ nsapi_error_t error;
6
7
+ if (sock == nullptr) {
8
+ return client;
9
+ }
10
+ TCPSocket* clientSocket = sock->accept(&error);
11
+ if (status != nullptr) {
12
+ *status = error == NSAPI_ERROR_OK ? 1 : 0;
13
14
+ if (error == NSAPI_ERROR_OK) {
15
+ client.setSocket(clientSocket);
16
17
18
+}
0 commit comments