Timer T3324 in FreeRTOS Cellular Interface Library

static CellularATError_t parseT3324TimerValue( char * pToken,
uint32_t * pTimerValueSeconds )
{
int32_t tempValue = 0;
uint32_t tokenValue = 0;
uint32_t timerUnitIndex = 0;
uint32_t timerValue = 0;
CellularATError_t atCoreStatus = Cellular_ATStrtoi( pToken, 2, &tempValue );

if( atCoreStatus == CELLULAR_AT_SUCCESS )
{
    if( tempValue < 0 )
    {
        LogError( ( "Error in processing Periodic Processing Active time value. Token %s", pToken ) );
        atCoreStatus = CELLULAR_AT_ERROR;
    }
    else
    {
        tokenValue = ( uint32_t ) tempValue;
    }
}

if( atCoreStatus == CELLULAR_AT_SUCCESS )
{
    timerUnitIndex = T3324_TIMER_UNIT( tokenValue );
    timerValue = T3324_TIMER_VALUE( tokenValue );

    /* Parse the time unit. */
    switch( timerUnitIndex )
    {
        case T3324_TIMER_UNIT_2SECONDS:
            *pTimerValueSeconds = timerValue * 2u;
            break;

        case T3324_TIMER_UNIT_1MINUTE:
            *pTimerValueSeconds = timerValue * 60U;
            break;

        case T3324_TIMER_UNIT_DECIHOURS:
            *pTimerValueSeconds = timerValue * ( 15U * 60U );
            break;

        case T3324_TIMER_UNIT_DEACTIVATED:
            *pTimerValueSeconds = T3324_TIMER_DEACTIVATED;
            break;

        default:
            LogError( ( "Invalid T3324 timer unit index" ) );
            atCoreStatus = CELLULAR_AT_ERROR;
            break;
    }
}

return atCoreStatus;

}

when case T3324_TIMER_UNIT_DECIHOURS, why timervalue = x * ( 15U * 60U ) ?

Hi @Qianfeng.Tang,
Thanks for reporting this back to us.

After checking on AT+CPSMS command, Timer T3324 has 2s/1min/6min scope. That should be changed to 6 minutes instead of 15 minutes. I’ll create a PR to fix that soon.

1 Like

Hi @Qianfeng.Tang,
PR#157 has been merged to fix this.

Thanks again for reporting this to us!