From a607609e6dd88b646adcad0acbe9bb817a807f85 Mon Sep 17 00:00:00 2001 From: Chinmay Pendharkar Date: Wed, 20 Jul 2022 00:05:24 +0800 Subject: [PATCH] fix(*): using i2c_smbus_read_i2c_block_data instead --- src/main/c/i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/c/i2c.c b/src/main/c/i2c.c index 8841b19..34b9070 100644 --- a/src/main/c/i2c.c +++ b/src/main/c/i2c.c @@ -117,7 +117,7 @@ int Java_org_arl_jhwbus_I2CDevice_I2CReadBlockData(JNIEnv* env, jobject obj, jin int rv = 0; log_info("Reading up to %d bytes of data with the command 0x%02X", len, cmd); #ifdef __linux__ - rv = i2c_smbus_read_block_data(fd, cmd, (unsigned char *)rbuf); + rv = i2c_smbus_read_i2c_block_data(fd, cmd, len, (unsigned char *)rbuf); #endif (*env)->ReleaseByteArrayElements(env, arr, rbuf, 0); return rv;