Skip to content

Commit ed6d1e1

Browse files
authored
[Cellular] Fix module logging mechanism format (#40)
* [Cellular] Fix module logging mechanism format * [Cellular] Fix missing logging mechanism format.
1 parent 07521b6 commit ed6d1e1

6 files changed

Lines changed: 72 additions & 70 deletions

File tree

modules/bg96/cellular_bg96_api.c

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1051,8 +1051,8 @@ static CellularATError_t getPdnStatusParseToken( char * pToken,
10511051
break;
10521052

10531053
default:
1054-
LogError( "Unknown token in getPdnStatusParseToken %s %d",
1055-
pToken, tokenIndex );
1054+
LogError( ( "Unknown token in getPdnStatusParseToken %s %d",
1055+
pToken, tokenIndex ) );
10561056
atCoreStatus = CELLULAR_AT_ERROR;
10571057
break;
10581058
}
@@ -1229,8 +1229,8 @@ static CellularATError_t getDataFromResp( const CellularATCommandResponse_t * pA
12291229
/* Check if the received data size is greater than the output buffer size. */
12301230
if( *pDataRecv->pDataLen > outBufSize )
12311231
{
1232-
LogError( "Data is turncated, received data length %d, out buffer size %d",
1233-
*pDataRecv->pDataLen, outBufSize );
1232+
LogError( ( "Data is turncated, received data length %d, out buffer size %d",
1233+
*pDataRecv->pDataLen, outBufSize ) );
12341234
dataLenToCopy = outBufSize;
12351235
*pDataRecv->pDataLen = outBufSize;
12361236
}
@@ -1643,11 +1643,13 @@ static CellularPktStatus_t _Cellular_RecvFuncGetPsmSettings( CellularContext_t *
16431643

16441644
while( pToken != NULL )
16451645
{
1646-
atCoreStatus = parseGetPsmToken( pToken, tokenIndex, pPsmSettings );
1647-
1648-
if( atCoreStatus != CELLULAR_AT_SUCCESS )
1646+
if( tokenIndex == 0 )
1647+
{
1648+
atCoreStatus = parseGetPsmToken( pToken, tokenIndex, pPsmSettings );
1649+
}
1650+
else
16491651
{
1650-
LogInfo( ( "parseGetPsmToken %s index %d failed", pToken, tokenIndex ) );
1652+
parseGetPsmToken( pToken, tokenIndex, pPsmSettings );
16511653
}
16521654

16531655
tokenIndex++;
@@ -1670,12 +1672,12 @@ static CellularPktStatus_t _Cellular_RecvFuncGetPsmSettings( CellularContext_t *
16701672
}
16711673
}
16721674

1673-
LogDebug( "PSM setting: mode: %d, RAU: %d, RDY_Timer: %d, TAU: %d, Active_time: %d",
1674-
pPsmSettings->mode,
1675-
pPsmSettings->periodicRauValue,
1676-
pPsmSettings->gprsReadyTimer,
1677-
pPsmSettings->periodicTauValue,
1678-
pPsmSettings->activeTimeValue );
1675+
LogDebug( ( "PSM setting: mode: %d, RAU: %d, RDY_Timer: %d, TAU: %d, Active_time: %d",
1676+
pPsmSettings->mode,
1677+
pPsmSettings->periodicRauValue,
1678+
pPsmSettings->gprsReadyTimer,
1679+
pPsmSettings->periodicTauValue,
1680+
pPsmSettings->activeTimeValue ) );
16791681
pktStatus = _Cellular_TranslateAtCoreStatus( atCoreStatus );
16801682
}
16811683

@@ -1794,14 +1796,14 @@ static CellularError_t storeAccessModeAndAddress( CellularContext_t * pContext,
17941796
}
17951797
else if( socketHandle->socketState != SOCKETSTATE_ALLOCATED )
17961798
{
1797-
LogError( "storeAccessModeAndAddress, bad socket state %d",
1798-
socketHandle->socketState );
1799+
LogError( ( "storeAccessModeAndAddress, bad socket state %d",
1800+
socketHandle->socketState ) );
17991801
cellularStatus = CELLULAR_INTERNAL_FAILURE;
18001802
}
18011803
else if( dataAccessMode != CELLULAR_ACCESSMODE_BUFFER )
18021804
{
1803-
LogError( "storeAccessModeAndAddress, Access mode not supported %d",
1804-
dataAccessMode );
1805+
LogError( ( "storeAccessModeAndAddress, Access mode not supported %d",
1806+
dataAccessMode ) );
18051807
cellularStatus = CELLULAR_UNSUPPORTED;
18061808
}
18071809
else
@@ -2921,8 +2923,8 @@ CellularError_t Cellular_GetSimCardStatus( CellularHandle_t cellularHandle,
29212923
}
29222924

29232925
cellularStatus = _Cellular_TranslatePktStatus( pktStatus );
2924-
LogDebug( "_Cellular_GetSimStatus, Sim Insert State[%d], Lock State[%d]",
2925-
pSimCardStatus->simCardState, pSimCardStatus->simCardLockState );
2926+
LogDebug( ( "_Cellular_GetSimStatus, Sim Insert State[%d], Lock State[%d]",
2927+
pSimCardStatus->simCardState, pSimCardStatus->simCardLockState ) );
29262928
}
29272929

29282930
return cellularStatus;
@@ -2999,9 +3001,9 @@ CellularError_t Cellular_GetSimCardInfo( CellularHandle_t cellularHandle,
29993001
}
30003002
else
30013003
{
3002-
LogDebug( "SimInfo updated: IMSI:%s, Hplmn:%s%s, ICCID:%s",
3003-
pSimCardInfo->imsi, pSimCardInfo->plmn.mcc, pSimCardInfo->plmn.mnc,
3004-
pSimCardInfo->iccid );
3004+
LogDebug( ( "SimInfo updated: IMSI:%s, Hplmn:%s%s, ICCID:%s",
3005+
pSimCardInfo->imsi, pSimCardInfo->plmn.mcc, pSimCardInfo->plmn.mnc,
3006+
pSimCardInfo->iccid ) );
30053007
}
30063008
}
30073009

