Commit 3f32e494 authored by Aurelio Colosimo's avatar Aurelio Colosimo

fsm.c: print human-readable msg name for recv packets

Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent da6489a0
...@@ -75,10 +75,10 @@ int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen) ...@@ -75,10 +75,10 @@ int pp_state_machine(struct pp_instance *ppi, uint8_t *packet, int plen)
if (plen) if (plen)
pp_diag(ppi, frames, 1, pp_diag(ppi, frames, 1,
"RECV %02d bytes at %d.%09d (type %x)\n", plen, "RECV %02d bytes at %d.%09d (type %x, %s)\n", plen,
(int)ppi->last_rcv_time.seconds, (int)ppi->last_rcv_time.seconds,
(int)ppi->last_rcv_time.nanoseconds, (int)ppi->last_rcv_time.nanoseconds,
packet[0] & 0xf); packet[0] & 0xf, pp_msg_names[packet[0] & 0xf]);
/* /*
* Since all ptp frames have the same header, parse it now. * Since all ptp frames have the same header, parse it now.
......
...@@ -326,7 +326,7 @@ void msg_unpack_delay_resp(void *buf, MsgDelayResp *resp) ...@@ -326,7 +326,7 @@ void msg_unpack_delay_resp(void *buf, MsgDelayResp *resp)
htons(*(UInteger16 *) (buf + 52)); htons(*(UInteger16 *) (buf + 52));
} }
const char const *pp_msg_names[] = { const char const *pp_msg_names[16] = {
[PPM_SYNC] = "sync", [PPM_SYNC] = "sync",
[PPM_DELAY_REQ] = "delay_req", [PPM_DELAY_REQ] = "delay_req",
[PPM_PDELAY_REQ] = "pdelay_req", [PPM_PDELAY_REQ] = "pdelay_req",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment