Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial support for CSMA-CA #4

Merged
merged 21 commits into from
Mar 13, 2024
Merged

Initial support for CSMA-CA #4

merged 21 commits into from
Mar 13, 2024

Conversation

SamClercky
Copy link
Contributor

@SamClercky SamClercky commented Mar 5, 2024

This PR adds initial support for CSMA-CA.

It adds:

  • An implementation for CSMA-CA
  • Definitions for multiple traits that are necessary to communicate with real hardware
    • Radio: Abstraction over a physical radio
    • RadioFrame/RadioFrameMut: Abstraction over the representation of a frame that a physical radio requires
    • TxToken/RxToken: To easily (de)construct a frame specifically for a given physical radio
  • A way to interact with the CsmaDevice from a higher network layer (Driver trait)
  • Some initial testing infrastructure which includes some mocking implementations for the different traits

Additionally this PR includes some bugfixes and extra tests to the concurrency primitives.

Things that still need to be done:

  • More CSMA-CA tests
  • Configuration options for the CsmaDevice

dot15d4/src/sync/mutex.rs Outdated Show resolved Hide resolved
dot15d4/src/sync/mutex.rs Outdated Show resolved Hide resolved
dot15d4/src/csma/mod.rs Outdated Show resolved Hide resolved
dot15d4/src/phy/driver.rs Outdated Show resolved Hide resolved
@thvdveld thvdveld marked this pull request as draft March 6, 2024 13:43
@thvdveld thvdveld changed the title Draft: CSMA-CA Initial support for CSMA-CA Mar 6, 2024
@SamClercky SamClercky force-pushed the csma-ca branch 2 times, most recently from 2aac80b to aaf0905 Compare March 8, 2024 10:54
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 90.71481% with 126 lines in your changes are missing coverage. Please review.

Project coverage is 69.45%. Comparing base (ed48f23) to head (899d5d2).

Files Patch % Lines
dot15d4/src/phy/config.rs 21.56% 40 Missing ⚠️
dot15d4/src/csma/mod.rs 94.43% 39 Missing ⚠️
dot15d4/src/phy/radio/mod.rs 84.81% 24 Missing ⚠️
dot15d4/src/sync/tests.rs 92.13% 7 Missing ⚠️
dot15d4/src/csma/transmission.rs 90.90% 6 Missing ⚠️
dot15d4/src/sync/channel.rs 95.76% 5 Missing ⚠️
dot15d4/src/sync/mutex.rs 92.45% 4 Missing ⚠️
dot15d4/src/phy/driver.rs 97.61% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main       #4      +/-   ##
==========================================
+ Coverage   60.68%   69.45%   +8.77%     
==========================================
  Files          27       35       +8     
  Lines        3576     4908    +1332     
==========================================
+ Hits         2170     3409    +1239     
- Misses       1406     1499      +93     

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

@SamClercky SamClercky marked this pull request as ready for review March 8, 2024 10:57
@SamClercky SamClercky marked this pull request as draft March 8, 2024 14:44
@SamClercky SamClercky marked this pull request as ready for review March 8, 2024 23:25
dot15d4/Cargo.toml Outdated Show resolved Hide resolved
dot15d4/src/csma/constants.rs Outdated Show resolved Hide resolved
dot15d4/src/csma/mod.rs Show resolved Hide resolved
dot15d4/src/csma/mod.rs Outdated Show resolved Hide resolved
dot15d4/src/csma/mod.rs Outdated Show resolved Hide resolved
dot15d4/src/csma/mod.rs Outdated Show resolved Hide resolved
dot15d4/src/csma/mod.rs Outdated Show resolved Hide resolved
dot15d4/src/phy/device.rs Outdated Show resolved Hide resolved
dot15d4/src/phy/driver.rs Outdated Show resolved Hide resolved
dot15d4/src/phy/driver.rs Outdated Show resolved Hide resolved
@SamClercky SamClercky force-pushed the csma-ca branch 4 times, most recently from a4cafc1 to 3e932d8 Compare March 13, 2024 15:00
@thvdveld thvdveld merged commit 1e22e8f into thvdveld:main Mar 13, 2024
8 checks passed
@SamClercky SamClercky deleted the csma-ca branch March 13, 2024 15:11
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