Skip to content

Commit 206ef74

Browse files
authored
Fix too many arguments log (#67)
Separate the log with more than 6 arguments into multiple lines.
1 parent 33156eb commit 206ef74

File tree

2 files changed

+23
-11
lines changed

2 files changed

+23
-11
lines changed

source/cellular_3gpp_api.c

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -485,10 +485,14 @@ static CellularPktStatus_t _parseTimeZoneInfo( char * pTimeZoneResp,
485485

486486
if( pktStatus == CELLULAR_PKT_STATUS_OK )
487487
{
488-
LogDebug( ( "\n TimeZoneInfo: Timezone %d Year %d Month %d day %d Hour %d Minute %d Second %d ",
489-
pTimeInfo->timeZone, pTimeInfo->year,
490-
pTimeInfo->month, pTimeInfo->day,
491-
pTimeInfo->hour, pTimeInfo->minute,
488+
LogDebug( ( "TimeZoneInfo: Timezone %d Year %d Month %d day %d,", pTimeInfo->timeZone,
489+
pTimeInfo->year,
490+
pTimeInfo->month,
491+
pTimeInfo->day ) );
492+
493+
LogDebug( ( "Hour %d Minute %d Second %d",
494+
pTimeInfo->hour,
495+
pTimeInfo->minute,
492496
pTimeInfo->second ) );
493497
}
494498

@@ -1792,13 +1796,19 @@ CellularError_t Cellular_CommonGetServiceStatus( CellularHandle_t cellularHandle
17921796
( void ) strncpy( pServiceStatus->operatorName, operatorInfo.operatorName, CELLULAR_NETWORK_NAME_MAX_SIZE );
17931797
pServiceStatus->operatorNameFormat = operatorInfo.operatorNameFormat;
17941798

1795-
LogDebug( ( "SrvStatus: rat %d cs %d, ps %d, mode %d, csRejType %d, csRej %d, psRejType %d, psRej %d, plmn %s%s",
1799+
LogDebug( ( "SrvStatus: rat %d cs %d, ps %d, mode %d, csRejType %d,",
17961800
pServiceStatus->rat,
1797-
pServiceStatus->csRegistrationStatus, pServiceStatus->psRegistrationStatus,
1801+
pServiceStatus->csRegistrationStatus,
1802+
pServiceStatus->psRegistrationStatus,
17981803
pServiceStatus->networkRegistrationMode,
1799-
pServiceStatus->csRejectionType, pServiceStatus->csRejectionCause,
1800-
pServiceStatus->psRejectionType, pServiceStatus->psRejectionCause,
1801-
pServiceStatus->plmnInfo.mcc, pServiceStatus->plmnInfo.mnc ) );
1804+
pServiceStatus->csRejectionType ) );
1805+
1806+
LogDebug( ( "csRej %d, psRejType %d, psRej %d, plmn %s%s",
1807+
pServiceStatus->csRejectionCause,
1808+
pServiceStatus->psRejectionType,
1809+
pServiceStatus->psRejectionCause,
1810+
pServiceStatus->plmnInfo.mcc,
1811+
pServiceStatus->plmnInfo.mnc ) );
18021812
}
18031813

18041814
return cellularStatus;
@@ -2711,7 +2721,7 @@ static uint32_t appendBinaryPattern( char * cmdBuf,
27112721
* The max length of the string is fixed and checked offline. */
27122722
/* coverity[misra_c_2012_rule_21_6_violation]. */
27132723
( void ) snprintf( cmdBuf, cmdLen, "\"" PRINTF_BINARY_PATTERN_INT8 "\"%c",
2714-
( uint32_t ) PRINTF_BYTE_TO_BINARY_INT8( value ), endOfString ? '\0' : ',' );
2724+
PRINTF_BYTE_TO_BINARY_INT8( value ), endOfString ? '\0' : ',' );
27152725
}
27162726
else
27172727
{

source/cellular_pkthandler.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646

4747
/*-----------------------------------------------------------*/
4848

49-
#define MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
49+
#ifndef MIN
50+
#define MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
51+
#endif
5052

5153
/* Windows simulator implementation. */
5254
#if defined( _WIN32 ) || defined( _WIN64 )

0 commit comments

Comments
 (0)