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

Provide consistent name lookup API #943

Closed
jphickey opened this issue Oct 8, 2020 · 2 comments · Fixed by #946 or #959
Closed

Provide consistent name lookup API #943

jphickey opened this issue Oct 8, 2020 · 2 comments · Fixed by #946 or #959
Assignees
Milestone

Comments

@jphickey
Copy link
Contributor

jphickey commented Oct 8, 2020

Is your feature request related to a problem? Please describe.
Many CFE resources have a name associated with them, but CFE is rather hit or miss on how Resource IDs (apps, tasks, libs, etc) can be looked up by name.

For instance, CFE_ES_GetAppIDByName() exists, but CFE_ES_GetLibIDByName() does not. Task IDs can be found directly via OSAL through OS_TaskGetIdByName() but there is no CFE version of this despite the fact that ES also tracks tasks.

Describe the solution you'd like
For resource types that have names associated, there should be a consistent API to find the ID by name, similar to CFE_ES_GetAppIDByName(). The following should be implemented, all with the general API pattern (name in, ID out, status return):

CFE_ES_GetTaskIDByName()
CFE_ES_GetLibIDByName()
CFE_ES_GetGenCounterIDByName()
CFE_ES_GetCDSBlockIDByName()

Describe alternatives you've considered
Keep things inconsistent.

Additional context
This is also a prerequisite to #28 - to have libs be manageable similarly to apps, part of that is being able to find lib ID by name, which is required by several management/query commands.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

Edit - turns out and CFE_ES_GetGenCounterIDByName() does exist already. But the others do not.

@jphickey jphickey self-assigned this Oct 8, 2020
@jphickey
Copy link
Contributor Author

jphickey commented Oct 8, 2020

This is probably also a good time to reorganize and consolidate all of the resource ID definitions/functions into a separate source file, rather than leaving them scattered in the existing source files.

@jphickey
Copy link
Contributor Author

jphickey commented Oct 8, 2020

There are also missing/inconsistent functions to get the name based on ID like e.g. CFE_ES_GetAppName().

Should also add:

CFE_ES_GetLibName()
CFE_ES_GetTaskName()
CFE_ES_GetCDSBlockName()
CFE_ES_GetGenCounterName()

with a similar API pattern to the existing CFE_ES_GetAppName() function.

jphickey added a commit to jphickey/cFE that referenced this issue Oct 13, 2020
Implement consistent conversion/lookup functions to translate
between names and IDs for all resource types.

Also reorganize all internal resource ID functions into a separate
source file for better organization.

Clean up documentation and references.
jphickey added a commit to jphickey/cFE that referenced this issue Oct 13, 2020
Implement consistent conversion/lookup functions to translate
between names and IDs for all resource types.

Also reorganize all internal resource ID functions into a separate
source file for better organization.

Clean up documentation and references.
jphickey added a commit to jphickey/cFE that referenced this issue Oct 13, 2020
Implement consistent conversion/lookup functions to translate
between names and IDs for all resource types.

Also reorganize all internal resource ID functions into a separate
source file for better organization.

Clean up documentation and references.
jphickey added a commit to jphickey/cFE that referenced this issue Oct 19, 2020
Add a NULL check to CFE_ES_ResourceID_ToIndex_Internal().  Although
this function is internal, it does check arguments on behalf of the
public APIs which call this.
jphickey added a commit to jphickey/cFE that referenced this issue Oct 20, 2020
For backward compatibility - remove logic that actually made thes
different numerical values.  This should be put back in at some point.
astrogeco added a commit that referenced this issue Oct 21, 2020
Fix #943, #924 and #502, improve resource ID management
@astrogeco astrogeco added this to the 7.0.0 milestone Oct 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants