| 136 | \******************************************************************************************/ |
| 137 | |
| 138 | std::string i2c_read(i2c_smbus_interface * bus, unsigned char address, unsigned char regaddr, unsigned char size) |
| 139 | { |
| 140 | int i; |
| 141 | |
| 142 | bus->i2c_smbus_write_byte(address, regaddr); |
| 143 | |
| 144 | char line[128]; |
| 145 | std::string text; |
| 146 | |
| 147 | for(i = 0; i < size; i++) |
| 148 | { |
| 149 | snprintf(line, 128, "%02x ", (unsigned char)bus->i2c_smbus_read_byte(address)); |
| 150 | text.append(line); |
| 151 | } |
| 152 | |
| 153 | return text; |
| 154 | |
| 155 | } /* i2c_read() */ |
no test coverage detected