CNES / ccsdsmo-malc

CCSDS MO MAL C API
https://cnes.github.io/ccsdsmo-malc
MIT License
14 stars 4 forks source link

Missing function to encode the deregister argument #11

Closed gbonnefille closed 7 years ago

gbonnefille commented 7 years ago

Reading CCSDS 521.0-B-2 it seems that operations register and deregister do not take the same arguments. The first one use a Subscription while the second one uses a List<Identifier>.

The malc seems not conformant to this as it offers functions for encoding the arguments for register operation, but nothing specific for deregister.

Furthermore, a test seems to be incorrect as it encodes a whole Subscription.

What is the correct way to do a deregister operation?

freyssin commented 7 years ago

True, it seems that the MAL/C interface needs more functions for encoding the arguments for deregister operation:

int mal_deregister_add_encoding_length(mal_encoder_t encoder, mal_identifier_list_t element, void cursor); int mal_deregister_encode(void cursor, mal_encoder_t encoder, mal_identifier_list_t element); int mal_deregister_decode(void cursor, mal_decoder_t decoder, mal_identifier_list_t **res);

The pubsub test doesn't implement a complete broker but it needs to be corrected.