From 4f65c4364bfa812ce91cb7479e311aa746414532 Mon Sep 17 00:00:00 2001 From: Ching-Hsin Lee Date: Fri, 20 Oct 2023 17:58:45 +0800 Subject: [PATCH 1/3] Fix _Cellular_AtcmdDataSend interDelayMS * Fix the inter delay for _Cellular_AtcmdDataSend --- source/cellular_pkthandler.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/cellular_pkthandler.c b/source/cellular_pkthandler.c index d819b656..ac409056 100644 --- a/source/cellular_pkthandler.c +++ b/source/cellular_pkthandler.c @@ -299,9 +299,6 @@ static CellularPktStatus_t _Cellular_DataSendWithTimeoutDelayRaw( CellularContex } } - /* Some driver required wait for a minimum of delay before sending data. */ - Platform_Delay( interDelayMS ); - /* End pattern for specific modem. */ if( ( pktStatus == CELLULAR_PKT_STATUS_OK ) && ( dataReq.pEndPattern != NULL ) ) { @@ -706,6 +703,12 @@ CellularPktStatus_t _Cellular_AtcmdDataSend( CellularContext_t * pContext, if( pktStatus == CELLULAR_PKT_STATUS_OK ) { + if( interDelayMS > 0U ) + { + /* Some drivers require a minimum delay before sending data. */ + Platform_Delay( interDelayMS ); + } + pktStatus = _Cellular_DataSendWithTimeoutDelayRaw( pContext, dataReq, dataTimeoutMS, interDelayMS ); } From 173fd9ee1b8c0c1f43b00e3a4b550a622c973554 Mon Sep 17 00:00:00 2001 From: Ching-Hsin Lee Date: Fri, 20 Oct 2023 18:25:32 +0800 Subject: [PATCH 2/3] Fix comment --- source/cellular_pkthandler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/cellular_pkthandler.c b/source/cellular_pkthandler.c index ac409056..755db756 100644 --- a/source/cellular_pkthandler.c +++ b/source/cellular_pkthandler.c @@ -705,7 +705,7 @@ CellularPktStatus_t _Cellular_AtcmdDataSend( CellularContext_t * pContext, { if( interDelayMS > 0U ) { - /* Some drivers require a minimum delay before sending data. */ + /* Cellular modem may require a minimum delay before sending data. */ Platform_Delay( interDelayMS ); } From e570f09f0995aef9a5d17880b1231fc9191c9868 Mon Sep 17 00:00:00 2001 From: Ching-Hsin Lee Date: Fri, 20 Oct 2023 18:28:19 +0800 Subject: [PATCH 3/3] Remove unused parameter --- source/cellular_pkthandler.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/cellular_pkthandler.c b/source/cellular_pkthandler.c index 755db756..839f692b 100644 --- a/source/cellular_pkthandler.c +++ b/source/cellular_pkthandler.c @@ -68,8 +68,7 @@ static CellularPktStatus_t _Cellular_AtcmdRequestTimeoutWithCallbackRaw( Cellula uint32_t timeoutMS ); static CellularPktStatus_t _Cellular_DataSendWithTimeoutDelayRaw( CellularContext_t * pContext, CellularAtDataReq_t dataReq, - uint32_t timeoutMs, - uint32_t interDelayMS ); + uint32_t timeoutMs ); static void _Cellular_PktHandlerAcquirePktRequestMutex( CellularContext_t * pContext ); static void _Cellular_PktHandlerReleasePktRequestMutex( CellularContext_t * pContext ); static int _searchCompareFunc( const void * pInputToken, @@ -267,8 +266,7 @@ static CellularPktStatus_t _Cellular_AtcmdRequestTimeoutWithCallbackRaw( Cellula static CellularPktStatus_t _Cellular_DataSendWithTimeoutDelayRaw( CellularContext_t * pContext, CellularAtDataReq_t dataReq, - uint32_t timeoutMs, - uint32_t interDelayMS ) + uint32_t timeoutMs ) { CellularPktStatus_t respCode = CELLULAR_PKT_STATUS_OK; CellularPktStatus_t pktStatus = CELLULAR_PKT_STATUS_OK; @@ -709,7 +707,7 @@ CellularPktStatus_t _Cellular_AtcmdDataSend( CellularContext_t * pContext, Platform_Delay( interDelayMS ); } - pktStatus = _Cellular_DataSendWithTimeoutDelayRaw( pContext, dataReq, dataTimeoutMS, interDelayMS ); + pktStatus = _Cellular_DataSendWithTimeoutDelayRaw( pContext, dataReq, dataTimeoutMS ); } _Cellular_PktHandlerReleasePktRequestMutex( pContext ); @@ -766,7 +764,7 @@ CellularPktStatus_t _Cellular_TimeoutAtcmdDataSendSuccessToken( CellularContext_ if( pktStatus == CELLULAR_PKT_STATUS_OK ) { - pktStatus = _Cellular_DataSendWithTimeoutDelayRaw( pContext, dataReq, dataTimeoutMS, 0U ); + pktStatus = _Cellular_DataSendWithTimeoutDelayRaw( pContext, dataReq, dataTimeoutMS ); } _Cellular_PktHandlerReleasePktRequestMutex( pContext );