Skip to content

LoraPhy, LoraChannel: simulate sync word behavior#204

Open
maribu wants to merge 3 commits into
signetlabdei:developfrom
maribu:sync-word
Open

LoraPhy, LoraChannel: simulate sync word behavior#204
maribu wants to merge 3 commits into
signetlabdei:developfrom
maribu:sync-word

Conversation

@maribu
Copy link
Copy Markdown
Contributor

@maribu maribu commented Oct 17, 2025

Note

This PR includes #203, it should be rebased once #203 is merged

Proposed Changes

  • Extend LoraTag and LoraChannelParameters to carry the sync word
  • Extended LoraPhy to allow configuring the sync word
  • Extended LoraPhy with a "LostPacketBecauseSyncWordMismatch" trace source
  • Extended SimpleGatewayLoraPhy and SimpleEndDeviceLoraPhy to not receive incoming packets when the don't match the configured sync word
  • Added a test that on mismatching sync word the packet is indeed lost and "LostPacketBecauseSyncWordMismatch" is called

An enum instead of a magic number makes the code a lot easier to read.
@maribu maribu changed the title LoraPhy: Use enum for coding rate LoraPhy, LoraChannel: simulate sync word behavior Oct 18, 2025
This adds a simple sync word model: A PHY is configured with a given
sync word and will use that in the preamble of outgoing packets. For
incoming packets, the PHY will only lock onto the transmission if the
sync word of the incoming packet matches the configured sync word.
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 18, 2025

Codecov Report

❌ Patch coverage is 96.00000% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.78%. Comparing base (1809ba2) to head (5af17e9).

Files with missing lines Patch % Lines
model/simple-gateway-lora-phy.cc 76.92% 3 Missing ⚠️
model/lora-channel.cc 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #204      +/-   ##
===========================================
+ Coverage    84.61%   84.78%   +0.16%     
===========================================
  Files           67       67              
  Lines         7015     7096      +81     
===========================================
+ Hits          5936     6016      +80     
- Misses        1079     1080       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@maribu maribu marked this pull request as ready for review October 18, 2025 12:19
@nondetalle
Copy link
Copy Markdown
Collaborator

Hi, sorry for keeping you waiting and thanks for all the work. I did a quick read of the code and I agree with the general idea of this extension. Before merging, I'll take a more in-depth look and take care of merging updates from the develop branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants