adsblib is a portable, deterministic C99 library for encoding ADS-B Out DF17 (Extended Squitter) messages — aircraft identification, airborne position (CPR), airborne velocity, and Mode-S CRC24.
It is designed as a reusable encoding core for experimental avionics projects, SDR test-signal generation, and offline validation workflows, in contexts where you need to produce correct, spec-compliant DF17 frames rather than decode them.
Most open-source ADS-B tooling in wide use — dump1090, pyModeS, readsb — is built to decode ADS-B traffic received over RF. There is comparatively little tooling dedicated to the inverse problem: generating correct, standards-compliant DF17 frames from scratch, for use in synthetic traffic generation, decoder testing, SDR-based signal injection, or coursework and research on ADS-B message structure.
adsblib fills that gap with a small, dependency-free, no-allocation C library that any project — embedded, desktop, or bound from another language — can link against to produce correct DF17 frames without depending on a full decoding stack.
| Project | Role | Language | Notes |
|---|---|---|---|
| dump1090 | RF receiver + decoder | C | Full receiver chain, decode-only |
| readsb | RF receiver + decoder | C | dump1090 derivative, decode-only |
| pyModeS | Decoder + research toolkit | Python | Widely used as a reference decoder; no encoder |
| adsblib | Encoder | C99 | No decoding, no RF, no allocation — just correct frame generation |
adsblib does not compete with these projects; it complements them. In fact, adsblib's own validation workflow cross-checks its encoded output against pyModeS's decoder (see Validation).
| Path | Description |
|---|---|
adsblib.h | Public library API |
adsblib.c | Implementation |
validation/test_encoder.c | Independent C unit tests |
validation/encoder_validation.ipynb | Validation notebook (CRC, callsign, CPR, altitude, velocity, stress tests) |
validation/validate_with_pymodes.py | CI-ready pyModeS integration validation |
validation/requirements.txt | Python dependencies for the validation notebook |
[Doxyfile](Doxyfile) | Doxygen configuration used to build the API docs |
developer-docs/ | Mission/scope, architecture, capability roadmap, and design decisions |
Full API reference: https://telmomm.github.io/adsblib/
Docs are generated with Doxygen from the comments in adsblib.h and published to GitHub Pages automatically by .github/workflows/docs.yml on every push to main. The generated output is not committed to the repository.
To build the docs locally:
cc or gcc)make (optional)adsblib is a single translation unit (adsblib.c) with one public header (adsblib.h) and no external dependencies beyond the C standard library and libm. There is currently no build system wrapper — compile it directly as a static object, shared library, or drop the two files into your own project.
Verify the build:
All public functions return enc_status_t (ENC_OK on success) and write into a caller-owned, fixed-size 14-byte frame buffer — adsblib never allocates memory.
| Function | Purpose |
|---|---|
adsb_encode_identification | Encode a DF17 Aircraft Identification message |
adsb_encode_position | Encode a DF17 Airborne Position message (even/odd CPR) |
adsb_encode_surface_position | Encode a DF17 Surface Position message (movement + ground track) |
adsb_encode_velocity | Encode a DF17 Airborne Velocity message (subsonic or supersonic) |
adsb_encode_emergency | Encode a DF17 Aircraft Status / Emergency and Priority Status message |
adsb_encode_target_state | Encode a DF17 Target State and Status message |
adsb_encode_operational_status | Encode a DF17 Aircraft Operational Status message |
adsb_crc24 | Compute Mode-S CRC24 over the first 88 bits of a frame |
adsb_apply_crc | Insert CRC parity into a frame |
adsb_verify_crc | Verify a frame's CRC |
adsb_cpr_encode_latitude / adsb_cpr_encode_longitude | Low-level CPR encoding |
adsb_cpr_nl | CPR NL(lat) longitude zone helper |
adsb_frame_to_hex / adsb_frame_clear | Frame formatting/utility helpers |
adsb_version_string | Returns the library version as "MAJOR.MINOR.PATCH" |
See adsblib.h or the generated docs for the full signatures, and Basic usage below for an end-to-end example.
adsblib does not ship a decoder, so correctness is validated by cross-checking encoder output against an independent, widely used reference decoder (pyModeS) rather than testing the encoder against itself. The validation/encoder_validation.ipynb notebook covers:
The independent C unit tests are the quickest local check and require no Python or external packages:
They run in GitHub Actions on every push to main and every pull request, on both Linux and macOS. They cover the public encoders, frame utilities, CRC generation/verification, field quantization, and invalid-input status codes.
The cross-decoder integration validation remains in the notebook:
The CI entry point is the headless script validation/validate_with_pymodes.py, which uses only the minimal dependencies in validation/requirements-ci.lock. The notebook remains as an interactive, more extensive example of the same cross-decoder validation.
adsblib's target capabilities go beyond frame encoding — see developer-docs/ for the mission/scope, `developer-docs/ARCHITECTURE.md`, the capability roadmap, and the architecture decision records behind adsblib's design constraints.
adsblib follows Semantic Versioning and tracks all notable changes in `CHANGELOG.md`, per Keep a Changelog.
Contributions are welcome. See `CONTRIBUTING.md` for build instructions, the validation workflow, and pull request guidelines. Please also review the `CODE_OF_CONDUCT.md`.
See `SECURITY.md` for the security policy, intended-use scope, and how to report vulnerabilities.
If you use adsblib in academic or research work, please cite it using the metadata in CITATION.cff.
This project is released under the MIT License. See [LICENSE](LICENSE) for the full license text.