Skip to content

Commit

Permalink
[simulation] remove use of internal definitions/headers in radio plat…
Browse files Browse the repository at this point in the history
…form (openthread#6766)

This commit updates the `simulation/radio.c` and removes the uses of
core internal macro `VerifyOfExit()` and replaces them with
`otEXPECT_ACTION()`. This ensures that radio platform layer does not
include the internal OT header like "common/code_utils.hpp".
  • Loading branch information
abtink authored Jun 28, 2021
1 parent 2752365 commit 2db3ddc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions examples/platforms/simulation/radio.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include <openthread/platform/radio.h>
#include <openthread/platform/time.h>

#include "common/code_utils.hpp"
#include "utils/code_utils.h"
#include "utils/link_metrics.h"
#include "utils/mac_frame.h"
Expand Down Expand Up @@ -1230,7 +1229,7 @@ otError otPlatRadioSetChannelMaxTransmitPower(otInstance *aInstance, uint8_t aCh

otError error = OT_ERROR_NONE;

VerifyOrExit(aChannel >= kMinChannel && aChannel <= kMaxChannel, error = OT_ERROR_INVALID_ARGS);
otEXPECT_ACTION(aChannel >= kMinChannel && aChannel <= kMaxChannel, error = OT_ERROR_INVALID_ARGS);
sChannelMaxTransmitPower[aChannel - kMinChannel] = aMaxPower;

exit:
Expand Down Expand Up @@ -1262,7 +1261,7 @@ otError otPlatRadioGetRegion(otInstance *aInstance, uint16_t *aRegionCode)
OT_UNUSED_VARIABLE(aInstance);
otError error = OT_ERROR_NONE;

VerifyOrExit(aRegionCode != NULL, error = OT_ERROR_INVALID_ARGS);
otEXPECT_ACTION(aRegionCode != NULL, error = OT_ERROR_INVALID_ARGS);

*aRegionCode = sRegionCode;
exit:
Expand Down

0 comments on commit 2db3ddc

Please sign in to comment.