daniel-p-carvalho commented on code in PR #3779:
URL: https://github.com/apache/nuttx-apps/pull/3779#discussion_r3995890866
##########
netutils/ptpd/ptpd.c:
##########
@@ -1468,8 +1475,20 @@ static int ptp_process_rx_packet(FAR struct ptp_state_s
*state,
return OK;
}
+ ptpinfo("RX PTP: type=0x%02x (masked: 0x%02x), ver=0x%02x, domain=%d, "
+ "seq=%ld, len=%d\n",
+ state->rxbuf.header.messagetype,
+ state->rxbuf.header.messagetype & PTP_MSGTYPE_MASK,
+ state->rxbuf.header.version,
+ state->rxbuf.header.domain,
+ (long)ptp_get_sequence(&state->rxbuf.header),
+ (int)length);
Review Comment:
Removed the (int) cast on length (now printed with %zd matching ssize_t) and
the (long) cast on ptp_get_sequence() (now %d matching its uint16_t return,
promoted). Pushed in 55dd81f83.
##########
netutils/ptpd/ptpd.c:
##########
@@ -1479,35 +1498,37 @@ static int ptp_process_rx_packet(FAR struct ptp_state_s
*state,
switch (state->rxbuf.header.messagetype & PTP_MSGTYPE_MASK)
{
- case PTP_MSGTYPE_ANNOUNCE:
- ptpinfo("Got announce packet, seq %ld\n",
- (long)ptp_get_sequence(&state->rxbuf.header));
- return ptp_process_announce(state, &state->rxbuf.announce);
-
- case PTP_MSGTYPE_SYNC:
- ptpinfo("Got sync packet, seq %ld\n",
- (long)ptp_get_sequence(&state->rxbuf.header));
- return ptp_process_sync(state, &state->rxbuf.sync);
-
- case PTP_MSGTYPE_FOLLOW_UP:
- ptpinfo("Got follow-up packet, seq %ld\n",
- (long)ptp_get_sequence(&state->rxbuf.header));
- return ptp_process_followup(state, &state->rxbuf.follow_up);
-
- case PTP_MSGTYPE_DELAY_RESP:
- ptpinfo("Got delay-resp, seq %ld\n",
- (long)ptp_get_sequence(&state->rxbuf.header));
- return ptp_process_delay_resp(state, &state->rxbuf.delay_resp);
-
- case PTP_MSGTYPE_DELAY_REQ:
- ptpinfo("Got delay req, seq %ld\n",
- (long)ptp_get_sequence(&state->rxbuf.header));
- return ptp_process_delay_req(state, &state->rxbuf.delay_req);
-
- default:
- ptpinfo("Ignoring unknown PTP packet type: 0x%02x\n",
- state->rxbuf.header.messagetype);
- return OK;
+ case PTP_MSGTYPE_ANNOUNCE:
+ ptpinfo("Got announce packet, seq %ld\n",
+ (long)ptp_get_sequence(&state->rxbuf.header));
+ return ptp_process_announce(state, &state->rxbuf.announce);
+
+ case PTP_MSGTYPE_SYNC:
+ ptpinfo("Got sync packet, seq %ld\n",
+ (long)ptp_get_sequence(&state->rxbuf.header));
+ return ptp_process_sync(state, &state->rxbuf.sync);
+
+ case PTP_MSGTYPE_FOLLOW_UP:
+ ptpinfo("Got follow-up packet, seq %ld\n",
+ (long)ptp_get_sequence(&state->rxbuf.header));
+ return ptp_process_followup(state, &state->rxbuf.follow_up);
+
+ case PTP_MSGTYPE_DELAY_RESP:
+ ptpinfo("Got delay-resp, seq %ld\n",
+ (long)ptp_get_sequence(&state->rxbuf.header));
+ return ptp_process_delay_resp(state, &state->rxbuf.delay_resp);
+
+ case PTP_MSGTYPE_DELAY_REQ:
+ ptpinfo("Got delay req, seq %ld\n",
+ (long)ptp_get_sequence(&state->rxbuf.header));
Review Comment:
Removed all (long) casts on ptp_get_sequence() in this switch, format
changed to %d to match its uint16_t return type after promotion. Pushed in
55dd81f83.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]