Skip to content
This repository has been archived by the owner on Jan 29, 2023. It is now read-only.

Add packet validity checks #4

Merged
merged 1 commit into from
Jun 4, 2021

Conversation

bmcdonnell
Copy link
Contributor

Add some basic NTP packet validity checks.

@khoih-prog
Copy link
Owner

Thanks for this PR. It seems to be a good improvements, but I have to spend some time to test and see if everything is working OK with the new PR.

Best Regards,

@khoih-prog
Copy link
Owner

The test for this PR is so far OK.

Testing with Nano_33_IoT

Before and after update with this PR => OK

NINA_NTPClient_Basic started @ IP address: 192.168.2.114
Using NTP Server pool.ntp.org
******NOT UPDATED******
UTC : 00:00:04
UTC : 00:00:04 Thu 01 Jan 1970
LOC : 02:28:20
LOC : 02:28:20 Sun 07 Feb 2106
UTC EPOCH : 4
LOC EPOCH : 4294952900
UTC : 0:0:4 Thu 1/1/1970 or 1 Jan 1970
UTC : 00:00:04 Thu 1/1/1970 or 1 Jan 1970
LOC : 2:28:20 Sun 7/2/2106 or 7 Feb 2106
LOC : 02:28:20 Sun 7/2/2106 or 7 Feb 2106
********UPDATED********
UTC : 05:20:35
UTC : 05:20:35 Fri 04 Jun 2021
LOC : 01:20:35
LOC : 01:20:35 Fri 04 Jun 2021
UTC EPOCH : 1622784035
LOC EPOCH : 1622769635
UTC : 5:20:35 Fri 4/6/2021 or 4 Jun 2021
UTC : 05:20:35 Fri 4/6/2021 or 4 Jun 2021
LOC : 1:20:35 Fri 4/6/2021 or 4 Jun 2021
LOC : 01:20:35 Fri 4/6/2021 or 4 Jun 2021
********UPDATED********
UTC : 05:20:45
UTC : 05:20:45 Fri 04 Jun 2021
LOC : 01:20:45
LOC : 01:20:45 Fri 04 Jun 2021
UTC EPOCH : 1622784045
LOC EPOCH : 1622769645
UTC : 5:20:45 Fri 4/6/2021 or 4 Jun 2021
UTC : 05:20:45 Fri 4/6/2021 or 4 Jun 2021
LOC : 1:20:45 Fri 4/6/2021 or 4 Jun 2021
LOC : 01:20:45 Fri 4/6/2021 or 4 Jun 2021

Testing with MBED NANO_RP2040_CONNECT

Before and after update with this PR => OK

Starting NINA_NTPClient_Basic on MBED NANO_RP2040_CONNECT with WiFiNINA using WiFiNINA_Generic Library
Connecting to: HueNet1

NINA_NTPClient_Basic started @ IP address: 192.168.2.153
Using NTP Server pool.ntp.org
******NOT UPDATED******
UTC : 00:00:04
UTC : 00:00:04 Thu 01 Jan 1970
LOC : 02:28:20
LOC : 02:28:20 Sun 07 Feb 2106
UTC EPOCH : 4
LOC EPOCH : 4294952900
UTC : 0:0:4 Thu 1/1/1970 or 1 Jan 1970
UTC : 00:00:04 Thu 1/1/1970 or 1 Jan 1970
LOC : 2:28:20 Sun 7/2/2106 or 7 Feb 2106
LOC : 02:28:20 Sun 7/2/2106 or 7 Feb 2106
********UPDATED********
UTC : 05:22:52
UTC : 05:22:52 Fri 04 Jun 2021
LOC : 01:22:52
LOC : 01:22:52 Fri 04 Jun 2021
UTC EPOCH : 1622784172
LOC EPOCH : 1622769772
UTC : 5:22:52 Fri 4/6/2021 or 4 Jun 2021
UTC : 05:22:52 Fri 4/6/2021 or 4 Jun 2021
LOC : 1:22:52 Fri 4/6/2021 or 4 Jun 2021
LOC : 01:22:52 Fri 4/6/2021 or 4 Jun 2021

I'm merging this PR and will create a new release to add support to RP2040-based boards.

Cheers,

@khoih-prog khoih-prog merged commit c11e83e into khoih-prog:main Jun 4, 2021
@khoih-prog khoih-prog self-requested a review June 4, 2021 05:25
Copy link
Owner

@khoih-prog khoih-prog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Tested OK.

@bmcdonnell bmcdonnell mentioned this pull request Jun 4, 2021
@khoih-prog
Copy link
Owner

Just published the new NTPClient_Generic Releases v3.3.0).

Your Contribution has been noted in Contributions and Thanks


Releases v3.3.0

  1. Add support to RP2040-based boards, such as RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Earle Philhower's arduino-pico core.
  2. Add support to RP2040-based boards, such as Nano_RP2040_Connect, RASPBERRY_PI_PICO, ADAFRUIT_FEATHER_RP2040 and GENERIC_RP2040, using Arduino-mbed RP2040 core.
  3. Add packet validity checks
  4. Add version string
  5. Improve and add more debugging codes

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants