Skip to content

Commit

Permalink
fix(*): using i2c_smbus_read_i2c_block_data instead
Browse files Browse the repository at this point in the history
  • Loading branch information
notthetup committed Jul 19, 2022
1 parent e879695 commit a607609
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/c/i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a607609

Please sign in to comment.