Skip to content

Commit

Permalink
Update callback result handle in _preprocessInputBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
chinglee-iot committed Nov 24, 2023
1 parent 26d67ff commit c49cfd1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions source/cellular_pktio.c
Original file line number Diff line number Diff line change
Expand Up @@ -921,10 +921,10 @@ static bool _preprocessInputBuffer( CellularContext_t * pContext,
&bufferLength );
PlatformMutex_Unlock( &pContext->PktRespMutex );

keepProcess = _handleCallbackResult( pContext, pktStatus, pTempLine, pBytesRead );

if( pktStatus == CELLULAR_PKT_STATUS_OK )
{
/* Handle the callback result is CELLULAR_PKT_STATUS_OK in this function.
* Check the bufferLength returned by callback function here. */
if( bufferLength > *pBytesRead )
{
/* The input buffer callback returns incorrect buffer length. */
Expand All @@ -950,6 +950,10 @@ static bool _preprocessInputBuffer( CellularContext_t * pContext,
*pBytesRead = *pBytesRead - bufferLength;
}
}
else
{
keepProcess = _handleCallbackResult( pContext, pktStatus, pTempLine, pBytesRead );
}
}

return keepProcess;
Expand Down

0 comments on commit c49cfd1

Please sign in to comment.