Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle undefined message when sending AT command #110

Merged
merged 54 commits into from
Oct 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
210a55c
Update cellular library to MIT license
chinglee-iot Mar 29, 2021
298ae4c
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jun 30, 2021
21ea9bc
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jul 16, 2021
6690f3b
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jul 23, 2021
4a58d89
Merge branch 'FreeRTOS:main' into main
chinglee-iot Aug 24, 2021
955ebc0
Merge branch 'FreeRTOS:main' into main
chinglee-iot Oct 25, 2021
bba8adf
Merge branch 'FreeRTOS:main' into main
chinglee-iot Nov 4, 2021
440bec9
Merge branch 'FreeRTOS:main' into main
chinglee-iot Nov 9, 2021
a0fb7c7
Merge branch 'FreeRTOS:main' into main
chinglee-iot Nov 16, 2021
b28ed63
Merge branch 'FreeRTOS:main' into main
chinglee-iot Nov 24, 2021
b40cb10
Merge branch 'FreeRTOS:main' into main
chinglee-iot Dec 1, 2021
ca024c6
Merge branch 'FreeRTOS:main' into main
chinglee-iot Dec 1, 2021
277d8b7
Merge branch 'FreeRTOS:main' into main
chinglee-iot Dec 15, 2021
06402e9
Merge branch 'FreeRTOS:main' into main
chinglee-iot Dec 21, 2021
a993410
Merge branch 'FreeRTOS:main' into main
chinglee-iot Dec 21, 2021
45b9bcd
Merge branch 'FreeRTOS:main' into main
chinglee-iot Dec 27, 2021
cacbf87
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jan 6, 2022
128407c
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jan 7, 2022
b1e3e46
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jan 10, 2022
70e76c4
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jan 11, 2022
107896c
Merge branch 'FreeRTOS:main' into main
chinglee-iot Feb 7, 2022
b3f4fab
Merge branch 'FreeRTOS:main' into main
chinglee-iot Mar 15, 2022
5027c96
Merge branch 'FreeRTOS:main' into main
chinglee-iot Apr 27, 2022
61f5c46
Merge branch 'FreeRTOS:main' into main
chinglee-iot May 11, 2022
14cb0e7
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jun 7, 2022
7a5972d
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jun 22, 2022
a566304
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jul 1, 2022
9dd71d0
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jul 7, 2022
4584fbb
Merge branch 'FreeRTOS:main' into main
chinglee-iot Jul 18, 2022
74bfc9d
Merge branch 'FreeRTOS:main' into main
chinglee-iot Sep 23, 2022
dcff898
Merge branch 'FreeRTOS:main' into main
chinglee-iot Sep 28, 2022
607a810
Use PktRespMutex in pktio thread
chinglee-iot Sep 29, 2022
ca85365
Update pktio to handle undefined message when sending AT command
chinglee-iot Sep 29, 2022
ca70d3f
Fix uncrustify
chinglee-iot Sep 29, 2022
b819f36
Fix lexicon
chinglee-iot Sep 29, 2022
d456d75
Fix unit test compile warning
chinglee-iot Sep 29, 2022
d59fa57
Update size
chinglee-iot Sep 29, 2022
14d1e2c
Fix typo
chinglee-iot Sep 29, 2022
7b94c6b
Reduce the lock range
chinglee-iot Sep 30, 2022
6cbb2d2
Update for CI
chinglee-iot Sep 30, 2022
4b24847
Fix memory and CI again
chinglee-iot Sep 30, 2022
0c1f0a2
Fix CI
chinglee-iot Sep 30, 2022
d667270
Add more test case for coverage
chinglee-iot Sep 30, 2022
1c627e7
Add response prefix test case
chinglee-iot Sep 30, 2022
4fd030d
Fix formatting
chinglee-iot Sep 30, 2022
93c9fad
Remove unnecessary comment
chinglee-iot Oct 4, 2022
f9343a3
Update HL7802 for ATE0
chinglee-iot Oct 4, 2022
9049b6e
Update HL7802 ATE0 type
chinglee-iot Oct 4, 2022
647e5c2
Update ATE0
chinglee-iot Oct 4, 2022
56c75f9
Remove comm interface resp lock
chinglee-iot Oct 4, 2022
aa3956e
Fix typo
chinglee-iot Oct 4, 2022
35591ad
Update size
chinglee-iot Oct 5, 2022
2fb0fb7
Fix comment
chinglee-iot Oct 5, 2022
635b0bf
Update complexity
chinglee-iot Oct 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/doxygen/include/size_table.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@
</tr>
<tr>
<td>cellular_common_api.c</td>
<td><center>0.7K</center></td>
<td><center>0.6K</center></td>
<td><center>0.5K</center></td>
</tr>
<tr>
<td>cellular_common.c</td>
<td><center>1.6K</center></td>
<td><center>1.7K</center></td>
<td><center>1.5K</center></td>
</tr>
<tr>
<td>cellular_pkthandler.c</td>
<td><center>1.5K</center></td>
<td><center>1.4K</center></td>
<td><center>1.7K</center></td>
<td><center>1.6K</center></td>
</tr>
<tr>
<td>cellular_pktio.c</td>
<td><center>2.0K</center></td>
<td><center>1.8K</center></td>
<td><center>1.6K</center></td>
</tr>
<tr>
<td><b>Total estimates</b></td>
<td><b><center>14.2K</center></b></td>
<td><b><center>12.9K</center></b></td>
<td><b><center>14.8K</center></b></td>
<td><b><center>13.4K</center></b></td>
</tr>
</table>
3 changes: 3 additions & 0 deletions lexicon.txt
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ pktioreadthread
pktiosendatcmd
pktiosenddata
pktioshutdown
pktrequestmutex
pktrespmutex
pktrespqueue
pktrxcallback
pktstatus
Expand Down Expand Up @@ -799,6 +801,7 @@ technoloyg
tempvalue
testindex
testresultnumber
threadreturn
threadroutine
ticktype
timeoutatcmddatarecvrequestwithcallback
Expand Down
17 changes: 13 additions & 4 deletions modules/hl7802/cellular_hl7802.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,15 @@ CellularError_t Cellular_ModuleEnableUE( CellularContext_t * pContext )
{
CellularError_t cellularStatus = CELLULAR_SUCCESS;
CellularPktStatus_t pktStatus = CELLULAR_PKT_STATUS_OK;
CellularAtReq_t atReqGetWoPrefix =
{
NULL,
CELLULAR_AT_WO_PREFIX,
NULL,
NULL,
NULL,
0
};
CellularAtReq_t atReqGetNoResult =
ActoryOu marked this conversation as resolved.
Show resolved Hide resolved
{
NULL,
Expand All @@ -351,8 +360,8 @@ CellularError_t Cellular_ModuleEnableUE( CellularContext_t * pContext )
if( pContext != NULL )
{
/* Disable echo. */
atReqGetNoResult.pAtCmd = "ATE0";
cellularStatus = sendAtCommandWithRetryTimeout( pContext, &atReqGetNoResult,
atReqGetWoPrefix.pAtCmd = "ATE0";
cellularStatus = sendAtCommandWithRetryTimeout( pContext, &atReqGetWoPrefix,
CELLULAR_HL7802_AT_TIMEOUT_2_SECONDS_MS );

if( cellularStatus == CELLULAR_SUCCESS )
Expand Down Expand Up @@ -464,8 +473,8 @@ CellularError_t Cellular_ModuleEnableUE( CellularContext_t * pContext )
if( cellularStatus == CELLULAR_SUCCESS )
{
Platform_Delay( CELLULAR_HL7802_RESET_DELAY_MS );
atReqGetNoResult.pAtCmd = "ATE0";
cellularStatus = sendAtCommandWithRetryTimeout( pContext, &atReqGetNoResult,
atReqGetWoPrefix.pAtCmd = "ATE0";
cellularStatus = sendAtCommandWithRetryTimeout( pContext, &atReqGetWoPrefix,
CELLULAR_HL7802_AT_TIMEOUT_2_SECONDS_MS );
}
}
Expand Down
14 changes: 11 additions & 3 deletions modules/sara_r4/cellular_r4.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,15 @@ CellularError_t rebootCellularModem( CellularContext_t * pContext,
CellularError_t cellularStatus = CELLULAR_SUCCESS;
CellularPktStatus_t pktStatus = CELLULAR_PKT_STATUS_OK;
uint32_t count = 0;

CellularAtReq_t atReqGetWoPrefix =
{
NULL,
CELLULAR_AT_WO_PREFIX,
NULL,
NULL,
NULL,
0
};
CellularAtReq_t atReqGetNoResult =
ActoryOu marked this conversation as resolved.
Show resolved Hide resolved
{
"AT+CFUN=15",
Expand All @@ -283,9 +291,9 @@ CellularError_t rebootCellularModem( CellularContext_t * pContext,
{
LogInfo( ( "rebootCellularModem: Use ATE0 command to test modem status." ) );

atReqGetNoResult.pAtCmd = "ATE0";
atReqGetWoPrefix.pAtCmd = "ATE0";

pktStatus = _Cellular_TimeoutAtcmdRequestWithCallback( pContext, atReqGetNoResult, ENBABLE_MODULE_UE_REBOOT_POLL_TIME );
pktStatus = _Cellular_TimeoutAtcmdRequestWithCallback( pContext, atReqGetWoPrefix, ENBABLE_MODULE_UE_REBOOT_POLL_TIME );
cellularStatus = _Cellular_TranslatePktStatus( pktStatus );

if( cellularStatus == CELLULAR_SUCCESS )
Expand Down
3 changes: 3 additions & 0 deletions source/cellular_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1115,6 +1115,7 @@ CellularError_t _Cellular_RegisterUndefinedRespCallback( CellularContext_t * pCo
else
{
/* undefinedRespCallback can be set to NULL to unregister the callback. */
PlatformMutex_Lock( &pContext->PktRespMutex );
pContext->undefinedRespCallback = undefinedRespCallback;

if( pContext->undefinedRespCallback != NULL )
Expand All @@ -1125,6 +1126,8 @@ CellularError_t _Cellular_RegisterUndefinedRespCallback( CellularContext_t * pCo
{
pContext->pUndefinedRespCBContext = NULL;
}

PlatformMutex_Unlock( &pContext->PktRespMutex );
}

return cellularStatus;
Expand Down
10 changes: 10 additions & 0 deletions source/cellular_common_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ CellularError_t Cellular_CommonRegisterUrcNetworkRegistrationEventCallback( Cell
}
else
{
PlatformMutex_Lock( &pContext->PktRespMutex );
pContext->cbEvents.networkRegistrationCallback = networkRegistrationCallback;
pContext->cbEvents.pNetworkRegistrationCallbackContext = pCallbackContext;
PlatformMutex_Unlock( &pContext->PktRespMutex );
}

return cellularStatus;
Expand All @@ -231,8 +233,10 @@ CellularError_t Cellular_CommonRegisterUrcPdnEventCallback( CellularHandle_t cel
}
else
{
PlatformMutex_Lock( &pContext->PktRespMutex );
pContext->cbEvents.pdnEventCallback = pdnEventCallback;
pContext->cbEvents.pPdnEventCallbackContext = pCallbackContext;
PlatformMutex_Unlock( &pContext->PktRespMutex );
}

return cellularStatus;
Expand All @@ -256,8 +260,10 @@ CellularError_t Cellular_CommonRegisterUrcSignalStrengthChangedCallback( Cellula
}
else
{
PlatformMutex_Lock( &pContext->PktRespMutex );
pContext->cbEvents.signalStrengthChangedCallback = signalStrengthChangedCallback;
pContext->cbEvents.pSignalStrengthChangedCallbackContext = pCallbackContext;
PlatformMutex_Unlock( &pContext->PktRespMutex );
}

return cellularStatus;
Expand All @@ -281,8 +287,10 @@ CellularError_t Cellular_CommonRegisterUrcGenericCallback( CellularHandle_t cell
}
else
{
PlatformMutex_Lock( &pContext->PktRespMutex );
pContext->cbEvents.genericCallback = genericCallback;
pContext->cbEvents.pGenericCallbackContext = pCallbackContext;
PlatformMutex_Unlock( &pContext->PktRespMutex );
}

return cellularStatus;
Expand All @@ -306,8 +314,10 @@ CellularError_t Cellular_CommonRegisterModemEventCallback( CellularHandle_t cell
}
else
{
PlatformMutex_Lock( &pContext->PktRespMutex );
pContext->cbEvents.modemEventCallback = modemEventCallback;
pContext->cbEvents.pModemEventCallbackContext = pCallbackContext;
PlatformMutex_Unlock( &pContext->PktRespMutex );
}

return cellularStatus;
Expand Down
Loading