Saturday, 15 September 2012

jna - Converting a Foo into a Foo.ByValue? -



jna - Converting a Foo into a Foo.ByValue? -

i integrating aged lm_sensors library using jna , jnaerator, view creating mbeans each of temperature sensors within box. firstly i'm calling method:

// c edition const sensors_chip_name *sensors_get_detected_chips(int *nr); // java edition sensors_chip_name sensors_get_detected_chips(intbyreference nr);

.. works fine. subsequently need call:

// c edition int sensors_get_feature(sensors_chip_name name, int feature, double *result); // java edition int sensors_get_feature(sensors_chip_name.byvalue name, int feature, doublebyreference result);

.. lacking how take result of sensors_get_detected_chips , pass by value 1st argument of sensors_get_feature.

the next allows byvalue version of struct initialized base of operations class.

public class sensors_chip_name extends construction { public class byvalue extends sensors_chip_name implements structure.byvalue { public byvalue(sensors_chip_name orig) { this(orig.getpointer().share()); } public byvalue(pointer p) { super(p); } public byvalue() { } } public sensors_chip_name() { } public sensors_chip_name(pointer p) { super(p); read(); } }

jna jnaerator

No comments:

Post a Comment