Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
int
I2C::write(int address, const char *data, int length, bool repeated)
{
int
I2C::write(int address, const char *data, int length, bool repeated)
{
+ if (i2c_smbus_write_i2c_block_data(i2c_handle, data[0], length, (uint8_t*) data) < 0) {
+ fprintf(stderr, "Failed to write to I2C slave\n");
+ return -1;
+ }
return 0;
}
int
I2C::write(int data)
{
return 0;
}
int
I2C::write(int data)
{
+ if (i2c_smbus_write_byte(i2c_handle, data) < 0) {
+ fprintf(stderr, "Failed to write to I2C slave\n");
+ return -1;
+ }
+ return 0;