[gnoduino] fix UdpNtpClient for newer gcc
- From: Lucian Langa <lucilanga src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnoduino] fix UdpNtpClient for newer gcc
- Date: Wed, 29 May 2013 22:00:16 +0000 (UTC)
commit 83cd53c2377b67c45c05654fb46433c8a68f81b7
Author: Pascal de Bruijn <pmjdebruijn pcode nl>
Date: Wed May 29 23:53:52 2013 +0200
fix UdpNtpClient for newer gcc
.../examples/UdpNtpClient/UdpNtpClient.ino | 24 --------------------
1 files changed, 0 insertions(+), 24 deletions(-)
---
diff --git a/libraries/Ethernet/examples/UdpNtpClient/UdpNtpClient.ino
b/libraries/Ethernet/examples/UdpNtpClient/UdpNtpClient.ino
index c67c3fe..a226d1f 100644
--- a/libraries/Ethernet/examples/UdpNtpClient/UdpNtpClient.ino
+++ b/libraries/Ethernet/examples/UdpNtpClient/UdpNtpClient.ino
@@ -45,30 +45,6 @@ byte packetBuffer[ NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing pack
// A UDP instance to let us send and receive packets over UDP
EthernetUDP Udp;
-// send an NTP request to the time server at the given address
-unsigned long sendNTPpacket(IPAddress& address)
-{
- // set all bytes in the buffer to 0
- memset(packetBuffer, 0, NTP_PACKET_SIZE);
- // Initialize values needed to form NTP request
- // (see URL above for details on the packets)
- packetBuffer[0] = 0b11100011; // LI, Version, Mode
- packetBuffer[1] = 0; // Stratum, or type of clock
- packetBuffer[2] = 6; // Polling Interval
- packetBuffer[3] = 0xEC; // Peer Clock Precision
- // 8 bytes of zero for Root Delay & Root Dispersion
- packetBuffer[12] = 49;
- packetBuffer[13] = 0x4E;
- packetBuffer[14] = 49;
- packetBuffer[15] = 52;
-
- // all NTP fields have been given values, now
- // you can send a packet requesting a timestamp:
- Udp.beginPacket(address, 123); //NTP requests are to port 123
- Udp.write(packetBuffer,NTP_PACKET_SIZE);
- Udp.endPacket();
-}
-
void setup()
{
// Open serial communications and wait for port to open:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]