smbus/smbus.py
def write_block_data(self, addr, cmd, vals):
        """write_block_data(addr, cmd, vals)

        Perform SMBus Write Block Data transaction.
        """
        self._set_addr(addr)
        data = ffi.new("union i2c_smbus_data *")
        list_to_smbus_data(data, vals)
        if SMBUS.i2c_smbus_access(self._fd,
                                  int2byte(SMBUS.I2C_SMBUS_WRITE),
                                  ffi.cast("__u8", cmd),
                                  SMBUS.I2C_SMBUS_BLOCK_DATA,
                                  data):
            raise IOError(ffi.errno)
def write_block_data(self, addr, cmd, vals):
        """write_block_data(addr, cmd, vals)

        Perform SMBus Write Block Data transaction.
        """
        self._set_addr(addr)
        data = ffi.new("union i2c_smbus_data *")
        list_to_smbus_data(data, vals)
        if SMBUS.i2c_smbus_access(self._fd,
                                  int2byte(SMBUS.I2C_SMBUS_WRITE),
                                  ffi.cast("__u8", cmd),
                                  SMBUS.I2C_SMBUS_BLOCK_DATA,
                                  data):
            raise IOError(ffi.errno)
write_block_data(addr, cmd, vals)

        Perform SMBus Write Block Data transaction.