Skip to content

Commit

Permalink
Initialize diag output callback per instance in NcpBase
Browse files Browse the repository at this point in the history
This fixes a bug where diag get output callback was not set properly if we used instance with iid > 1, leading to failure output.
  • Loading branch information
suveshpratapa committed Jul 26, 2024
1 parent 2cc0798 commit 65ea799
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ncp/ncp_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,9 @@ NcpBase::NcpBase(Instance **aInstances, uint8_t aCount)

OT_ASSERT(i + skipped <= SPINEL_HEADER_IID_MAX);
mInstances[i + skipped] = aInstances[i];
#if OPENTHREAD_CONFIG_DIAG_ENABLE
otDiagSetOutputCallback(mInstances[i + skipped], &NcpBase::HandleDiagOutput_Jump, this);
#endif
}
}
#endif // OPENTHREAD_CONFIG_MULTIPAN_RCP_ENABLE && OPENTHREAD_RADIO
Expand Down Expand Up @@ -358,9 +361,6 @@ NcpBase::NcpBase(Instance *aInstance)
otSrpClientSetCallback(mInstance, HandleSrpClientCallback, this);
#endif
#endif // OPENTHREAD_MTD || OPENTHREAD_FTD
#if OPENTHREAD_CONFIG_DIAG_ENABLE
otDiagSetOutputCallback(mInstance, &NcpBase::HandleDiagOutput_Jump, this);
#endif
mChangedPropsSet.AddLastStatus(SPINEL_STATUS_RESET_UNKNOWN);
mUpdateChangedPropsTask.Post();

Expand Down

0 comments on commit 65ea799

Please sign in to comment.