You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My device work perfectly with Class A and class B mode when it join with OTTA, But it can not switched to Class B when it joined with ABP, I had to debug my code, found the bug in LoRaMac-node.
function LoRaMacInitialization in LoRaMac.c. here is the code:
when call ResetMacParameters, the MacCtx..MacCallbacks not initial, so it's NULL, thus ResetMacParameters do not initial class b's callbacks, like this:
if( MacCtx.MacCallbacks != NULL )
{
classBCallbacks.GetTemperatureLevel = MacCtx.MacCallbacks->GetTemperatureLevel;
classBCallbacks.MacProcessNotify = MacCtx.MacCallbacks->MacProcessNotify;
}
The ResetMacParameters function is called again when join with OTTA node, so classBCallbacks is initialed and work perfectly. so I had to change the code to thus:
My device work perfectly with Class A and class B mode when it join with OTTA, But it can not switched to Class B when it joined with ABP, I had to debug my code, found the bug in LoRaMac-node.
function LoRaMacInitialization in LoRaMac.c. here is the code:
when call ResetMacParameters, the MacCtx..MacCallbacks not initial, so it's NULL, thus ResetMacParameters do not initial class b's callbacks, like this:
if( MacCtx.MacCallbacks != NULL )
{
classBCallbacks.GetTemperatureLevel = MacCtx.MacCallbacks->GetTemperatureLevel;
classBCallbacks.MacProcessNotify = MacCtx.MacCallbacks->MacProcessNotify;
}
The ResetMacParameters function is called again when join with OTTA node, so classBCallbacks is initialed and work perfectly. so I had to change the code to thus:
...
MacCtx.MacCallbacks = callbacks;
ResetMacParameters( false );
...
The text was updated successfully, but these errors were encountered: