Skip to content

Backend/protocol Completed protocol module for new Backend - #657

Merged
JavierRibaldelRio merged 38 commits into
new-backendfrom
backend/protocol
Oct 14, 2026
Merged

JavierRibaldelRio merged 38 commits into
new-backendfrom
backend/protocol

Conversation

@GaziH

@GaziH GaziH commented Oct 12, 2026

Copy link
Copy Markdown

This Merge Request consolidates the protocol module implementation, introducing a unified packet representation (DataOrderPacket), low-level wire serialization/deserialization, and comprehensive module documentation.

Key Updates

Unified DataOrderPacket Representation:

  • Merged DataPacket and OrderPacket under DataOrderPacket in model::packet, avoiding code duplication while maintaining type aliases (DataPacket, OrderPacket).

  • Replaced separate data.rs and order.rs files with a unified codec module in packet/data_order.rs.

Wire & Positional Encoding/Decoding:

  • Header Serialization: Standardized 16-bit packet ID serialization to little-endian (to_le_bytes / from_le_bytes).

  • Payload Codec: Implemented positional reading/writing against definitions in Index using wire::encode_value and wire::decode_value.

  • Safety & Validation: Added strict slice length checks (UnexpectedEof), field count validation (WrongFieldCount), and packet kind enforcement (WrongKind).

Documentation & Clean Module Layout:

  • Added README.md documenting the three-tier architecture (Transport, Packet, Wire), directory layout, and current implementation status.

  • Re-exported public types and functions cleanly from protocol::mod.

Test Suite:

  • Added unit tests in packet/data_order.rs covering little-endian ID handling, positional value serialization, unknown ID lookups, packet kind mismatches, and payload EOF guards.

@GaziH GaziH self-assigned this Oct 12, 2026
@JavierRibaldelRio JavierRibaldelRio added Backend ADJ Related to Avionics Description Json labels Oct 13, 2026
@JavierRibaldelRio JavierRibaldelRio added this to the Alpha v12.0.0 milestone Oct 13, 2026
@JavierRibaldelRio JavierRibaldelRio linked an issue Oct 13, 2026 that may be closed by this pull request
@JavierRibaldelRio
JavierRibaldelRio merged commit 6a8e05a into new-backend Oct 14, 2026
2 checks passed
@JavierRibaldelRio
JavierRibaldelRio deleted the backend/protocol branch October 14, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ADJ Related to Avionics Description Json Backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Protocol

2 participants