Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Name of Getter/Setter Functions for Parameters in Derived Packets #13

Open
pasetti opened this issue Feb 24, 2023 · 0 comments
Open

Name of Getter/Setter Functions for Parameters in Derived Packets #13

pasetti opened this issue Feb 24, 2023 · 0 comments
Assignees

Comments

@pasetti
Copy link
Contributor

pasetti commented Feb 24, 2023

Consider the function to get parameter 'Par' from the 'InfoRep' packet (formerly called 'Rep1') with discriminant EVT_DUMMY_1. In the past, its getter function had the following structure:

/**
 * Get "Par" from "Rep1_EVT_DUMMY_1" packet.
 * @param p Pointer to the packet.
 * @return Value of "Par".
 */
static inline CrPsEightBit_t getEvtRep1_EVT_DUMMY_1Par(void* p) {
   Rep1_EVT_DUMMY_1_t* t;
   t = (Rep1_EVT_DUMMY_1_t*)p;
   return t->Par;
}

Now instead it looks like this:

/**
 * Getter function for parameter Par in packet InfoRep_Dummy1
 * @param p Pointer to the packet
 * @return Value of parameter InfoRep_Dummy1
 */
static inline CrPsEightBit_t getEvtInfoRep_Dummy1Par(void* p) {
    InfoRep_Dummy1_t* t;
     t = (InfoRep_Dummy1_t*)p;
    return __builtin_bswap16(t->Par);
}

What has happened is that now we build the name of the getter function using the name of the packet ('InfoRep_Dummy1') rather than the name of the packet's distriminant ('EVT_DUMMY_1'). I think that the new format is preferable but its use will require some changes to the test suite.

@pasetti pasetti self-assigned this Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant