Changeset 5241
- Timestamp:
- 05/05/08 16:55:01 (2 months ago)
- Files:
-
- i2c-tools/trunk/tools/i2cbusses.h (modified) (1 diff)
- i2c-tools/trunk/tools/i2cdump.c (modified) (5 diffs)
- i2c-tools/trunk/tools/i2cget.c (modified) (3 diffs)
- i2c-tools/trunk/tools/i2cset.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
i2c-tools/trunk/tools/i2cbusses.h
r5204 r5241 38 38 int set_slave_addr(int file, int address, int force); 39 39 40 #define MISSING_FUNC_FMT "Error: Adapter does not have %s capability\n" 41 40 42 #endif i2c-tools/trunk/tools/i2cdump.c
r5240 r5241 61 61 case I2C_SMBUS_BYTE: 62 62 if (!((funcs & I2C_FUNC_SMBUS_BYTE) == I2C_FUNC_SMBUS_BYTE)) { 63 fprintf(stderr, "Error: Adapter does " 64 "not have byte capability\n"); 63 fprintf(stderr, MISSING_FUNC_FMT, "byte"); 65 64 return -1; 66 65 } … … 69 68 case I2C_SMBUS_BYTE_DATA: 70 69 if (!(funcs & I2C_FUNC_SMBUS_READ_BYTE_DATA)) { 71 fprintf(stderr, "Error: Adapter does " 72 "not have byte read capability\n"); 70 fprintf(stderr, MISSING_FUNC_FMT, "byte read"); 73 71 return -1; 74 72 } … … 77 75 case I2C_SMBUS_WORD_DATA: 78 76 if (!(funcs & I2C_FUNC_SMBUS_READ_WORD_DATA)) { 79 fprintf(stderr, "Error: Adapter does " 80 "not have word read capability\n"); 77 fprintf(stderr, MISSING_FUNC_FMT, "word read"); 81 78 return -1; 82 79 } … … 85 82 case I2C_SMBUS_BLOCK_DATA: 86 83 if (!(funcs & I2C_FUNC_SMBUS_READ_BLOCK_DATA)) { 87 fprintf(stderr, "Error: Adapter does " 88 "not have smbus block read capability\n"); 84 fprintf(stderr, MISSING_FUNC_FMT, "smbus block read"); 89 85 return -1; 90 86 } … … 93 89 case I2C_SMBUS_I2C_BLOCK_DATA: 94 90 if (!(funcs & I2C_FUNC_SMBUS_READ_I2C_BLOCK)) { 95 fprintf(stderr, "Error: Adapter does " 96 "not have i2c block read capability\n"); 91 fprintf(stderr, MISSING_FUNC_FMT, "i2c block read"); 97 92 return -1; 98 93 } i2c-tools/trunk/tools/i2cget.c
r5240 r5241 64 64 case I2C_SMBUS_BYTE: 65 65 if (!(funcs & I2C_FUNC_SMBUS_READ_BYTE)) { 66 fprintf(stderr, "Error: Adapter does " 67 "not have read byte capability\n"); 66 fprintf(stderr, MISSING_FUNC_FMT, "read byte"); 68 67 return -1; 69 68 } 70 69 if (daddress >= 0 71 70 && !(funcs & I2C_FUNC_SMBUS_WRITE_BYTE)) { 72 fprintf(stderr, "Error: Adapter does " 73 "not have write byte capability\n"); 71 fprintf(stderr, MISSING_FUNC_FMT, "write byte"); 74 72 return -1; 75 73 } … … 78 76 case I2C_SMBUS_BYTE_DATA: 79 77 if (!(funcs & I2C_FUNC_SMBUS_READ_BYTE_DATA)) { 80 fprintf(stderr, "Error: Adapter does " 81 "not have read byte data capability\n"); 78 fprintf(stderr, MISSING_FUNC_FMT, "read byte"); 82 79 return -1; 83 80 } … … 86 83 case I2C_SMBUS_WORD_DATA: 87 84 if (!(funcs & I2C_FUNC_SMBUS_READ_WORD_DATA)) { 88 fprintf(stderr, "Error: Adapter does " 89 "not have read word data capability\n"); 85 fprintf(stderr, MISSING_FUNC_FMT, "read word"); 90 86 return -1; 91 87 } i2c-tools/trunk/tools/i2cset.c
r5240 r5241 60 60 case I2C_SMBUS_BYTE: 61 61 if (!(funcs & I2C_FUNC_SMBUS_WRITE_BYTE)) { 62 fprintf(stderr, "Error: Adapter does " 63 "not have byte send capability\n"); 62 fprintf(stderr, MISSING_FUNC_FMT, "byte send"); 64 63 return -1; 65 64 } … … 68 67 case I2C_SMBUS_BYTE_DATA: 69 68 if (!(funcs & I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) { 70 fprintf(stderr, "Error: Adapter does " 71 "not have byte write capability\n"); 69 fprintf(stderr, MISSING_FUNC_FMT, "byte write"); 72 70 return -1; 73 71 } … … 76 74 case I2C_SMBUS_WORD_DATA: 77 75 if (!(funcs & I2C_FUNC_SMBUS_WRITE_WORD_DATA)) { 78 fprintf(stderr, "Error: Adapter does " 79 "not have word write capability\n"); 76 fprintf(stderr, MISSING_FUNC_FMT, "word write"); 80 77 return -1; 81 78 }
