Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
49c36bc
feat(ptp): add portable PTPv2 core model
masarray Aug 11, 2026
4f547b7
feat(ptp): port PTPv2 codec and raw parser
masarray Aug 11, 2026
72e78fa
feat(ptp): add passive monitor and health model
masarray Aug 11, 2026
96610f4
feat(ptp): port passive monitor health and smpSynch policy
masarray Aug 11, 2026
400e9c4
test(ptp): add C# parity and monitor regression coverage
masarray Aug 11, 2026
873b536
feat(esp32): declare isolated PTP lab broadcaster
masarray Aug 11, 2026
eb30b9f
feat(esp32): add hardware-timestamped PTP lab broadcaster
masarray Aug 11, 2026
c713756
build(esp32): link portable PTP codec into process-bus component
masarray Aug 11, 2026
bd68f36
build(esp32): include PTP lab broadcaster task
masarray Aug 11, 2026
9fdc935
feat(esp32): add guarded PTP lab broadcaster configuration
masarray Aug 11, 2026
7239884
fix(sv): make smpSynch default fail-safe
masarray Aug 11, 2026
ac82944
refactor(esp32): expose C-compatible PTP lab start hook
masarray Aug 11, 2026
84baab6
refactor(esp32): expose guarded PTP task through C bridge
masarray Aug 11, 2026
ffc5f8a
build(esp32): compile PTP task only when lab timing is enabled
masarray Aug 11, 2026
7803915
feat(esp32): attach optional PTP lab timing companion to EMAC
masarray Aug 11, 2026
d552540
ci(ptp): add strict portable PTP core regression profile
masarray Aug 11, 2026
c71cb90
feat(ptp): add read-only PCAP analyzer CLI
masarray Aug 11, 2026
017188f
build(ptp): integrate PTP core tests and analyzer into primary build
masarray Aug 11, 2026
5fb63b7
ci(ptp): surface strict compiler diagnostics as annotations
masarray Aug 11, 2026
975ef6a
fix(ptp): qualify chrono nanoseconds in timestamp conversion
masarray Aug 11, 2026
c3168a6
ci(ptp): surface regression failures as annotations
masarray Aug 11, 2026
ab88aeb
ci(ptp): compile ESP32-P4 hardware timestamp lab profile
masarray Aug 11, 2026
be41bbb
test(ptp): correct C# Announce reserved-byte golden vector
masarray Aug 11, 2026
689d8e4
ci(ptp): add strict MSVC PTP build and regression gate
masarray Aug 11, 2026
7ae7f87
feat(esp32): answer Pdelay with hardware RX and TX timestamps
masarray Aug 11, 2026
a9f76fd
test(ptp): lock Pdelay response wire identity and timestamps
masarray Aug 11, 2026
1dea14d
docs(ptp): define lab timing companion architecture and bench acceptance
masarray Aug 11, 2026
b35df9d
test(ptp): add standalone cross-platform PTP build profile
masarray Aug 11, 2026
31da89a
ci(ptp): isolate strict MSVC analyzer build profile
masarray Aug 11, 2026
185052d
feat(ptp): expose transport-specific and VLAN lab bindings
masarray Aug 11, 2026
58f4509
feat(ptp): bind transport-specific and optional VLAN to ESP32 traffic
masarray Aug 11, 2026
b569b26
feat(ptp): expose transport-specific evidence in passive monitor
masarray Aug 11, 2026
6b0ae32
feat(ptp): validate and diagnose transport-specific evidence
masarray Aug 11, 2026
8c29613
feat(ptp): report and validate transport-specific in analyzer
masarray Aug 11, 2026
bce64cb
test(ptp): cover transport-specific analyzer evidence
masarray Aug 11, 2026
9797b9c
ci(ptp): preserve actionable compiler diagnostics
masarray Aug 11, 2026
9baf0da
docs(ptp): document profile bindings and analyzer diagnostics
masarray Aug 11, 2026
081f4e5
test(ptp): make wire-width expectations explicit for MSVC
masarray Aug 11, 2026
5ec7604
ci(ptp): compile non-default transport and VLAN profile
masarray Aug 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions .github/workflows/esp32p4-ptp-lab.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: ESP32-P4 PTP Lab Profile

on:
push:
paths:
- 'embedded/esp32p4_smv_injector/**'
- 'include/ariec61850/time_sync/**'
- 'src/time_sync/**'
- 'include/ariec61850/ethernet/**'
- 'src/ethernet/**'
- '.github/workflows/esp32p4-ptp-lab.yml'
pull_request:
paths:
- 'embedded/esp32p4_smv_injector/**'
- 'include/ariec61850/time_sync/**'
- 'src/time_sync/**'
- 'include/ariec61850/ethernet/**'
- 'src/ethernet/**'
- '.github/workflows/esp32p4-ptp-lab.yml'