modules/bg96/cellular_bg96_urc_handler.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static CellularPktStatus_t _parseSocketOpenNextTok( const char * pToken,
9696
if( sockStatus != 0 )
9797
{
9898
pSocketData->socketState = SOCKETSTATE_DISCONNECTED;
99-
LogError( ( ( "_parseSocketOpen: Socket open failed, conn %d, status %d", sockIndex, sockStatus ) ) );
99+
LogError( ( "_parseSocketOpen: Socket open failed, conn %d, status %d", sockIndex, sockStatus ) );
100100
}
101101
else
102102
{

modules/hl7802/cellular_hl7802_api.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,8 @@ static CellularATError_t getDataFromResp( const CellularATCommandResponse_t * pA
411411
/* Check if the received data size is greater than the output buffer size. */
412412
if( *pDataRecv->pDataLen > outBufSize )
413413
{
414-
LogError( "Data is turncated, received data length %d, out buffer size %d",
415-
*pDataRecv->pDataLen, outBufSize );
414+
LogError( ( "Data is turncated, received data length %d, out buffer size %d",
415+
*pDataRecv->pDataLen, outBufSize ) );
416416
dataLenToCopy = outBufSize;
417417
*pDataRecv->pDataLen = outBufSize;
418418
}
@@ -433,8 +433,8 @@ static CellularATError_t getDataFromResp( const CellularATCommandResponse_t * pA
433433
}
434434
else
435435
{
436-
LogError( "Receive Data: paramerter error, data pointer %p, data to copy %d",
437-
pInputLine, dataLenToCopy );
436+
LogError( ( "Receive Data: paramerter error, data pointer %p, data to copy %d",
437+
pInputLine, dataLenToCopy ) );
438438
atCoreStatus = CELLULAR_AT_BAD_PARAMETER;
439439
}
440440
}
@@ -531,8 +531,8 @@ static CellularError_t buildSocketConfig( CellularSocketHandle_t socketHandle,
531531
}
532532
else if( socketHandle->socketProtocol != CELLULAR_SOCKET_PROTOCOL_TCP )
533533
{
534-
LogError( "buildSocketConfig: socket protocol unsupported %d",
535-
socketHandle->socketProtocol );
534+
LogError( ( "buildSocketConfig: socket protocol unsupported %d",
535+
socketHandle->socketProtocol ) );
536536
cellularStatus = CELLULAR_UNSUPPORTED;
537537
}
538538
else
@@ -575,14 +575,14 @@ static CellularError_t storeAccessModeAndAddress( CellularContext_t * pContext,
575575
}
576576
else if( socketHandle->socketState != SOCKETSTATE_ALLOCATED )
577577
{
578-
LogError( "storeAccessModeAndAddress, bad socket state %d",
579-
socketHandle->socketState );
578+
LogError( ( "storeAccessModeAndAddress, bad socket state %d",
579+
socketHandle->socketState ) );
580580
cellularStatus = CELLULAR_INTERNAL_FAILURE;
581581
}
582582
else if( dataAccessMode != CELLULAR_ACCESSMODE_BUFFER )
583583
{
584-
LogError( "storeAccessModeAndAddress, Access mode not supported %d",
585-
dataAccessMode );
584+
LogError( ( "storeAccessModeAndAddress, Access mode not supported %d",
585+
dataAccessMode ) );
586586
cellularStatus = CELLULAR_UNSUPPORTED;
587587
}
588588
else
@@ -898,8 +898,8 @@ static CellularPktStatus_t _Cellular_RecvFuncGetEidrxSettings( CellularContext_t
898898
}
899899
else
900900
{
901-
LogDebug( "GetEidrx setting[%d]: RAT: %d, Value: 0x%x",
902-
count, pEidrxSettingsList->eidrxList[ count ].rat, pEidrxSettingsList->eidrxList[ count ].requestedEdrxVaue );
901+
LogDebug( ( "GetEidrx setting[%d]: RAT: %d, Value: 0x%x",
902+
count, pEidrxSettingsList->eidrxList[ count ].rat, pEidrxSettingsList->eidrxList[ count ].requestedEdrxVaue ) );
903903
}
904904

905905
pCommnadItem = pCommnadItem->pNext;
@@ -2021,8 +2021,8 @@ static CellularATError_t getPdnStatusParseToken( char * pToken,
20212021
break;
20222022

20232023
default:
2024-
LogError( "Unknown token in getPdnStatusParseToken %s %d",
2025-
pToken, tokenIndex );
2024+
LogError( ( "Unknown token in getPdnStatusParseToken %s %d",
2025+
pToken, tokenIndex ) );
20262026
atCoreStatus = CELLULAR_AT_ERROR;
20272027
break;
20282028
}

modules/hl7802/cellular_hl7802_urc_handler.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ static void _cellular_UrcProcessKtcpInd( CellularContext_t * pContext,
118118
}
119119
else if( pSocketData->pModemData != ( void * ) ( ( uint32_t ) sessionId ) )
120120
{
121-
LogError( "_cellular_UrcProcessKtcpInd : session not match %d socket index %d",
122-
( uint32_t ) pSocketData->pModemData, socketIndex );
121+
LogError( ( "_cellular_UrcProcessKtcpInd : session not match %d socket index %d",
122+
( uint32_t ) pSocketData->pModemData, socketIndex ) );
123123
}
124124
else if( pSocketData->openCallback == NULL )
125125
{
@@ -255,8 +255,8 @@ static void _cellular_UrcProcessKtcpNotif( CellularContext_t * pContext,
255255
}
256256
else if( pSocketData->pModemData != ( void * ) ( ( uint32_t ) sessionId ) )
257257
{
258-
LogError( "_cellular_UrcProcessKtcpNotif : session not match %d socket index %d",
259-
( uint32_t ) pSocketData->pModemData, socketIndex );
258+
LogError( ( "_cellular_UrcProcessKtcpNotif : session not match %d socket index %d",
259+
( uint32_t ) pSocketData->pModemData, socketIndex ) );
260260
}
261261
else
262262
{
@@ -318,8 +318,8 @@ static void _cellular_UrcProcessKtcpData( CellularContext_t * pContext,
318318
}
319319
else if( pSocketData->pModemData != ( void * ) ( ( uint32_t ) sessionId ) )
320320
{
321-
LogError( "_cellular_UrcProcessKtcpData : session not match %d socket index %d",
322-
( uint32_t ) pSocketData->pModemData, socketIndex );
321+
LogError( ( "_cellular_UrcProcessKtcpData : session not match %d socket index %d",
322+
( uint32_t ) pSocketData->pModemData, socketIndex ) );
323323
}
324324
else if( pSocketData->dataReadyCallback == NULL )
325325
{

modules/sara_r4/cellular_r4_api.c

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,8 @@ static CellularATError_t getDataFromResp( const CellularATCommandResponse_t * pA
231231
/* Check if the received data size is greater than the output buffer size. */
232232
if( *pDataRecv->pDataLen > outBufSize )
233233
{
234-
LogError( "Data is turncated, received data length %d, out buffer size %d",
235-
*pDataRecv->pDataLen, outBufSize );
234+
LogError( ( "Data is turncated, received data length %d, out buffer size %d",
235+
*pDataRecv->pDataLen, outBufSize ) );
236236
dataLenToCopy = outBufSize;
237237
*pDataRecv->pDataLen = outBufSize;
238238
}
@@ -253,8 +253,8 @@ static CellularATError_t getDataFromResp( const CellularATCommandResponse_t * pA
253253
}
254254
else
255255
{
256-
LogError( "Receive Data: paramerter error, data pointer %p, data to copy %d",
257-
pInputLine, dataLenToCopy );
256+
LogError( ( "Receive Data: paramerter error, data pointer %p, data to copy %d",
257+
pInputLine, dataLenToCopy ) );
258258
atCoreStatus = CELLULAR_AT_BAD_PARAMETER;
259259
}
260260
}
@@ -372,8 +372,8 @@ static CellularError_t buildSocketConfig( CellularSocketHandle_t socketHandle,
372372
}
373373
else if( socketHandle->socketProtocol != CELLULAR_SOCKET_PROTOCOL_TCP )
374374
{
375-
LogError( "buildSocketConfig: socket protocol unsupported %d",
376-
socketHandle->socketProtocol );
375+
LogError( ( "buildSocketConfig: socket protocol unsupported %d",
376+
socketHandle->socketProtocol ) );
377377
cellularStatus = CELLULAR_UNSUPPORTED;
378378
}
379379
else
@@ -415,14 +415,14 @@ static CellularError_t storeAccessModeAndAddress( CellularContext_t * pContext,
415415
}
416416
else if( socketHandle->socketState != SOCKETSTATE_ALLOCATED )
417417
{
418-
LogError( "storeAccessModeAndAddress, bad socket state %d",
419-
socketHandle->socketState );
418+
LogError( ( "storeAccessModeAndAddress, bad socket state %d",
419+
socketHandle->socketState ) );
420420
cellularStatus = CELLULAR_INTERNAL_FAILURE;
421421
}
422422
else if( dataAccessMode != CELLULAR_ACCESSMODE_BUFFER )
423423
{
424-
LogError( "storeAccessModeAndAddress, Access mode not supported %d",
425-
dataAccessMode );
424+
LogError( ( "storeAccessModeAndAddress, Access mode not supported %d",
425+
dataAccessMode ) );
426426
cellularStatus = CELLULAR_UNSUPPORTED;
427427
}
428428
else
@@ -982,8 +982,8 @@ CellularError_t Cellular_GetSimCardStatus( CellularHandle_t cellularHandle,
982982
pSimCardStatus->simCardState = CELLULAR_SIM_CARD_UNKNOWN;
983983
}
984984

985-
LogInfo( "Cellular_GetSimCardStatus, Sim Insert State[%d], Lock State[%d]",
986-
pSimCardStatus->simCardState, pSimCardStatus->simCardLockState );
985+
LogInfo( ( "Cellular_GetSimCardStatus, Sim Insert State[%d], Lock State[%d]",
986+
pSimCardStatus->simCardState, pSimCardStatus->simCardLockState ) );
987987
}
988988
}
989989

@@ -1044,8 +1044,8 @@ CellularError_t Cellular_DeactivatePdn( CellularHandle_t cellularHandle,
10441044
/* Print only those contexts that are present in +CGACT response */
10451045
if( pdpContextsActInfo.contextsPresent[ i ] )
10461046
{
1047-
LogDebug( "Context [%d], Act State [%d], Operator <Act> [%d]\r\n", i + 1,
1048-
pdpContextsActInfo.contextActState[ i ], serviceStatus.rat );
1047+
LogDebug( ( "Context [%d], Act State [%d], Operator <Act> [%d]\r\n", i + 1,
1048+
pdpContextsActInfo.contextActState[ i ], serviceStatus.rat ) );
10491049
}
10501050
}
10511051

@@ -1409,8 +1409,8 @@ CellularError_t Cellular_ActivatePdn( CellularHandle_t cellularHandle,
14091409
/* Print only those contexts that are present in +CGACT response */
14101410
if( pdpContextsActInfo.contextsPresent[ i ] )
14111411
{
1412-
LogDebug( "Cellular_ActivatePdn: Context [%d], Act State [%d]\r\n", i + 1,
1413-
pdpContextsActInfo.contextActState[ i ] );
1412+
LogDebug( ( "Cellular_ActivatePdn: Context [%d], Act State [%d]\r\n", i + 1,
1413+
pdpContextsActInfo.contextActState[ i ] ) );
14141414
}
14151415
}
14161416
}
@@ -2543,8 +2543,8 @@ CellularError_t Cellular_SetPdnConfig( CellularHandle_t cellularHandle,
25432543
break;
25442544

25452545
default:
2546-
LogDebug( "Cellular_SetPdnConfig: Invalid pdn context type %d",
2547-
CELLULAR_PDN_CONTEXT_IPV4V6 );
2546+
LogDebug( ( "Cellular_SetPdnConfig: Invalid pdn context type %d",
2547+
CELLULAR_PDN_CONTEXT_IPV4V6 ) );
25482548
cellularStatus = CELLULAR_BAD_PARAMETER;
25492549
break;
25502550
}
@@ -2588,8 +2588,8 @@ CellularError_t Cellular_SetPdnConfig( CellularHandle_t cellularHandle,
25882588
/* Print only those contexts that are present in +CGDCONT response */
25892589
if( pdpContextsInfo.contextsPresent[ i ] )
25902590
{
2591-
LogDebug( "Context [%d], IP Type [%s], APN Name [%s], IP Address [%s]\r\n", i + 1,
2592-
pdpContextsInfo.ipType[ i ], pdpContextsInfo.apnName, pdpContextsInfo.ipAddress );
2591+
LogDebug( ( "Context [%d], IP Type [%s], APN Name [%s], IP Address [%s]\r\n", i + 1,
2592+
pdpContextsInfo.ipType[ i ], pdpContextsInfo.apnName, pdpContextsInfo.ipAddress ) );
25932593
}
25942594
}
25952595
}

modules/sara_r4/cellular_r4_urc_handler.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,8 @@ static void _cellular_UrcProcessUusoco( CellularContext_t * pContext,
437437
}
438438
else if( pSocketData->pModemData != ( void * ) sessionId )
439439
{
440-
LogError( "_cellular_UrcProcessUusoco : session not match %d socket index %d",
441-
( uint32_t ) pSocketData->pModemData, socketIndex );
440+
LogError( ( "_cellular_UrcProcessUusoco : session not match %d socket index %d",
441+
( uint32_t ) pSocketData->pModemData, socketIndex ) );
442442
}
443443
else
444444
{
@@ -516,8 +516,8 @@ static void _cellular_UrcProcessUusord( CellularContext_t * pContext,
516516
}
517517
else if( pSocketData->pModemData != ( void * ) sessionId )
518518
{
519-
LogError( "_cellular_UrcProcessUusord : session not match %d socket index %d",
520-
( uint32_t ) pSocketData->pModemData, socketIndex );
519+
LogError( ( "_cellular_UrcProcessUusord : session not match %d socket index %d",
520+
( uint32_t ) pSocketData->pModemData, socketIndex ) );
521521
}
522522
else
523523
{
@@ -583,8 +583,8 @@ static void _cellular_UrcProcessUusocl( CellularContext_t * pContext,
583583
}
584584
else if( pSocketData->pModemData != ( void * ) sessionId )
585585
{
586-
LogError( "_cellular_UrcProcessUusocl : session not match %d socket index %d",
587-
( uint32_t ) pSocketData->pModemData, socketIndex );
586+
LogError( ( "_cellular_UrcProcessUusocl : session not match %d socket index %d",
587+
( uint32_t ) pSocketData->pModemData, socketIndex ) );
588588
}
589589
else
590590
{

0 commit comments

Comments
 (0)