ASU-cubesat / cfdp-rs

A rust implementation of the CCSDS File Delivery Protocol (CFDP)
MIT License
9 stars 2 forks source link

Make the Metadata mandatory in the SendTransaction #10

Closed xpromache closed 1 year ago

xpromache commented 1 year ago

Currently in daemon.rs, the SendTransaction is initialized without metadata and immediately after the metadata is set: https://github.com/ASU-cubesat/cfdp-rs/blob/main/cfdp-core/src/daemon.rs#L749

That means in practice we never have a SendTransaction without metadata (except a few places in the unit tests).

I propose to initialize directly the SendTransaction with the metadata so it will not be behind and Option anymore. That allows to simplify a lot of methods which now raise an error that the metadata is not set.

xpromache commented 1 year ago

If you agree, I can make a pull request for this. I already did it halfway through when refactoring the SendTransaction to fix #9

mkolopanis commented 1 year ago

Since the Send/Recv transactions have been separated now, I agree there is no reason to keep metadata behind an option for the Send side.