INtime SDK Help
hpe1588GetRxTimestamp
INtime SDK v7.1 > About INtime > Networking and I/O > High-Performance Ethernet > hpe1588GetRxTimestamp

Retrieve the receive timestamp from the packet buffer.

HPESTATUS hpe1588GetRxTimestamp(
    HPEHANDLE devhandle, 
    void *pktbuf, 
    HPE_1588_TIMESTAMP *rxts
);

Parameters

devhandle
A handle value for the device.
pktbuf
A pointer to the raw packet buffer.
rxts
A pointer to an HPE_1588_TIMESTAMP structure to receive the timestamp.

Example usage

How to prepare a queue and handle receive timestamps:

// Assume that queue 1 will generate receive timestamps for each frame
// Prepare the queue:
hpeSetReceiveQueueAttribs(hpe, 1, HPE_RX_TIMESTAMP);
:
// The timestmap data will be inserted ahead of the receive data. 
// Find the offset to the packet data:
DWORD timestamp_extra;  // number of bytes prepended to receive data for timestamp
hpe1588GetRxTimestampHeaderSize(hpe, &timestamp_extra);
:
// receive a buffer
HPERXBUFFERSET *rxs = NULL;
HPE_1588_TIMESTAMP ts;
BYTE *frame;
hpeWaitForReceiveQueueComplete(hpe, 1, INFINITE);
hpeGetReceiveQueueBuffer(hpe, 1, &rxbuf);
// read timestamp into ts structure
hpe1588GetRxTimestamp(hpe, rxbuf->ptr, &ts);
// now point to frame data for processing
frame = rxbuf->ptr + timestamp_extra;

Return Values

A status value indicating the success or failure of the operation:

E_OK The operation completed successfully.
E_EXIST The handle given is not a handle for an open HPE interface.
E_SUPPORT IEEE1588 functionality is not supported by the hardware interface.

Requirements

Versions Defined in Include Link to
INtime 6.0 (HPE3) intime/rt/include/hpeif2.h hpeif2.h hpeif2.lib
See Also