permissions:
contents: read

jobs:
build-esp32p4-ptp:
runs-on: ubuntu-latest
container:
image: espressif/idf:v5.5.4
defaults:
run:
shell: bash
working-directory: embedded/esp32p4_smv_injector
steps:
- uses: actions/checkout@v4

- name: Select ESP32-P4 target
run: source /opt/esp/idf/export.sh && idf.py set-target esp32p4

- name: Enable guarded non-default PTP lab profile
shell: bash
run: |
if grep -q '^# CONFIG_AR_PTP_LAB_TX is not set$' sdkconfig; then
sed -i 's/^# CONFIG_AR_PTP_LAB_TX is not set$/CONFIG_AR_PTP_LAB_TX=y/' sdkconfig
elif ! grep -q '^CONFIG_AR_PTP_LAB_TX=y$' sdkconfig; then
echo 'CONFIG_AR_PTP_LAB_TX=y' >> sdkconfig
fi

if grep -q '^CONFIG_AR_PTP_TRANSPORT_SPECIFIC=' sdkconfig; then
sed -i 's/^CONFIG_AR_PTP_TRANSPORT_SPECIFIC=.*/CONFIG_AR_PTP_TRANSPORT_SPECIFIC=1/' sdkconfig
else
echo 'CONFIG_AR_PTP_TRANSPORT_SPECIFIC=1' >> sdkconfig
fi

if grep -q '^# CONFIG_AR_PTP_VLAN is not set$' sdkconfig; then
sed -i 's/^# CONFIG_AR_PTP_VLAN is not set$/CONFIG_AR_PTP_VLAN=y/' sdkconfig
elif ! grep -q '^CONFIG_AR_PTP_VLAN=y$' sdkconfig; then
echo 'CONFIG_AR_PTP_VLAN=y' >> sdkconfig
fi

if grep -q '^CONFIG_AR_PTP_VLAN_ID=' sdkconfig; then
sed -i 's/^CONFIG_AR_PTP_VLAN_ID=.*/CONFIG_AR_PTP_VLAN_ID=100/' sdkconfig
else
echo 'CONFIG_AR_PTP_VLAN_ID=100' >> sdkconfig
fi

if grep -q '^CONFIG_AR_PTP_VLAN_PRIORITY=' sdkconfig; then
sed -i 's/^CONFIG_AR_PTP_VLAN_PRIORITY=.*/CONFIG_AR_PTP_VLAN_PRIORITY=4/' sdkconfig
else
echo 'CONFIG_AR_PTP_VLAN_PRIORITY=4' >> sdkconfig
fi

source /opt/esp/idf/export.sh
idf.py reconfigure
grep -E '^CONFIG_AR_PTP_(LAB_TX|DOMAIN|TRANSPORT_SPECIFIC|VLAN|VLAN_ID|VLAN_PRIORITY|ANNOUNCE_INTERVAL_MS|SYNC_INTERVAL_MS)=' sdkconfig

- name: Build PTP-enabled firmware
run: source /opt/esp/idf/export.sh && idf.py build
134 changes: 134 additions & 0 deletions .github/workflows/ptp-core-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
name: PTP Core CI

on:
push:
paths:
- 'include/ariec61850/time_sync/**'
- 'src/time_sync/**'
- 'include/ariec61850/ethernet/**'
- 'src/ethernet/**'
- 'src/capture/pcap.cpp'
- 'tools/ptp_analyze.cpp'
- 'tests/test_ptp.cpp'
- 'tests/ptp_profile/**'
- '.github/workflows/ptp-core-ci.yml'
pull_request:
paths:
- 'include/ariec61850/time_sync/**'
- 'src/time_sync/**'
- 'include/ariec61850/ethernet/**'
- 'src/ethernet/**'
- 'src/capture/pcap.cpp'
- 'tools/ptp_analyze.cpp'
- 'tests/test_ptp.cpp'
- 'tests/ptp_profile/**'
- '.github/workflows/ptp-core-ci.yml'

permissions:
contents: read

jobs:
portable-ptp:
strategy:
fail-fast: false
matrix:
compiler: [gcc, clang]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Build PTP strict profile
shell: bash
run: |
if [ "${{ matrix.compiler }}" = "clang" ]; then
CXX=clang++
else
CXX=g++
fi

set +e
"$CXX" \
-std=c++20 \
-Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion -Werror \
-pthread \
-Iinclude \
src/ethernet/ethernet.cpp \
src/time_sync/ptp.cpp \
src/time_sync/ptp_monitor.cpp \
tests/test_ptp.cpp \
-o ptp-core-tests \
>ptp-build.log 2>&1
status=$?
set -e

