"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tools/i2ctransfer.c" between
i2c-tools-4.2.tar.gz and i2c-tools-4.3.tar.gz

About: i2c-tools are an heterogeneous set of I2C tools for Linux (originally part of the lm-sensors package).

i2ctransfer.c  (i2c-tools-4.2):i2ctransfer.c  (i2c-tools-4.3)
skipping to change at line 91 skipping to change at line 91
{ {
FILE *output = flags & PRINT_STDERR ? stderr : stdout; FILE *output = flags & PRINT_STDERR ? stderr : stdout;
unsigned i; unsigned i;
__u16 j; __u16 j;
for (i = 0; i < nmsgs; i++) { for (i = 0; i < nmsgs; i++) {
int read = msgs[i].flags & I2C_M_RD; int read = msgs[i].flags & I2C_M_RD;
int recv_len = msgs[i].flags & I2C_M_RECV_LEN; int recv_len = msgs[i].flags & I2C_M_RECV_LEN;
int print_buf = (read && (flags & PRINT_READ_BUF)) || int print_buf = (read && (flags & PRINT_READ_BUF)) ||
(!read && (flags & PRINT_WRITE_BUF)); (!read && (flags & PRINT_WRITE_BUF));
__u16 len = msgs[i].len; __u16 len = recv_len ? msgs[i].buf[0] + 1 : msgs[i].len;
if (recv_len && print_buf && len != msgs[i].buf[0] + 1) {
fprintf(stderr, "Correcting wrong msg length after recv_l
en! Please fix the I2C driver and/or report.\n");
len = msgs[i].buf[0] + 1;
}
if (flags & PRINT_HEADER) { if (flags & PRINT_HEADER) {
fprintf(output, "msg %u: addr 0x%02x, %s, len ", fprintf(output, "msg %u: addr 0x%02x, %s, len ",
i, msgs[i].addr, read ? "read" : "write"); i, msgs[i].addr, read ? "read" : "write");
if (!recv_len || flags & PRINT_READ_BUF) if (!recv_len || flags & PRINT_READ_BUF)
fprintf(output, "%u", len); fprintf(output, "%u", len);
else else
fprintf(output, "TBD"); fprintf(output, "TBD");
} }
 End of changes. 1 change blocks. 
7 lines changed or deleted 1 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)