mirror of
https://github.com/espressif/openthread.git
synced 2026-07-29 07:07:47 +00:00
[mac] enable radio layer before setting parameters (#2048)
This commit adjusts the order for calling radio layer API to make sure otPlatRadioEnable() is the first called to radio layer. This mainly addresses the issue of otInstance which is not provided when initializing radio layer.
This commit is contained in:
@@ -310,7 +310,7 @@ extern "C" {
|
||||
#define otLogCritMle(aInstance, aFormat, ...) otLogCrit(&aInstance, OT_LOG_REGION_MLE, aFormat, ## __VA_ARGS__)
|
||||
#define otLogWarnMle(aInstance, aFormat, ...) otLogWarn(&aInstance, OT_LOG_REGION_MLE, aFormat, ## __VA_ARGS__)
|
||||
#define otLogWarnMleErr(aInstance, aError, aFormat, ...) \
|
||||
otLogWarn(&aInstance, OT_LOG_REGION_MAC, "Error %s: " aFormat, otThreadErrorToString(aError), ## __VA_ARGS__)
|
||||
otLogWarn(&aInstance, OT_LOG_REGION_MLE, "Error %s: " aFormat, otThreadErrorToString(aError), ## __VA_ARGS__)
|
||||
#define otLogInfoMle(aInstance, aFormat, ...) otLogInfo(&aInstance, OT_LOG_REGION_MLE, aFormat, ## __VA_ARGS__)
|
||||
#define otLogDebgMle(aInstance, aFormat, ...) otLogDebg(&aInstance, OT_LOG_REGION_MLE, aFormat, ## __VA_ARGS__)
|
||||
#else
|
||||
|
||||
@@ -185,13 +185,13 @@ Mac::Mac(ThreadNetif &aThreadNetif):
|
||||
|
||||
memset(&mCounters, 0, sizeof(otMacCounters));
|
||||
|
||||
otPlatRadioEnable(&GetInstance());
|
||||
|
||||
SetExtendedPanId(sExtendedPanidInit);
|
||||
SetNetworkName(sNetworkNameInit);
|
||||
SetPanId(mPanId);
|
||||
SetExtAddress(mExtAddress);
|
||||
SetShortAddress(mShortAddress);
|
||||
|
||||
otPlatRadioEnable(&GetInstance());
|
||||
}
|
||||
|
||||
otError Mac::ActiveScan(uint32_t aScanChannels, uint16_t aScanDuration, ActiveScanHandler aHandler, void *aContext)
|
||||
|
||||
Reference in New Issue
Block a user