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/EthernetService.cpp
- Revision:
- 3:5dc0023e6284
diff -r bd69e4df7955 -r 5dc0023e6284 Services/EthernetService.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Services/EthernetService.cpp Fri Jan 31 23:19:28 2014 +0000
@@ -0,0 +1,25 @@
+#include "EthernetService.h"
+
+EthernetService::EthernetService() {
+ ethernetInterface = new EthernetNetIf();
+ ntpClient = new NTPClient();
+}
+
+EthernetService::~EthernetService() {
+ delete ntpClient;
+ delete ethernetInterface;
+}
+
+int EthernetService::setup() {
+ EthernetErr ethErr = ethernetInterface->setup();
+ if(ethErr) {
+ return 0;
+ }
+ return 1;
+}
+
+int EthernetService::setRtcTime() {
+ Host server(IpAddr(), 123, "0.es.pool.ntp.org");
+ ntpClient->setTime(server);
+ return 1;
+}
\ No newline at end of file
