nuttx-apps/include
Daniel P. Carvalho 6d6ab39939 netutils/ptpd: Implement IEEE 1588 peer-to-peer (P2P) delay mechanism.
Implements the Peer-to-Peer (P2P) transparent clock delay measurement
mechanism (IEEE 1588-2008 §11.4 / IEEE 802.1AS / IEC/IEEE 61850-9-3)
in apps/netutils/ptpd:

- Add PTP_MSGTYPE_PDELAY_REQ, PTP_MSGTYPE_PDELAY_RESP, and
  PTP_MSGTYPE_PDELAY_RESP_FOLLOW_UP definitions and structs in ptpv2.h.
- Define IEEE 1588-2008 Annex F peer delay multicast MAC address
  01:80:c2:00:00:0e and Annex D peer delay IP address 224.0.0.107.
- Replace bool delay_e2e with enum ptp_delay_mechanism_e (PTP_DELAY_NONE,
  PTP_DELAY_E2E, PTP_DELAY_P2P) in include/netutils/ptpd.h.
- Add -P CLI option in system/ptpd/ptpd_main.c with mutual exclusion
  check against -E, and display last_transmitted_pdelayreq in status.
- Implement responder logic in ptp_process_pdelay_req() sending
  Pdelay_Resp (t2) and Pdelay_Resp_Follow_Up (t3) regardless of master
  or slave state.
- Implement requester logic in ptp_send_pdelay_req() gated on the
  physical link without requiring prior BMCA master selection.
- Implement ptp_process_pdelay_resp() and
  ptp_process_pdelay_resp_followup() using canonical mean path delay
  formula ((t4 - t1) - (t3 - t2)) / 2.
- Refactor path delay bounds checking and moving average filter into
  ptp_record_path_delay() shared across E2E and P2P mechanisms.
- Set PTP version 2.0 and controlField 0x05 in Pdelay_Req, Pdelay_Resp
  and Pdelay_Resp_Follow_Up, and in the own-identity header, so that
  peers such as linuxptp accept the messages.
- Clear pdelay_waiting_followup when a new Pdelay_Req is sent, so an
  orphaned Pdelay_Resp_Follow_Up from an abandoned cycle is not paired
  with stale timestamps.
- Warn at startup when P2P is selected without CONFIG_SCHED_TICKLESS,
  since a tick-driven clock cannot resolve the peer delay.
- Skip IP multicast join/leave handling for AF_PACKET.

Assisted-by: Claude:claude-sonnet-5
Assisted-by: Gemini:gemini-3.8-flash-medium
Signed-off-by: Daniel P. Carvalho <danieloak@gmail.com>
2026-09-24 11:07:31 +08:00
..
audioutils include: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
builtin include: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
canutils style: Fix coding style violations in nuttx-apps 2026-01-12 00:54:48 +08:00
crypto/controlse include: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
fsutils !fsutils/passwd: Replace TEA with PBKDF2-HMAC-SHA256 2026-07-22 17:21:22 +08:00
graphics include/debug.h: Use <nuttx/debug.h> in apps 2026-04-11 10:39:27 -03:00
industry style: Fix coding style violations in nuttx-apps 2026-01-12 00:54:48 +08:00
interpreters include: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
logging/nxscope logging/nxscope: add UDP transfer interface 2026-03-18 12:43:50 -03:00
lte include: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
modbus include: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
netutils netutils/ptpd: Implement IEEE 1588 peer-to-peer (P2P) delay mechanism. 2026-09-24 11:07:31 +08:00
nshlib nshlib: Add stderr redirection support 2026-01-27 03:14:00 +08:00
nxmodbus modbus: add nxmodbus 2026-04-20 12:45:17 -03:00
platform include: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
system system/zbus: Port the Zephyr zbus message bus to NuttX 2026-09-21 18:46:31 -03:00
testing apps/unity: Add printf configuration 2025-08-07 11:21:57 +08:00
wasm include: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
wireless include: migrate to SPDX identifier 2024-12-19 15:25:28 +08:00
.gitignore audioutils/morsey: Add the Morsey library 2026-07-21 05:46:11 -03:00