Skip to content

Fix nasa#229, Check return values for CFE_SB_Subscribe in TO_LAB_init()#230

Merged
myc-yang merged 1 commit into
nasa:devfrom
myc-yang:229-ignored-return-value-cfe-sb-subscribe
Jun 15, 2026
Merged

Fix nasa#229, Check return values for CFE_SB_Subscribe in TO_LAB_init()#230
myc-yang merged 1 commit into
nasa:devfrom
myc-yang:229-ignored-return-value-cfe-sb-subscribe

Conversation

@myc-yang

Copy link
Copy Markdown
Contributor

Describe the contribution
When subscribing to TO_LAB CMD and Send HK CMD, we are ignoring the return value. This is captured in #229.

Testing performed
I did not run any unit tests because there were none written for TO_LAB using UT_assert.

Expected behavior changes

  • Behavior Change: An error event message will be outputted if TO_LAB fails to subscribe to TO_LAB_CMD_MID or TO_LAB_SEND_HK_MID

System(s) tested on

  • Hardware: PC
  • OS: Ubuntu 18.04
  • Versions: [e.g. cFE 6.6, OSAL 4.2, PSP 1.3 for mcp750, any related apps or tools]

Additional context
Add any other context about the contribution here.

Third party code
If included, identify any third party code and provide text file of license

Contributor Info - All information REQUIRED for consideration of pull request
Michael Yang NASA/GSFC

@myc-yang myc-yang force-pushed the 229-ignored-return-value-cfe-sb-subscribe branch from 742ca38 to 1b1a1e6 Compare May 18, 2026 17:45
@myc-yang myc-yang requested a review from brandt-nasa May 18, 2026 17:53

@jphickey jphickey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to my comment in the DS change here: nasa/DS#147 (review)

I don't like having if/else branches nested like this, as it increases the cyclic complexity of the functions. I would rather this be divided into subroutines or otherwise simplified to avoid deeply-nested if/else branches.

That being said, I can accept the argument that this is a "lab" app.

@myc-yang myc-yang force-pushed the 229-ignored-return-value-cfe-sb-subscribe branch from 1b1a1e6 to c7efdfa Compare June 1, 2026 17:40
@myc-yang myc-yang self-assigned this Jun 1, 2026
Comment thread fsw/src/to_lab_app.c Outdated
@myc-yang myc-yang force-pushed the 229-ignored-return-value-cfe-sb-subscribe branch 4 times, most recently from 262dddf to d8fcc63 Compare June 3, 2026 13:04
Comment thread fsw/src/to_lab_app.c Outdated
Comment thread fsw/src/to_lab_app.c Outdated
@myc-yang myc-yang force-pushed the 229-ignored-return-value-cfe-sb-subscribe branch from d8fcc63 to 3363d43 Compare June 15, 2026 12:05
…_MID and TO_LAB_SEND_HK_MID in TO_LAB_init() in fsw/src/to_lab_app.c
@myc-yang myc-yang force-pushed the 229-ignored-return-value-cfe-sb-subscribe branch from 3363d43 to 51cf370 Compare June 15, 2026 12:09

@jphickey jphickey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@myc-yang myc-yang merged commit c757665 into nasa:dev Jun 15, 2026
11 checks passed
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

Successfully merging this pull request may close these issues.

3 participants