Repository navigation
chore: stage role-correct PTP status text #8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Stage role-correct PTP status | |
| on: | |
| push: | |
| branches: | |
| - feature/ptp-production-v0.1.1 | |
| permissions: | |
| contents: write | |
| jobs: | |
| patch: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| ref: feature/ptp-production-v0.1.1 | |
| fetch-depth: 0 | |
| - name: Keep SOURCE evidence separate from receiver/monitor semantics | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| if [ "$GITHUB_ACTOR" = "github-actions[bot]" ]; then exit 0; fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| python - <<'PY' | |
| from pathlib import Path | |
| p = Path('embedded/esp32p4_smv_injector/main/live_control.cpp') | |
| s = p.read_text(encoding='utf-8') | |
| old = ' if (!ar_esp32p4_ptp_start()) {\n ESP_LOGE(kTag, "PTP start rejected: Ethernet link/source readiness failed; no verified timing frames were emitted");\n } else {\n ESP_LOGI(kTag, "PTP start accepted: verified Announce/Sync/Follow_Up transmission");\n }\n' | |
| new = ' if (!ar_esp32p4_ptp_start()) {\n ESP_LOGE(kTag, "PTP start rejected: Ethernet link or role runtime readiness failed");\n } else {\n ESP_LOGI(kTag, "PTP start accepted");\n }\n' | |
| if old not in s: raise SystemExit('live-control PTP status anchor missing') | |
| p.write_text(s.replace(old, new, 1), encoding='utf-8') | |
| p = Path('apps/arstack_studio/src/DeviceController.cpp') | |
| s = p.read_text(encoding='utf-8') | |
| old = ' if (line.contains(QStringLiteral("PTP start accepted"), Qt::CaseInsensitive)) {\n ptpStatus_ = QStringLiteral("Timing frames verified");\n emit deviceMessage(QStringLiteral("PTP source is transmitting verified timing frames."));\n static_cast<void>(sendPtpShow());\n }\n if (line.contains(QStringLiteral("PTP start rejected"), Qt::CaseInsensitive) || line.contains(QStringLiteral("PTP source readiness timeout"), Qt::CaseInsensitive)) {\n ptpRunning_ = false;\n ptpStatus_ = QStringLiteral("PTP start failed");\n emit ptpStateChanged();\n setError(QStringLiteral("PTP source did not emit timing frames. Check the Ethernet link and retry Start PTP Source."));\n }\n' | |
| new = ' if (line.contains(QStringLiteral("PTP start accepted"), Qt::CaseInsensitive)) {\n ptpStatus_ = ptpRole_ == QStringLiteral("SOURCE") ? QStringLiteral("Source TX verified") : QStringLiteral("Timing runtime started");\n emit deviceMessage(ptpRole_ == QStringLiteral("SOURCE")\n ? QStringLiteral("PTP source start verified; reading live TX counters.")\n : QStringLiteral("PTP %1 runtime started.").arg(ptpRole_.toLower()));\n static_cast<void>(sendPtpShow());\n }\n if (line.contains(QStringLiteral("PTP start rejected"), Qt::CaseInsensitive) || line.contains(QStringLiteral("PTP source readiness timeout"), Qt::CaseInsensitive)) {\n ptpRunning_ = false;\n ptpStatus_ = QStringLiteral("PTP start failed");\n emit ptpStateChanged();\n setError(ptpRole_ == QStringLiteral("SOURCE")\n ? QStringLiteral("PTP source did not emit Announce/Sync/Follow_Up. Check the Ethernet link and retry Start PTP Source.")\n : QStringLiteral("PTP %1 could not start. Check the Ethernet link and retry.").arg(ptpRole_.toLower()));\n }\n' | |
| if old not in s: raise SystemExit('DeviceController PTP status anchor missing') | |
| p.write_text(s.replace(old, new, 1), encoding='utf-8') | |
| PY | |
| git add embedded/esp32p4_smv_injector/main/live_control.cpp apps/arstack_studio/src/DeviceController.cpp | |
| git diff --cached --check | |
| git commit -m "fix(ptp): keep role-specific start semantics truthful" | |
| git push origin HEAD:feature/ptp-production-v0.1.1 |