pnp-software / cordetfw-pus

PUS Extension of the CORDET Framework
Mozilla Public License 2.0
2 stars 1 forks source link

Type of Discriminant Fields #1

Open pasetti opened 6 years ago

pasetti commented 6 years ago

The framework defines a generic type for all discriminants (CrFwDiscriminant_t). I need to introduce a constraint that the type of all parameters which act as discriminant must be compatible with this type (ideally, they must be equal to it).

With the currently defined services, the parameters acting as discriminants are:

For the PUS Test Suite implementation, I will use a value of unsigned short for all of them.

pasetti commented 5 years ago

The framework function CrFwPcktGetDisc (which returns the value of the discriminant of a packet) must be implemented by the application developers as a switch-case which checks the packet type and then, depending on the packet type, retrieves the field representing the discriminant and returns it as a value of type CrFwDiscriminant_t.

If there is a need to make this function very fast, applications could define a table which associates the function which retrieves the discriminant value to the service number.

The User Manual should define a constraint that the type of all parameters which act as discriminant must be compatible with this type.