This repository contains the exercise for the third NeXosim webinar for ESA ASCEND.
The exercise aims to demonstrate the process involved in implementing a decoder model, utilizing the nexosim-bytes-utils crate, for the purpose of integrating the SerialPort model into a hardware-in-the-loop simulation.
The program goes over multiple test cases, demonstrating various challenges involved in parsing incoming data from external hardware.
The participant's goal is to transform the data broadcast via the SerialPort.bytes_out output port into a TcPacket, utilizing the ByteDecoderModel API and the TcPacket::from_bytes function.
The TcPacket::from_bytes function needs an NSP message with SLIP framing removed to construct a TcPacket instance.
To achieve the goal the participant must modify the implementation of the Decoder struct in lib.rs
- The
bytescrate's Buf trait methods: nexosim-bytes-utils::decodemoduleserial-portmodel
The socat package is used to connect the two serial ports in the demo setup. It can be installed with:
$ sudo apt update && sudo apt install socat
Before running the program, in a separate terminal, the setup script has to be executed.
$ ./setup.sh
This might require setting execution permission for the file.
$ chmod +x setup.sh