Compare commits
5 Commits
3a2b5a9253
...
3043c3b21a
Author | SHA1 | Date |
---|---|---|
|
3043c3b21a | |
|
3416a7dd18 | |
|
5a2a231dea | |
|
78bc3c4a6d | |
|
2ccbb7479f |
|
@ -595,8 +595,10 @@ TimerTime_t LmHandlerGetDutyCycleWaitTime( void )
|
|||
return DutyCycleWaitTime;
|
||||
}
|
||||
|
||||
void LmHandlerJoin( ActivationType_t mode, bool forceRejoin )
|
||||
LmHandlerErrorStatus_t LmHandlerJoin( ActivationType_t mode, bool forceRejoin )
|
||||
{
|
||||
LmHandlerErrorStatus_t lmhStatus = LORAMAC_HANDLER_ERROR;
|
||||
LoRaMacStatus_t status;
|
||||
MlmeReq_t mlmeReq;
|
||||
|
||||
mlmeReq.Type = MLME_JOIN;
|
||||
|
@ -611,7 +613,12 @@ void LmHandlerJoin( ActivationType_t mode, bool forceRejoin )
|
|||
LoRaMacStart();
|
||||
#if (defined( LORAMAC_VERSION ) && ( LORAMAC_VERSION == 0x01000300 ))
|
||||
/* Starts the OTAA join procedure */
|
||||
LoRaMacMlmeRequest( &mlmeReq );
|
||||
status = LoRaMacMlmeRequest( &mlmeReq );
|
||||
|
||||
if( status == LORAMAC_STATUS_OK )
|
||||
{
|
||||
lmhStatus = LORAMAC_STATUS_OK;
|
||||
}
|
||||
#endif /* LORAMAC_VERSION */
|
||||
}
|
||||
else
|
||||
|
@ -661,7 +668,7 @@ void LmHandlerJoin( ActivationType_t mode, bool forceRejoin )
|
|||
{
|
||||
LmHandlerCallbacks->OnJoinRequest( &JoinParams );
|
||||
}
|
||||
LmHandlerRequestClass( LmHandlerParams.DefaultClass );
|
||||
lmhStatus = LmHandlerRequestClass( LmHandlerParams.DefaultClass );
|
||||
#endif /* LORAMAC_VERSION */
|
||||
}
|
||||
|
||||
|
@ -669,10 +676,17 @@ void LmHandlerJoin( ActivationType_t mode, bool forceRejoin )
|
|||
if( ( CtxRestoreDone == false ) || ( forceRejoin == true ) )
|
||||
{
|
||||
/* Starts the join procedure */
|
||||
LoRaMacMlmeRequest( &mlmeReq );
|
||||
status = LoRaMacMlmeRequest( &mlmeReq );
|
||||
|
||||
if( status == LORAMAC_STATUS_OK )
|
||||
{
|
||||
lmhStatus = LORAMAC_STATUS_OK;
|
||||
}
|
||||
}
|
||||
DutyCycleWaitTime = mlmeReq.ReqReturn.DutyCycleWaitTime;
|
||||
#endif /* LORAMAC_VERSION */
|
||||
|
||||
return lmhStatus;
|
||||
}
|
||||
|
||||
LmHandlerFlagStatus_t LmHandlerJoinStatus( void )
|
||||
|
|
|
@ -363,8 +363,12 @@ TimerTime_t LmHandlerGetDutyCycleWaitTime( void );
|
|||
*
|
||||
* \param [in] mode Activation mode (OTAA or ABP)
|
||||
* \param [in] forceRejoin Flag to force the rejoin even if LoRaWAN context can be restored
|
||||
*
|
||||
* \retval status Returns \ref LORAMAC_HANDLER_SUCCESS if request has been
|
||||
* processed else if device not yet joined a network \ref LORAMAC_HANDLER_NO_NETWORK_JOINED
|
||||
* else \ref LORAMAC_HANDLER_ERROR
|
||||
*/
|
||||
void LmHandlerJoin( ActivationType_t mode, bool forceRejoin );
|
||||
LmHandlerErrorStatus_t LmHandlerJoin( ActivationType_t mode, bool forceRejoin );
|
||||
|
||||
/*!
|
||||
* Check whether the Device is joined to the network
|
||||
|
@ -394,7 +398,7 @@ LmHandlerErrorStatus_t LmHandlerPingSlotReq( uint8_t periodicity );
|
|||
*
|
||||
* \retval status Returns \ref LORAMAC_HANDLER_SUCCESS if request has been
|
||||
* processed else if device not yet joined a network \ref LORAMAC_HANDLER_NO_NETWORK_JOINED
|
||||
else \ref LORAMAC_HANDLER_ERROR
|
||||
* else \ref LORAMAC_HANDLER_ERROR
|
||||
*/
|
||||
LmHandlerErrorStatus_t LmHandlerRequestClass( DeviceClass_t newClass );
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -248,7 +248,7 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
for (page_index = start_page_index; page_index < (start_page_index + number_pages); page_index++)
|
||||
{
|
||||
page_address = page_index * FLASH_PAGE_SIZE + FLASH_BASE;
|
||||
if (FLASH_IF_INT_IsEmpty(pDestination, length) != FLASH_IF_MEM_EMPTY)
|
||||
if (FLASH_IF_INT_IsEmpty((void *)uDest, length) != FLASH_IF_MEM_EMPTY)
|
||||
{
|
||||
if (pAllocatedBuffer == NULL)
|
||||
{
|
||||
|
@ -272,6 +272,12 @@ static FLASH_IF_StatusTypedef FLASH_IF_INT_Write(void *pDestination, const void
|
|||
current_dest = page_address;
|
||||
current_source = (uint32_t)pAllocatedBuffer;
|
||||
current_length = FLASH_PAGE_SIZE;
|
||||
|
||||
/* Unlock back the Flash */
|
||||
if (HAL_OK != HAL_FLASH_Unlock())
|
||||
{
|
||||
ret_status = FLASH_IF_LOCK_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue