9af6c53294
- ptp_clock_status() adds status.ptp: state (LISTENING / UNCALIBRATED / SLAVE), locked, gm_id, offset_ns, freq_ppb, path_delay_ns + path_delay_sd_ns (window of 64, from lock on), steps_removed, gm_time/freq_traceable, version, own_class (255 slave / 248 auto, master), clock_id, gm_class/accuracy/p1/p2, sync_avg/min/max_ms and sync_jitter_us (HW Sync intervals), announce_avg_ms, delay_req/resp counters, hw_ts, window. Snapshot under a mutex shared with the PTP task. - Per-Sync log moved to debug; info level logs state changes plus a 60 s summary (max |offset|, freq, delay). - Verified vs ptp4l: LISTENING -> UNCALIBRATED -> SLAVE in ~35 s; locked offset within a few hundred ns, delay 10.27 us +-0.20 us, Delay_Req/Resp 69/69, Sync avg 1000.097 ms, Announce avg 2000 ms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 lines
285 B
C
11 lines
285 B
C
// PTPv2 ordinary clock over UDP/IPv4 (E2E). TimeReceiver (TimeTransmitter: step 6).
|
|
#pragma once
|
|
|
|
#include "cJSON.h"
|
|
#include "esp_err.h"
|
|
#include "esp_netif.h"
|
|
|
|
esp_err_t ptp_clock_start(esp_netif_t *netif);
|
|
// Adds the "ptp" object to /api/status.
|
|
void ptp_clock_status(cJSON *st);
|