This commit is contained in:
XANTRONIX 2019-02-01 16:45:07 -06:00
parent f4e11dd5d2
commit 5027975bf8

View file

@ -144,10 +144,16 @@ static ssize_t handle_block_packet(hexagram_pcapng_stream *stream,
data->last_time = (useconds_t)header.timestamp[1]; data->last_time = (useconds_t)header.timestamp[1];
((struct can_frame *)body)->can_id = be32toh(((struct can_frame *)body)->can_id);
printf("Read packet %"PRIu32" bytes time hi %"PRIu32" lo %"PRIu32" id %8"PRIx32" payload %d\n",
header.caplen, header.timestamp[0], header.timestamp[1],
((struct can_frame *)&body)->can_id,
((struct can_frame *)&body)->can_dlc);
printf("Read packet %"PRIu32" bytes time hi %"PRIu32" lo %"PRIu32"\n", if (write(data->sock, (struct can_frame *)body, sizeof(struct can_frame)) < 0) {
header.caplen, header.timestamp[0], header.timestamp[1]); goto error_io;
}
if (header.caplen % sizeof(uint32_t)) { if (header.caplen % sizeof(uint32_t)) {
size_t padding = sizeof(uint32_t) - (header.caplen % sizeof(uint32_t)); size_t padding = sizeof(uint32_t) - (header.caplen % sizeof(uint32_t));