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

Use a statically constructed table for SB filter initialization #1468

Open
skliper opened this issue Apr 30, 2021 · 1 comment
Open

Use a statically constructed table for SB filter initialization #1468

skliper opened this issue Apr 30, 2021 · 1 comment

Comments

@skliper
Copy link
Contributor

skliper commented Apr 30, 2021

Is your feature request related to a problem? Please describe.
No need to store filter settings in global or individually process:

/* Process the platform cfg file events to be filtered */
if (CFE_PLATFORM_SB_FILTERED_EVENT1 != 0)
{
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].EventID = CFE_PLATFORM_SB_FILTERED_EVENT1;
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].Mask = CFE_PLATFORM_SB_FILTER_MASK1;
CfgFileEventsToFilter++;
} /* end if */
if (CFE_PLATFORM_SB_FILTERED_EVENT2 != 0)
{
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].EventID = CFE_PLATFORM_SB_FILTERED_EVENT2;
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].Mask = CFE_PLATFORM_SB_FILTER_MASK2;
CfgFileEventsToFilter++;
} /* end if */
if (CFE_PLATFORM_SB_FILTERED_EVENT3 != 0)
{
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].EventID = CFE_PLATFORM_SB_FILTERED_EVENT3;
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].Mask = CFE_PLATFORM_SB_FILTER_MASK3;
CfgFileEventsToFilter++;
} /* end if */
if (CFE_PLATFORM_SB_FILTERED_EVENT4 != 0)
{
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].EventID = CFE_PLATFORM_SB_FILTERED_EVENT4;
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].Mask = CFE_PLATFORM_SB_FILTER_MASK4;
CfgFileEventsToFilter++;
} /* end if */
if (CFE_PLATFORM_SB_FILTERED_EVENT5 != 0)
{
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].EventID = CFE_PLATFORM_SB_FILTERED_EVENT5;
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].Mask = CFE_PLATFORM_SB_FILTER_MASK5;
CfgFileEventsToFilter++;
} /* end if */
if (CFE_PLATFORM_SB_FILTERED_EVENT6 != 0)
{
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].EventID = CFE_PLATFORM_SB_FILTERED_EVENT6;
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].Mask = CFE_PLATFORM_SB_FILTER_MASK6;
CfgFileEventsToFilter++;
} /* end if */
if (CFE_PLATFORM_SB_FILTERED_EVENT7 != 0)
{
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].EventID = CFE_PLATFORM_SB_FILTERED_EVENT7;
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].Mask = CFE_PLATFORM_SB_FILTER_MASK7;
CfgFileEventsToFilter++;
} /* end if */
if (CFE_PLATFORM_SB_FILTERED_EVENT8 != 0)
{
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].EventID = CFE_PLATFORM_SB_FILTERED_EVENT8;
CFE_SB_Global.EventFilters[CfgFileEventsToFilter].Mask = CFE_PLATFORM_SB_FILTER_MASK8;
CfgFileEventsToFilter++;
} /* end if */

Describe the solution you'd like
Statically construct the table and use it for initialization, can loop through it for size test.

Describe alternatives you've considered
Not sure how consistent this pattern is, but another candidate for #994 and use for all the services (available for apps if they want it).

Additional context
Code review

Requester Info
Jacob Hageman - NASA/GSFC

@skliper
Copy link
Contributor Author

skliper commented Aug 31, 2021

See also #1919 which really suggests a refactor of this code. This pattern of self-filtering isn't all that friendly to ops, better to design events to not spam to begin with (and put counters in tlm).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant