![]() |
flexPTP 1.0
An IEEE 1588 PTP implementation designed for microcontrollers
|
#include "clock_utils.h"
#include <stdint.h>
#include <ctype.h>
#include <string.h>
#include "ptp_core.h"
#include <flexptp_options.h>
Go to the source code of this file.
Functions | |
void | ptp_print_clock_identity (uint64_t clockID) |
void | ptp_create_clock_identity (const uint8_t *hwa) |
uint64_t | hextoclkid (const char *str) |
uint64_t hextoclkid | ( | const char * | str | ) |
Convert a string containing only hexadecimal digits to a 64-bit LE clock ID representation.
str | string repesentation of the clock ID |
Definition at line 40 of file clock_utils.c.
void ptp_create_clock_identity | ( | const uint8_t * | hwa | ) |
Generate clock ID based on the MAC address. It works the following way: the first 3 bytes come from the first three bytes of the MAC address, then a string of 0xFF-0xFE is appended, finally the second three bytes of the MAC-address is inserted.
hwa | hardware address of the network interface |
Definition at line 25 of file clock_utils.c.
void ptp_print_clock_identity | ( | uint64_t | clockID | ) |
Print PTP hardware clock identity.
clockID | clock ID in 64-bit LE representation |
Definition at line 16 of file clock_utils.c.