We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent feebff6 commit 0b36e5fCopy full SHA for 0b36e5f
examples/udp_ntp_client/udp_ntp_client.ino
@@ -99,8 +99,11 @@ void sendNTPpacket(const char * address) {
99
100
// all NTP fields have been given values, now
101
// you can send a packet requesting a timestamp:
102
- Udp.beginPacket(address, 123); // NTP requests are to port 123
103
- Udp.write(packetBuffer, NTP_PACKET_SIZE);
104
- Udp.endPacket();
+ if (Udp.beginPacket(address, 123)) { // NTP requests are to port 123
+ Udp.write(packetBuffer, NTP_PACKET_SIZE);
+ Udp.endPacket();
105
+ } else {
106
+ Monitor.println("Failed to send NTP request.");
107
+ }
108
}
109
0 commit comments