cat ptp-build.log
if [ "$status" -ne 0 ]; then
grep -Ei 'error:|fatal error:|undefined reference|collect2: error|ld: error' ptp-build.log | while IFS= read -r line; do
escaped=${line//'%'/'%25'}
escaped=${escaped//$'\r'/'%0D'}
escaped=${escaped//$'\n'/'%0A'}
echo "::error::$escaped"
done || true
exit "$status"
fi

- name: Run PTP regression tests
shell: bash
run: |
set +e
./ptp-core-tests >ptp-test.log 2>&1
status=$?
set -e
cat ptp-test.log
if [ "$status" -ne 0 ]; then
grep -E '\[FAIL\]|CHECK failed|error' ptp-test.log | while IFS= read -r line; do
escaped=${line//'%'/'%25'}
escaped=${escaped//$'\r'/'%0D'}
escaped=${escaped//$'\n'/'%0A'}
echo "::error::$escaped"
done || true
exit "$status"
fi

portable-ptp-msvc:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure standalone strict MSVC PTP profile
shell: pwsh
run: cmake -S tests/ptp_profile -B build-ptp-msvc -A x64

- name: Build PTP core and analyzer with diagnostics
shell: pwsh
run: |
function Build-Target([string]$Target) {
$output = & cmake --build build-ptp-msvc --config Release --target $Target --parallel 2>&1
$status = $LASTEXITCODE
$output | Tee-Object -FilePath "ptp-msvc-$Target.log"
if ($status -ne 0) {
$matched = $false
foreach ($line in $output) {
$text = "$line"
if ($text -match '(?i)(error C\d+|fatal error|error LNK\d+|error MSB\d+|: error )') {
$matched = $true
$escaped = $text.Replace('%','%25').Replace("`r",'%0D').Replace("`n",'%0A')
Write-Output "::error title=MSVC $Target::$escaped"
}
}
if (-not $matched) {
Write-Output "::error title=MSVC $Target::Build failed; inspect ptp-msvc-$Target.log in the job output."
}
exit $status
}
}

Build-Target 'ptp_profile_core'
Build-Target 'ptp_profile_tests'
Build-Target 'ptp_profile_analyze'

- name: Run PTP regression and analyzer smoke tests on MSVC
shell: pwsh
run: ctest --test-dir build-ptp-msvc -C Release --output-on-failure
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ option(ARIEC61850_WARNINGS_AS_ERRORS "Treat compiler warnings as errors" ON)
add_library(ariec61850_core
src/asn1/ber.cpp
src/ethernet/ethernet.cpp
src/time_sync/ptp.cpp
src/time_sync/ptp_monitor.cpp
src/capture/pcap.cpp
src/goose/retransmission_schedule.cpp
src/goose/pdu_codec.cpp
Expand Down Expand Up @@ -113,6 +115,12 @@ if(ARIEC61850_BUILD_TOOLS)
ariec61850_apply_warnings(ariec61850_pcap_interop_check)
ariec61850_apply_sanitizers(ariec61850_pcap_interop_check)

add_executable(ariec61850_ptp_analyze tools/ptp_analyze.cpp)
target_link_libraries(ariec61850_ptp_analyze PRIVATE ARIEC61850::core)
target_compile_features(ariec61850_ptp_analyze PRIVATE cxx_std_20)
ariec61850_apply_warnings(ariec61850_ptp_analyze)
ariec61850_apply_sanitizers(ariec61850_ptp_analyze)

add_executable(ariec61850_comtrade_inspect tools/comtrade_inspect.cpp)
target_link_libraries(ariec61850_comtrade_inspect PRIVATE ARIEC61850::core)
target_compile_features(ariec61850_comtrade_inspect PRIVATE cxx_std_20)
Expand Down Expand Up @@ -161,7 +169,7 @@ if(ARIEC61850_BUILD_TESTS)
ariec61850_apply_sanitizers(ariec61850_core_tests)
add_test(NAME ariec61850_core_tests COMMAND ariec61850_core_tests)

foreach(test_name IN ITEMS mms goose sampled_values)
foreach(test_name IN ITEMS mms goose sampled_values ptp)
add_executable(ariec61850_${test_name}_tests tests/test_${test_name}.cpp)
target_link_libraries(ariec61850_${test_name}_tests PRIVATE ARIEC61850::core)
target_compile_features(ariec61850_${test_name}_tests PRIVATE cxx_std_20)
Expand Down Expand Up @@ -340,6 +348,9 @@ if(ARIEC61850_BUILD_TESTS)
COMMAND ariec61850_comtrade_inspect
${CMAKE_CURRENT_SOURCE_DIR}/tests/fixtures/comtrade/simple_fault.cfg
--json)
add_test(
NAME ariec61850_ptp_analyze_help
COMMAND ariec61850_ptp_analyze --help)
add_test(
NAME ariec61850_pagination_probe_help
COMMAND ariec61850_pagination_probe --help)
Expand Down
Loading
Loading