You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@JniClass(name = "i2c_msg", flags = {STRUCT})
public static class i2cMsg {
static {
LIBRARY.load();
init();
}
@JniMethod(flags = {CONSTANT_INITIALIZER})
private static native void init();
@JniField(flags = {CONSTANT}, accessor = "sizeof(struct i2c_msg)")
public static int SIZEOF;
public short addr;
public short flags;
public short len;
public byte[] buf;
}
And I need 2 messages for a I2C read operation:
@JniMethod(accessor = "memmove")
public static final native void i2cMsgToMem(
@JniArg(cast = "void *") long dest, @JniArg(cast = "const void *", flags = {NO_OUT, CRITICAL}) i2cMsg src, @JniArg(
cast = "size_t") long size);
The above doesn't work for i2cMsg[].
The text was updated successfully, but these errors were encountered:
For I2C message you need to pass an array of structs:
So I defined:
And I need 2 messages for a I2C read operation:
@JniMethod(accessor = "memmove")
public static final native void i2cMsgToMem(
@JniArg(cast = "void *") long dest, @JniArg(cast = "const void *", flags = {NO_OUT, CRITICAL}) i2cMsg src, @JniArg(
cast = "size_t") long size);
The above doesn't work for i2cMsg[].
The text was updated successfully, but these errors were encountered: