@@ -520,6 +520,23 @@ bool ntpProcessOneRequest(bool process, const timeval *recTv, const timeval *syn
520
520
521
521
ntpServer->read ((char *)&packet.packet , NTPpacket::NTPpacketSize); // Copy the NTP data into our packet
522
522
523
+ /*
524
+ // Add the incoming packet to the diagnostics
525
+ if (ntpDiag != nullptr)
526
+ {
527
+ char tmpbuf[128];
528
+ snprintf(tmpbuf, sizeof(tmpbuf), "Packet <-- : ");
529
+ strlcat(ntpDiag, tmpbuf, ntpDiagSize);
530
+ for (int i = 0; i < NTPpacket::NTPpacketSize; i++)
531
+ {
532
+ snprintf(tmpbuf, sizeof(tmpbuf), "%02X ", packet.packet[i]);
533
+ strlcat(ntpDiag, tmpbuf, ntpDiagSize);
534
+ }
535
+ snprintf(tmpbuf, sizeof(tmpbuf), "\r\n");
536
+ strlcat(ntpDiag, tmpbuf, ntpDiagSize);
537
+ }
538
+ */
539
+
523
540
// If process is false, return now
524
541
if (!process)
525
542
{
@@ -635,26 +652,26 @@ bool ntpProcessOneRequest(bool process, const timeval *recTv, const timeval *syn
635
652
// Add the socketSendUDP result to the diagnostics
636
653
if (ntpDiag != nullptr)
637
654
{
638
- char tmpbuf[128];
639
- snprintf(tmpbuf, sizeof(tmpbuf), "socketSendUDP result: %d\r\n", result);
640
- strlcat(ntpDiag, tmpbuf, ntpDiagSize);
655
+ char tmpbuf[128];
656
+ snprintf(tmpbuf, sizeof(tmpbuf), "socketSendUDP result: %d\r\n", result);
657
+ strlcat(ntpDiag, tmpbuf, ntpDiagSize);
641
658
}
642
659
*/
643
660
644
661
/*
645
- // Add the packet to the diagnostics
662
+ // Add the outgoing packet to the diagnostics
646
663
if (ntpDiag != nullptr)
647
664
{
648
- char tmpbuf[128];
649
- snprintf(tmpbuf, sizeof(tmpbuf), "Packet: ");
650
- strlcat(ntpDiag, tmpbuf, ntpDiagSize);
651
- for (int i = 0; i < NTPpacket::NTPpacketSize; i++)
652
- {
653
- snprintf(tmpbuf, sizeof(tmpbuf), "%02X ", packet.packet[i]);
665
+ char tmpbuf[128];
666
+ snprintf(tmpbuf, sizeof(tmpbuf), "Packet --> : ");
667
+ strlcat(ntpDiag, tmpbuf, ntpDiagSize);
668
+ for (int i = 0; i < NTPpacket::NTPpacketSize; i++)
669
+ {
670
+ snprintf(tmpbuf, sizeof(tmpbuf), "%02X ", packet.packet[i]);
671
+ strlcat(ntpDiag, tmpbuf, ntpDiagSize);
672
+ }
673
+ snprintf(tmpbuf, sizeof(tmpbuf), "\r\n");
654
674
strlcat(ntpDiag, tmpbuf, ntpDiagSize);
655
- }
656
- snprintf(tmpbuf, sizeof(tmpbuf), "\r\n");
657
- strlcat(ntpDiag, tmpbuf, ntpDiagSize);
658
675
}
659
676
*/
660
677
}
@@ -818,7 +835,7 @@ void ntpServerStop()
818
835
// Update the NTP server state
819
836
void ntpServerUpdate ()
820
837
{
821
- char ntpDiag[512 ]; // Char array to hold diagnostic messages
838
+ char ntpDiag[768 ]; // Char array to hold diagnostic messages
822
839
823
840
if (present.ethernet_ws5500 == false )
824
841
return ;
0 commit comments