ntp.c

April 3, 2026 ยท View on GitHub

Purpose

Blocking one-shot NTP client.

API Reference

int XNTP_GetDate(const char *pAddr, uint16_t nPort, xtime_t *pTime)

  • Args:
    • pAddr: NTP server address.
    • nPort: UDP port.
    • pTime: destination time struct.
  • Does:
    • sends an NTP request over UDP and converts server time into xtime_t.
  • Returns:
    • XSTDOK on success.
    • XSTDERR on network or parse failure.

Contents

  1. 1Purpose
  2. 2API Reference
  3. 2.1int XNTP_GetDate(const char *pAddr, uint16_t nPort, xtime_t *pTime)