Skip to content

Commit 92180fa

Browse files
committed
ntpd: echo back requested poll interval within limits
1 parent 171890d commit 92180fa

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ntpd.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ async def _ntpd():
123123
await uasyncio.sleep(0)
124124
ntp_payload = uctypes.struct(uctypes.addressof(packet[0]),ntpstruct,uctypes.BIG_ENDIAN)
125125
if (clock.isLocked()):
126+
send_payload.poll = ntp_payload.poll
127+
if (ntp_payload.poll < 6):
128+
send_payload.poll = 6
129+
if (ntp_payload.poll > 10):
130+
send_payload.poll = 10
126131
send_payload.stratum = _NTP_STRATUM_PRIMARY
127132
send_payload.reference_timestamp_s = refclk[0]+2208988800
128133
send_payload.reference_timestamp_frac = refclk[1]

0 commit comments

Comments
 (0)