ptp.c
void ptp_create_clock_identity()
{
    uint8_t *p = (uint8_t*) &sClockIdentity;
    // construct clockIdentity
    memcpy(p, netif_default->hwaddr, 3); // first 3 octets of MAC address
    p[3] = 0xff;
    p[4] = 0xfe;
    memcpy(&p[5], &netif_default->hwaddr[3], 3); // last 3 octets of MAC address

    // display ID
    ptp_print_clock_identity(sClockIdentity);
}
// create clock identity based on MAC address
create clock identity based on MAC address
create clock identity based on MAC address
void ptp_create_clock_identity()
{
    uint8_t *p = (uint8_t*) &sClockIdentity;
    memcpy(p, netif_default->hwaddr, 3); 
    p[3] = 0xff;
    p[4] = 0xfe;
    memcpy(&p[5], &netif_default->hwaddr[3], 3); 
    ptp_print_clock_identity(sClockIdentity);
}
void ptp_create_clock_identity ( ) { uint8_t * p = ( uint8_t * ) & sClockIdentity ; memcpy ( p , netif_default -> hwaddr , 3 ) ; p [ 3 ] = 0xff ; p [ 4 ] = 0xfe ; memcpy ( & p [ 5 ] , & netif_default -> hwaddr [ 3 ] , 3 ) ; ptp_print_clock_identity ( sClockIdentity ) ; }
create clock identity based on MAC address
create clock identity based on MAC address
// construct clockIdentity // first 3 octets of MAC address // last 3 octets of MAC address // display ID