Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed-rtos EthernetInterface FatFileSystemCpp MCP23S17 SDFileSystem mbed
Fork of HTTPServerHelloWorld by
Diff: Services/Network/EthernetService.cpp
- Revision:
- 6:b2c4687b421d
- Parent:
- 5:df012c2caf40
- Child:
- 7:1fe91b525d9a
diff -r df012c2caf40 -r b2c4687b421d Services/Network/EthernetService.cpp
--- a/Services/Network/EthernetService.cpp Sat Feb 01 18:54:20 2014 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-#include "EthernetService.h"
-
-EthernetService::EthernetService() {
- ethernetLink = new Ethernet();
- ethernetInterface = new EthernetNetIf();
- ntpClient = new NTPClient();
- linkActive = 0;
- needReconnection = 0;
-}
-
-EthernetService::~EthernetService() {
- delete ntpClient;
- delete ethernetInterface;
- delete ethernetLink;
-}
-
-int EthernetService::setup() {
- EthernetErr ethErr = ethernetInterface->setup();
- linkActive = ethErr ? 0 : 1;
- needReconnection = ! linkActive;
- return linkActive;
-}
-
-int EthernetService::setRtcTime() {
- Host server(IpAddr(), 123, "0.es.pool.ntp.org");
- ntpClient->setTime(server);
- return 1;
-}
-
-void EthernetService::poll() {
- linkActive = ethernetLink->link();
- if (linkActive) {
- if (!needReconnection) {
- Net::poll();
- }
- } else {
- needReconnection = 1;
- }
-}
-
-int EthernetService::isLinkRestored() {
- return linkActive && needReconnection;
-}
\ No newline at end of file
