Merge pull request #122 from olerem/test

testj1939: split output string in to 8 byte strings
pull/129/head
Marc Kleine-Budde 2019-01-14 10:03:42 +01:00 committed by GitHub
commit e0277cc960
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 1 deletions

View File

@ -259,12 +259,19 @@ int main(int argc, char *argv[])
error(1, errno, "sendto");
}
if (todo_recv) {
int i = 0;
if (todo_names && peername.can_addr.j1939.name)
printf("%016llx ", peername.can_addr.j1939.name);
printf("%02x %05x:", peername.can_addr.j1939.addr,
peername.can_addr.j1939.pgn);
for (j = 0; j < ret; ++j)
for (j = 0; j < ret; ++j, i++) {
if (i == 8) {
printf("\n%05x ", j);
i = 0;
}
printf(" %02x", dat[j]);
}
printf("\n");
}
}