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

Compact Cyphal/UDP in C

Main Workflow Reliability Rating Coverage Forum

LibUDPard is a compact implementation of the Cyphal/UDP protocol in C99/C11 for high-integrity real-time embedded systems.

Cyphal is an open lightweight data bus standard designed for reliable intravehicular communication in aerospace and robotic applications via CAN bus, UDP, and other robust transports.

We pronounce LibUDPard as lib-you-dee-pee-ard.

Features

Some of the features listed here are intrinsic properties of Cyphal.

Usage

The library implements the Cyphal/UDP protocol, which is a transport-layer entity. An application using this library will need to implement the presentation layer above the library, perhaps with the help of the Nunavut transpiler, and the network layer below the library using a third-party UDP/IP stack implementation with multicast/IGMP support (TCP and ARP are not needed). In the most straightforward case, the network layer can be based on the standard Berkeley socket API or a lightweight embedded stack such as LwIP.

%%{init: {"fontFamily": "Ubuntu Mono, monospace", "flowchart": {"curve": "basis"}}}%%
flowchart TD
    classDef OpenCyphal color:#00DAC6,fill:#1700b3,stroke:#00DAC6,stroke-width:2px,font-weight:600
    Application <-->|messages,\nrequests,\nresponses| LibUDPard[fa:fa-code LibUDPard]
    class LibUDPard OpenCyphal
    LibUDPard <-->|multicast datagrams| UDP
    subgraph domain_udpip["3rd-party UDP/IP+IGMP stack"]
        UDP <--> IP["IPv4, IGMPv1+"] <--> MAC
    end
    MAC <--> PHY

To integrate the library into your application, simply copy the files under libudpard/ into your project tree, or add this entire repository as a submodule. The library contains only one translation unit named udpard.c; no special compiler options are needed to build it. The library should be compatible with all conventional computer architectures where a standards-compliant C99 compiler is available.

Read the API docs in libudpard/udpard.h. For complete usage examples, please refer to https://github.com/OpenCyphal-Garage/demos.

Revisions

v1.0

Initial release.