OpenCyphal / libudpard

A compact implementation of the Cyphal/UDP protocol in C for high-integrity real-time embedded systems
MIT License
10 stars 8 forks source link

New API and static analysis #31

Closed pavel-kirienko closed 1 year ago

pavel-kirienko commented 1 year ago

Please focus on the documentation in udpard.h. The other changes are trivial and can be ignored.

Changes:

  1. Update the API according to the new design principle that the library is to be used with a third-party UDP/IP+IGMP stack.

Q: Could you be a bit more specific about the multiplexing that you saw in the old version? Do you mean redundant interfaces? A: No, I mean the socket layer (or the lack-of-socket layer, as Erik puts it) already demultiplexes incoming datagrams per subject. The original design joins the demultiplexed datagram feeds into one feed which is then demultiplexed back through AVL tree lookup. This is suboptimal. The new design eliminates one (of the two) AVL lookups from the RX pipeline. To subscribe to a subject, you would call udpardRxSubscribtionInit and then create a socket for this subscription. The socket and the subscription will exist side-by-side.

  1. Set up static analysis and verification:

    • Clang-Tidy and SonarCloud with a large subset of MISRA rules enabled.
    • Build for i386, AMD64, ARM, AVR.
    • Run tests on i386 and AMD64 using both GCC and Clang with coverage.
  2. Switch from Catch2 to Google Test.

pavel-kirienko commented 1 year ago

@lydia-at-amazon @thirtytwobits I updated the docs to try and capture almost all of the issues raised here, and marked the respective threads as resolved. I also added one idea on the future evolution of UdpardTx.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

pavel-kirienko commented 1 year ago

As this is approved, I am going to merge this now. Please move unfinished discussions to new issues if necessary.