RtndAdjustClockTime

RtndAdjustClockTime adjusts the time of a NIC clock by applying an offset to the current counter value.

Syntax

Copy
BOOL RtndAdjustClockTime(
    [in]    ULONG_PTR RtndInterfaceId, 
    [in]    ULONG LocalClockIndex, 
    [in]    const RTND_TIMESTAMP *pTimeOffset
);

Parameters

[in] RtndInterfaceId

The number or pointer used to identify the interface. This value is returned by RtndManageInterface.

[in] LocalClockIndex

The index of the local clock to access.

[in] pTimeOffset

The offset to apply (positive or negative).

Return Value

If the function succeeds, it returns TRUE. If the function fails, it returns FALSE. To get extended error information, call GetLastError.

Common error codes:

Error code Meaning

ERROR_IO_DEVICE

An unexpected error occurred while trying to access the device.

Note: Custom drivers may return other error codes not listed above.

Remarks

The NL2 always calls this function from the main thread of the NL2 process.

If the hardware supports the fine time adjustment method, the driver must use it when the passed offset is within the range specified by RTND_FEATURE_CLOCK.ClockTimeFineOffsetMax and RTND_FEATURE_CLOCK.ClockTimeFineOffsetMin.

The driver must not modify the passed offset so that the resulting time stays within the range of clock counter values. It must use the offset as is and let the hardware clock counter wrap around if needed (in case of overflow or underflow).

Characteristics

Real-time requirements

Deterministic behavior

Not required

Shutdown-safe behavior

Required

Local memory allocation/deallocation restrictions

Process

External MSpace

Internal MSpace

System

Not allowed

Not allowed

RTSS process

Not allowed

Not allowed

Windows contiguous memory allocation/deallocation restrictions

Contiguous memory

Not allowed

Requirements

Minimum supported version Header

wRTOS 1.0 SDK

Rtnd.h

See Also: