1.3.3.1.23 MAC_COMMON_GetMsCounter Function

C

uint32_t MAC_COMMON_GetMsCounter
(
    void
);

Summary

The MAC_COMMON_GetMsCounter primitive gets the value of a counter that is incremented every millisecond.

Description

This primitive makes use of SYS_TIME service to get the value of the millisecond counter in order to be able to set timeouts and perform delays. This function returns the current value of such counter.

Precondition

SYS_TIME_Initialize primitive has to be called before.

Parameters

None.

Returns

Value of milliseconds counter.

Example

previousCounter = MAC_COMMON_GetMsCounter();

// Perform other actions
// ...

newCounter = MAC_COMMON_GetMsCounter();

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

Remarks

None.