![]() |
flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
|
This module defines functions that deal with actual PTP messages; they can extract or insert headers, timestamps or any data of other kind. More...
Go to the source code of this file.
Functions | |
void | ptp_load_flags (PtpFlags *pFlags, uint16_t bitfield) |
uint16_t | ptp_write_flags (const PtpFlags *pFlags) |
void | ptp_extract_header (PtpHeader *pHeader, const void *pPayload) |
void | ptp_construct_binary_header (void *pData, const PtpHeader *pHeader) |
void | ptp_extract_announce_message (PtpAnnounceBody *pAnnounce, void *pPayload) |
void | ptp_construct_binary_announce_message (void *pData, const PtpAnnounceBody *pAnnounce) |
void | ptp_write_binary_timestamps (void *pPayload, const TimestampI *ts, uint8_t n) |
void | ptp_extract_timestamps (TimestampI *ts, void *pPayload, uint8_t n) |
void | ptp_read_delay_resp_id_data (PtpDelay_RespIdentification *pDRData, void *pPayload) |
void | ptp_write_delay_resp_id_data (void *pPayload, const PtpDelay_RespIdentification *pDRData) |
void | ptp_clear_flags (PtpFlags *pFlags) |
This module defines functions that deal with actual PTP messages; they can extract or insert headers, timestamps or any data of other kind.
Definition in file msg_utils.h.
void ptp_clear_flags | ( | PtpFlags * | pFlags | ) |
Clear PTPFlags object.
pFlags | pointer to an existing PTPFlags object |
Definition at line 232 of file msg_utils.c.
void ptp_construct_binary_announce_message | ( | void * | pData, |
const PtpAnnounceBody * | pAnnounce | ||
) |
Construct PTP Announce message body from its contents.
pAnnounce | Pointer to an existing, filled PtpAnnounceBody object. |
pData | Pointer to the binary storage area. |
Definition at line 143 of file msg_utils.c.
void ptp_construct_binary_header | ( | void * | pData, |
const PtpHeader * | pHeader | ||
) |
Render PtpHeader object to binary (raw) form.
pData | pointer to the beginning of the binary destination |
pHeader | pointer to a filled-out PtpHeader object |
Definition at line 90 of file msg_utils.c.
void ptp_extract_announce_message | ( | PtpAnnounceBody * | pAnnounce, |
void * | pPayload | ||
) |
Extract PTP Announce message body from the rendered payload.
pAnnounce | Pointer to an existing PtpAnnounceBody object, where the contents of the Announce message of interest will be copied to. |
pPayload | Pointer to the beginning of the whole PTP message's payload. |
Definition at line 122 of file msg_utils.c.
void ptp_extract_header | ( | PtpHeader * | pHeader, |
const void * | pPayload | ||
) |
Extract the PTP message header from the whole messages payload.
pHeader | Pointer to an existing PtpHeader object, where the fetched header will get stored to. |
pPayload | Pointer to the beginning of the whole PTP message's payload. |
Definition at line 55 of file msg_utils.c.
void ptp_extract_timestamps | ( | TimestampI * | ts, |
void * | pPayload, | ||
uint8_t | n | ||
) |
Fetch n pieces of timestamps from a PTP message.
ts | Pointer to an array of timestamps that can support at least n elements. |
pPayload | pointer to the BEGINNING of the binary PTP packet |
n | number of timestamps to fetch. |
Definition at line 189 of file msg_utils.c.
void ptp_load_flags | ( | PtpFlags * | pFlags, |
uint16_t | bitfield | ||
) |
Extract PTP flags from the rendered bitfield found in particular PTP messages.
pFlags | Pointer to an existing PTPFlags object. It is the destination where the separated bits are getting stored to. |
bitfield | The direct copy of the PTP flags field from the PTP message of interest. |
Definition at line 12 of file msg_utils.c.
void ptp_read_delay_resp_id_data | ( | PtpDelay_RespIdentification * | pDRData, |
void * | pPayload | ||
) |
Read (P)Delay_Response identification data from a raw PTP message.
pDRData | pointer to an existing Delay_RespIdentification object |
pPayload | pointer to the BEGINNING of a (P)Delay_Response PTP message |
Definition at line 214 of file msg_utils.c.
void ptp_write_binary_timestamps | ( | void * | pPayload, |
const TimestampI * | ts, | ||
uint8_t | n | ||
) |
Place n pieces of timestamps following the PTP header in the binary packet.
pPayload | pointer to the BEGINNING of the binary PTP packet |
ts | pointer to an array of timestamps |
n | length of the array |
Definition at line 166 of file msg_utils.c.
void ptp_write_delay_resp_id_data | ( | void * | pPayload, |
const PtpDelay_RespIdentification * | pDRData | ||
) |
Write (P)Delay_Response identification data from a raw PTP message.
pPayload | pointer to the BEGINNING of a (P)Delay_Response PTP message |
pDRData | pointer to an existing, filled-out Delay_RespIdentification object |
Definition at line 224 of file msg_utils.c.
uint16_t ptp_write_flags | ( | const PtpFlags * | pFlags | ) |
Render PTPFlags into binary form.
pFlags | pointer to a filled-out PTPFlags object |
Definition at line 32 of file msg_utils.c.