Skip to content

Commit

Permalink
Fix too many arguments log (#67)
Browse files Browse the repository at this point in the history
 Separate the log with more than 6 arguments into multiple lines.
  • Loading branch information
chinglee-iot authored Dec 1, 2021
1 parent 33156eb commit 206ef74
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
30 changes: 20 additions & 10 deletions source/cellular_3gpp_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,10 +485,14 @@ static CellularPktStatus_t _parseTimeZoneInfo( char * pTimeZoneResp,

if( pktStatus == CELLULAR_PKT_STATUS_OK )
{
LogDebug( ( "\n TimeZoneInfo: Timezone %d Year %d Month %d day %d Hour %d Minute %d Second %d ",
pTimeInfo->timeZone, pTimeInfo->year,
pTimeInfo->month, pTimeInfo->day,
pTimeInfo->hour, pTimeInfo->minute,
LogDebug( ( "TimeZoneInfo: Timezone %d Year %d Month %d day %d,", pTimeInfo->timeZone,
pTimeInfo->year,
pTimeInfo->month,
pTimeInfo->day ) );

LogDebug( ( "Hour %d Minute %d Second %d",
pTimeInfo->hour,
pTimeInfo->minute,
pTimeInfo->second ) );
}

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

LogDebug( ( "SrvStatus: rat %d cs %d, ps %d, mode %d, csRejType %d, csRej %d, psRejType %d, psRej %d, plmn %s%s",
LogDebug( ( "SrvStatus: rat %d cs %d, ps %d, mode %d, csRejType %d,",
pServiceStatus->rat,
pServiceStatus->csRegistrationStatus, pServiceStatus->psRegistrationStatus,
pServiceStatus->csRegistrationStatus,
pServiceStatus->psRegistrationStatus,
pServiceStatus->networkRegistrationMode,
pServiceStatus->csRejectionType, pServiceStatus->csRejectionCause,
pServiceStatus->psRejectionType, pServiceStatus->psRejectionCause,
pServiceStatus->plmnInfo.mcc, pServiceStatus->plmnInfo.mnc ) );
pServiceStatus->csRejectionType ) );

LogDebug( ( "csRej %d, psRejType %d, psRej %d, plmn %s%s",
pServiceStatus->csRejectionCause,
pServiceStatus->psRejectionType,
pServiceStatus->psRejectionCause,
pServiceStatus->plmnInfo.mcc,
pServiceStatus->plmnInfo.mnc ) );
}

return cellularStatus;
Expand Down Expand Up @@ -2711,7 +2721,7 @@ static uint32_t appendBinaryPattern( char * cmdBuf,
* The max length of the string is fixed and checked offline. */
/* coverity[misra_c_2012_rule_21_6_violation]. */
( void ) snprintf( cmdBuf, cmdLen, "\"" PRINTF_BINARY_PATTERN_INT8 "\"%c",
( uint32_t ) PRINTF_BYTE_TO_BINARY_INT8( value ), endOfString ? '\0' : ',' );
PRINTF_BYTE_TO_BINARY_INT8( value ), endOfString ? '\0' : ',' );
}
else
{
Expand Down
4 changes: 3 additions & 1 deletion source/cellular_pkthandler.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@

/*-----------------------------------------------------------*/

#define MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
#ifndef MIN
#define MIN( a, b ) ( ( ( a ) < ( b ) ) ? ( a ) : ( b ) )
#endif

/* Windows simulator implementation. */
#if defined( _WIN32 ) || defined( _WIN64 )
Expand Down

0 comments on commit 206ef74

Please sign in to comment.