Private
Public Access
2
0

java: Updated gpio.c to use JNI functions set in mraa_lang_func

This is a re-design of commit 0041801. mraa_lang_func_t structure has been
added (similar in design to mraa_adv_func_t) that points to JNI functions
implemented in src/java/mraajni.c. Functions are set by libmraajava.so,
see wrapper entry in src/java/mraajava.i. As gpio.c now uses these
functions, language specific #ifdef code has been removed as JNI code
is only called if functions are defined (i.e. not NULL)

Signed-off-by: Henry Bruce <henry.bruce@intel.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Henry Bruce
2016-02-26 13:50:07 -08:00
committed by Brendan Le Foll
parent d313ac0579
commit 44b2367fdc
9 changed files with 102 additions and 116 deletions

View File

@@ -48,6 +48,7 @@
#define IIO_DEVICE_WILDCARD "iio:device*"
mraa_board_t* plat = NULL;
mraa_iio_info_t* plat_iio = NULL;
mraa_lang_func_t* lang_func = NULL;
static char* platform_name = NULL;
static char* platform_long_name = NULL;
@@ -163,6 +164,8 @@ mraa_init()
}
}
lang_func = (mraa_lang_func_t*) calloc(1, sizeof(mraa_lang_func_t));
syslog(LOG_NOTICE, "libmraa initialised for platform '%s' of type %d", mraa_get_platform_name(), mraa_get_platform_type());
return MRAA_SUCCESS;
}