1.3.3.1.25 MAC_COMMON_GetSecondsCounter Function

C

uint32_t MAC_COMMON_GetSecondsCounter
(
    void
);

Summary

The MAC_COMMON_GetSecondsCounter primitive gets the value of a counter that is incremented every second.

Description

A seconds counter is provided in order to be able to set timeouts and perform delays. This function returns the current value of such counter.

Precondition

None.

Parameters

None.

Returns

Value of seconds counter.

Example

previousCounter = MAC_COMMON_GetSecondsCounter();

// Perform other actions
// ...

newCounter = MAC_COMMON_GetSecondsCounter();

if ((newCounter - previousCounter) > TIMEOUT_SECONDS)
{
    // Timeout elapsed
}

Remarks

None.