Skip to content

Commit 5ded1c2

Browse files
authored
Reset the AT command type before calling callback (#113)
* Reset the AT command type before calling pkthandler callback
1 parent 329d45a commit 5ded1c2

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

source/cellular_pktio.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -702,19 +702,19 @@ static CellularPktStatus_t _handleMsgType( CellularContext_t * pContext,
702702

703703
if( pkStatus == CELLULAR_PKT_STATUS_OK )
704704
{
705-
/* This command is completed. Call the user callback to parse the result. */
706-
if( pContext->pPktioHandlepktCB != NULL )
707-
{
708-
( void ) pContext->pPktioHandlepktCB( pContext, AT_SOLICITED, *ppAtResp );
709-
}
710-
711705
/* Reset the command type. Further response from cellular modem won't be
712706
* regarded as AT_SOLICITED response. */
713707
PlatformMutex_Lock( &pContext->PktRespMutex );
714708
pContext->PktioAtCmdType = CELLULAR_AT_NO_COMMAND;
715709
pContext->pRespPrefix = NULL;
716710
PlatformMutex_Unlock( &pContext->PktRespMutex );
717711

712+
/* This command is completed. Call the user callback to parse the result. */
713+
if( pContext->pPktioHandlepktCB != NULL )
714+
{
715+
( void ) pContext->pPktioHandlepktCB( pContext, AT_SOLICITED, *ppAtResp );
716+
}
717+
718718
FREE_AT_RESPONSE_AND_SET_NULL( *ppAtResp );
719719
}
720720
else if( pkStatus == CELLULAR_PKT_STATUS_PENDING_BUFFER )

0 commit comments

Comments
 (0)