9#include <flexptp_options.h>
12#define S (gPtpCoreState)
17 uint8_t *p = (uint8_t*) &clockID;
19 for (i = 0; i < 8; i++) {
20 MSG(
"%02x", p[7 - i]);
26 uint8_t *p = (uint8_t*) &S.hwoptions.clockIdentity;
31 memcpy(&p[5], &hwa[3], 3);
34 MSG(
"Own clock ID: ");
41 size_t len = strlen(str);
43 for (
size_t i = 0; i < len; i++) {
44 char digit = tolower(str[i]);
45 if (digit >=
'0' && digit <=
'9') {
47 }
else if (digit >=
'a' && digit <=
'f') {
48 digit = digit -
'a' + 10;
53 clkid += (uint64_t) digit * ((uint64_t) 1 << (4 * i));
56 for (
size_t i = 0; i < 8; i++) {
57 p = ((uint8_t*) &clkid) + i;
58 *p = ((*p & 0x0F) << 4) | ((*p & 0xF0) >> 4);
void ptp_create_clock_identity(const uint8_t *hwa)
void ptp_print_clock_identity(uint64_t clockID)
uint64_t hextoclkid(const char *str)
This module defines clock identity related operations.
Core of the PTP implementation. Defines functions for message processing, clock tuning,...