From dddba3e8a471b56bc4214dda4299fbbfc0d1668b Mon Sep 17 00:00:00 2001 From: Stefan Andritoiu Date: Mon, 23 Nov 2015 17:04:32 +0200 Subject: [PATCH] java: Added auto load library code in upm SWIG interfaces Signed-off-by: Stefan Andritoiu Signed-off-by: Mihai Tudor Panu --- src/a110x/javaupm_a110x.i | 11 ++++++++ src/ad8232/javaupm_ad8232.i | 11 ++++++++ src/adafruitms1438/javaupm_adafruitms1438.i | 11 ++++++++ src/adafruitss/javaupm_adafruitss.i | 11 ++++++++ src/adc121c021/javaupm_adc121c021.i | 11 ++++++++ src/adis16448/javaupm_adis16448.i | 11 ++++++++ src/adxl335/javaupm_adxl335.i | 11 ++++++++ src/adxl345/javaupm_adxl345.i | 11 ++++++++ src/adxrs610/javaupm_adxrs610.i | 11 ++++++++ src/am2315/javaupm_am2315.i | 11 ++++++++ src/apds9002/javaupm_apds9002.i | 11 ++++++++ src/at42qt1070/javaupm_at42qt1070.i | 11 ++++++++ src/biss0001/javaupm_biss0001.i | 11 ++++++++ src/bma220/javaupm_bma220.i | 11 ++++++++ src/bmpx8x/javaupm_bmpx8x.i | 11 ++++++++ src/buzzer/javaupm_buzzer.i | 11 ++++++++ src/cjq4435/javaupm_cjq4435.i | 11 ++++++++ src/dfrph/javaupm_dfrph.i | 11 ++++++++ src/ds1307/javaupm_ds1307.i | 11 ++++++++ src/ecs1030/javaupm_ecs1030.i | 11 ++++++++ src/enc03r/javaupm_enc03r.i | 11 ++++++++ src/flex/javaupm_flex.i | 11 ++++++++ src/gas/javaupm_gas.i | 11 ++++++++ src/gp2y0a/javaupm_gp2y0a.i | 11 ++++++++ src/grove/javaupm_grove.i | 25 ++++++++----------- .../javaupm_grovecircularled.i | 11 ++++++++ src/grovecollision/javaupm_grovecollision.i | 11 ++++++++ src/groveehr/javaupm_groveehr.i | 11 ++++++++ src/groveeldriver/javaupm_groveeldriver.i | 11 ++++++++ .../javaupm_groveelectromagnet.i | 11 ++++++++ src/groveemg/javaupm_groveemg.i | 11 ++++++++ src/grovegprs/javaupm_grovegprs.i | 11 ++++++++ src/grovegsr/javaupm_grovegsr.i | 11 ++++++++ src/grovelinefinder/javaupm_grovelinefinder.i | 11 ++++++++ src/grovemd/javaupm_grovemd.i | 11 ++++++++ src/grovemoisture/javaupm_grovemoisture.i | 11 ++++++++ src/groveo2/javaupm_groveo2.i | 11 ++++++++ src/grovescam/javaupm_grovescam.i | 11 ++++++++ src/grovespeaker/javaupm_grovespeaker.i | 11 ++++++++ src/grovevdiv/javaupm_grovevdiv.i | 11 ++++++++ src/grovewater/javaupm_grovewater.i | 11 ++++++++ src/grovewfs/javaupm_grovewfs.i | 11 ++++++++ src/guvas12d/javaupm_guvas12d.i | 11 ++++++++ src/h3lis331dl/javaupm_h3lis331dl.i | 11 ++++++++ src/hcsr04/javaupm_hcsr04.i | 11 ++++++++ src/hm11/javaupm_hm11.i | 11 ++++++++ src/hmc5883l/javaupm_hmc5883l.i | 11 ++++++++ src/hmtrp/javaupm_hmtrp.i | 11 ++++++++ src/hp20x/javaupm_hp20x.i | 11 ++++++++ src/ht9170/javaupm_ht9170.i | 11 ++++++++ src/htu21d/javaupm_htu21d.i | 11 ++++++++ src/hx711/javaupm_hx711.i | 11 ++++++++ src/ina132/javaupm_ina132.i | 11 ++++++++ src/isd1820/javaupm_isd1820.i | 11 ++++++++ src/itg3200/javaupm_itg3200.i | 11 ++++++++ src/joystick12/javaupm_joystick12.i | 11 ++++++++ src/l298/javaupm_l298.i | 11 ++++++++ src/lcd/javaupm_i2clcd.i | 11 ++++++++ src/ldt0028/javaupm_ldt0028.i | 11 ++++++++ src/lm35/javaupm_lm35.i | 11 ++++++++ src/lol/javaupm_lol.i | 11 ++++++++ src/loudness/javaupm_loudness.i | 11 ++++++++ src/lpd8806/javaupm_lpd8806.i | 11 ++++++++ src/lsm303/javaupm_lsm303.i | 11 ++++++++ src/lsm9ds0/javaupm_lsm9ds0.i | 11 ++++++++ src/m24lr64e/javaupm_m24lr64e.i | 11 ++++++++ src/max31723/javaupm_max31723.i | 11 ++++++++ src/max31855/javaupm_max31855.i | 11 ++++++++ src/max44000/javaupm_max44000.i | 11 ++++++++ src/max5487/javaupm_max5487.i | 11 ++++++++ src/maxds3231m/javaupm_maxds3231m.i | 11 ++++++++ src/maxsonarez/javaupm_maxsonarez.i | 11 ++++++++ src/mcp9808/javaupm_mcp9808.i | 11 ++++++++ src/mg811/javaupm_mg811.i | 11 ++++++++ src/mhz16/javaupm_mhz16.i | 11 ++++++++ src/mic/javaupm_mic.i | 11 ++++++++ src/micsv89/javaupm_micsv89.i | 11 ++++++++ src/mlx90614/javaupm_mlx90614.i | 11 ++++++++ src/mma7455/javaupm_mma7455.i | 11 ++++++++ src/mma7660/javaupm_mma7660.i | 11 ++++++++ src/mpl3115a2/javaupm_mpl3115a2.i | 11 ++++++++ src/mpr121/javaupm_mpr121.i | 11 ++++++++ src/mpu9150/javaupm_mpu9150.i | 11 ++++++++ src/mq303a/javaupm_mq303a.i | 11 ++++++++ src/my9221/javaupm_my9221.i | 11 ++++++++ src/nrf24l01/javaupm_nrf24l01.i | 11 ++++++++ src/nrf8001/javaupm_nrf8001.i | 11 ++++++++ src/nunchuck/javaupm_nunchuck.i | 11 ++++++++ src/otp538u/javaupm_otp538u.i | 11 ++++++++ src/pca9685/javaupm_pca9685.i | 11 ++++++++ src/pn532/javaupm_pn532.i | 11 ++++++++ src/ppd42ns/javaupm_ppd42ns.i | 11 ++++++++ src/pulsensor/javaupm_pulsensor.i | 11 ++++++++ src/rfr359f/javaupm_rfr359f.i | 11 ++++++++ src/rgbringcoder/javaupm_rgbringcoder.i | 11 ++++++++ src/rotaryencoder/javaupm_rotaryencoder.i | 11 ++++++++ src/rpr220/javaupm_rpr220.i | 11 ++++++++ src/servo/javaupm_servo.i | 11 ++++++++ src/si114x/javaupm_si114x.i | 11 ++++++++ src/sm130/javaupm_sm130.i | 11 ++++++++ src/st7735/javaupm_st7735.i | 11 ++++++++ src/stepmotor/javaupm_stepmotor.i | 11 ++++++++ src/sx6119/javaupm_sx6119.i | 11 ++++++++ src/ta12200/javaupm_ta12200.i | 11 ++++++++ src/tcs3414cs/javaupm_tcs3414cs.i | 11 ++++++++ src/th02/javaupm_th02.i | 11 ++++++++ src/tm1637/javaupm_tm1637.i | 11 ++++++++ src/tsl2561/javaupm_tsl2561.i | 11 ++++++++ src/ttp223/javaupm_ttp223.i | 11 ++++++++ src/ublox6/javaupm_ublox6.i | 11 ++++++++ src/uln200xa/javaupm_uln200xa.i | 11 ++++++++ src/urm37/javaupm_urm37.i | 11 ++++++++ src/waterlevel/javaupm_waterlevel.i | 11 ++++++++ src/wheelencoder/javaupm_wheelencoder.i | 11 ++++++++ src/wt5001/javaupm_wt5001.i | 11 ++++++++ src/xbee/javaupm_xbee.i | 11 ++++++++ src/yg1006/javaupm_yg1006.i | 11 ++++++++ src/zfm20/javaupm_zfm20.i | 11 ++++++++ 118 files changed, 1298 insertions(+), 14 deletions(-) diff --git a/src/a110x/javaupm_a110x.i b/src/a110x/javaupm_a110x.i index 013ea44b..7db0fcbe 100644 --- a/src/a110x/javaupm_a110x.i +++ b/src/a110x/javaupm_a110x.i @@ -12,3 +12,14 @@ #include "a110x.h" %} %include "a110x.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_a110x"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ad8232/javaupm_ad8232.i b/src/ad8232/javaupm_ad8232.i index 85d1dc87..391f1cf2 100644 --- a/src/ad8232/javaupm_ad8232.i +++ b/src/ad8232/javaupm_ad8232.i @@ -6,3 +6,14 @@ %} %include "ad8232.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ad8232"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/adafruitms1438/javaupm_adafruitms1438.i b/src/adafruitms1438/javaupm_adafruitms1438.i index 1ba5f2fe..a02306c9 100644 --- a/src/adafruitms1438/javaupm_adafruitms1438.i +++ b/src/adafruitms1438/javaupm_adafruitms1438.i @@ -6,3 +6,14 @@ %} %include "adafruitms1438.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_adafruitms1438"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/adafruitss/javaupm_adafruitss.i b/src/adafruitss/javaupm_adafruitss.i index 4ce62817..4e642201 100644 --- a/src/adafruitss/javaupm_adafruitss.i +++ b/src/adafruitss/javaupm_adafruitss.i @@ -5,3 +5,14 @@ %{ #include "adafruitss.h" %} + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_adafruitss"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/adc121c021/javaupm_adc121c021.i b/src/adc121c021/javaupm_adc121c021.i index 039c0810..33e4d2e2 100644 --- a/src/adc121c021/javaupm_adc121c021.i +++ b/src/adc121c021/javaupm_adc121c021.i @@ -7,3 +7,14 @@ %} %include "adc121c021.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_adc121c021"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/adis16448/javaupm_adis16448.i b/src/adis16448/javaupm_adis16448.i index 4124656b..b4cc0b12 100644 --- a/src/adis16448/javaupm_adis16448.i +++ b/src/adis16448/javaupm_adis16448.i @@ -6,3 +6,14 @@ %} %include "adis16448.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_adis16448"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/adxl335/javaupm_adxl335.i b/src/adxl335/javaupm_adxl335.i index 5fd3be16..26245715 100644 --- a/src/adxl335/javaupm_adxl335.i +++ b/src/adxl335/javaupm_adxl335.i @@ -41,3 +41,14 @@ %ignore acceleration(float *, float *, float *); %include "adxl335.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_adxl335"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/adxl345/javaupm_adxl345.i b/src/adxl345/javaupm_adxl345.i index e66ee923..9b759b43 100644 --- a/src/adxl345/javaupm_adxl345.i +++ b/src/adxl345/javaupm_adxl345.i @@ -34,3 +34,14 @@ } %include "adxl345.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_adxl345"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/adxrs610/javaupm_adxrs610.i b/src/adxrs610/javaupm_adxrs610.i index d100397a..0c89c146 100644 --- a/src/adxrs610/javaupm_adxrs610.i +++ b/src/adxrs610/javaupm_adxrs610.i @@ -6,3 +6,14 @@ %} %include "adxrs610.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_adxrs610"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/am2315/javaupm_am2315.i b/src/am2315/javaupm_am2315.i index 43cc15a6..5d2a0ad2 100644 --- a/src/am2315/javaupm_am2315.i +++ b/src/am2315/javaupm_am2315.i @@ -6,3 +6,14 @@ %} %include "am2315.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_am2315"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/apds9002/javaupm_apds9002.i b/src/apds9002/javaupm_apds9002.i index cff3e049..645e8f9e 100644 --- a/src/apds9002/javaupm_apds9002.i +++ b/src/apds9002/javaupm_apds9002.i @@ -6,3 +6,14 @@ %} %include "apds9002.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_apds9002"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/at42qt1070/javaupm_at42qt1070.i b/src/at42qt1070/javaupm_at42qt1070.i index f8724f0b..8aceab06 100644 --- a/src/at42qt1070/javaupm_at42qt1070.i +++ b/src/at42qt1070/javaupm_at42qt1070.i @@ -6,3 +6,14 @@ %} %include "at42qt1070.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_at42qt1070"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/biss0001/javaupm_biss0001.i b/src/biss0001/javaupm_biss0001.i index 215172f3..c8412302 100644 --- a/src/biss0001/javaupm_biss0001.i +++ b/src/biss0001/javaupm_biss0001.i @@ -6,3 +6,14 @@ %} %include "biss0001.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_biss0001"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/bma220/javaupm_bma220.i b/src/bma220/javaupm_bma220.i index 37707405..72051780 100644 --- a/src/bma220/javaupm_bma220.i +++ b/src/bma220/javaupm_bma220.i @@ -34,3 +34,14 @@ %} %include "bma220.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_bma220"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/bmpx8x/javaupm_bmpx8x.i b/src/bmpx8x/javaupm_bmpx8x.i index bf6b3df8..227056b6 100644 --- a/src/bmpx8x/javaupm_bmpx8x.i +++ b/src/bmpx8x/javaupm_bmpx8x.i @@ -6,3 +6,14 @@ %} %include "bmpx8x.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_bmpx8x"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/buzzer/javaupm_buzzer.i b/src/buzzer/javaupm_buzzer.i index d27d761b..e647831b 100644 --- a/src/buzzer/javaupm_buzzer.i +++ b/src/buzzer/javaupm_buzzer.i @@ -6,3 +6,14 @@ %} %include "buzzer.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_buzzer"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/cjq4435/javaupm_cjq4435.i b/src/cjq4435/javaupm_cjq4435.i index 72c8fe19..a67fb5b4 100644 --- a/src/cjq4435/javaupm_cjq4435.i +++ b/src/cjq4435/javaupm_cjq4435.i @@ -6,3 +6,14 @@ %} %include "cjq4435.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_cjq4435"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/dfrph/javaupm_dfrph.i b/src/dfrph/javaupm_dfrph.i index a0d70757..68fe1932 100644 --- a/src/dfrph/javaupm_dfrph.i +++ b/src/dfrph/javaupm_dfrph.i @@ -6,3 +6,14 @@ %} %include "dfrph.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_dfrph"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ds1307/javaupm_ds1307.i b/src/ds1307/javaupm_ds1307.i index 4fecc345..ba7de157 100644 --- a/src/ds1307/javaupm_ds1307.i +++ b/src/ds1307/javaupm_ds1307.i @@ -8,3 +8,14 @@ %} %include "ds1307.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ds1307"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ecs1030/javaupm_ecs1030.i b/src/ecs1030/javaupm_ecs1030.i index 2ba1e20c..93f5c5ea 100644 --- a/src/ecs1030/javaupm_ecs1030.i +++ b/src/ecs1030/javaupm_ecs1030.i @@ -6,3 +6,14 @@ %} %include "ecs1030.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ecs1030"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/enc03r/javaupm_enc03r.i b/src/enc03r/javaupm_enc03r.i index 9e70c946..2557969e 100644 --- a/src/enc03r/javaupm_enc03r.i +++ b/src/enc03r/javaupm_enc03r.i @@ -6,3 +6,14 @@ %} %include "enc03r.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_enc03r"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/flex/javaupm_flex.i b/src/flex/javaupm_flex.i index e4610752..fc28dcf9 100644 --- a/src/flex/javaupm_flex.i +++ b/src/flex/javaupm_flex.i @@ -6,3 +6,14 @@ %} %include "flex.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_flex"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/gas/javaupm_gas.i b/src/gas/javaupm_gas.i index 7aa42523..fc3b016e 100644 --- a/src/gas/javaupm_gas.i +++ b/src/gas/javaupm_gas.i @@ -55,3 +55,14 @@ %include "mq8.h" %include "mq9.h" %include "tp401.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_gas"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/gp2y0a/javaupm_gp2y0a.i b/src/gp2y0a/javaupm_gp2y0a.i index 5936c867..8b2f7610 100644 --- a/src/gp2y0a/javaupm_gp2y0a.i +++ b/src/gp2y0a/javaupm_gp2y0a.i @@ -6,3 +6,14 @@ %} %include "gp2y0a.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_gp2y0a"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grove/javaupm_grove.i b/src/grove/javaupm_grove.i index 2a3075bf..77634047 100644 --- a/src/grove/javaupm_grove.i +++ b/src/grove/javaupm_grove.i @@ -12,20 +12,17 @@ %{ #include "grove.h" %} -/* -%typemap(jni) mraa_result_t "jint" -%typemap(jstype) mraa_result_t "int" -%typemap(jtype) mraa_result_t "int" - -%typemap(javaout) mraa_result_t { - return $jnicall; -} - - -%typemap(out) mraa_result_t { - $result = (int)$1; -} -*/ %include "grove.h" +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grove"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} + diff --git a/src/grovecircularled/javaupm_grovecircularled.i b/src/grovecircularled/javaupm_grovecircularled.i index cdc7b483..054c4521 100644 --- a/src/grovecircularled/javaupm_grovecircularled.i +++ b/src/grovecircularled/javaupm_grovecircularled.i @@ -7,3 +7,14 @@ %} %include "grovecircularled.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovecircularled"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovecollision/javaupm_grovecollision.i b/src/grovecollision/javaupm_grovecollision.i index e6e503c5..7cb10497 100644 --- a/src/grovecollision/javaupm_grovecollision.i +++ b/src/grovecollision/javaupm_grovecollision.i @@ -6,3 +6,14 @@ %} %include "grovecollision.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovecollision"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/groveehr/javaupm_groveehr.i b/src/groveehr/javaupm_groveehr.i index 230d8bde..2b5d110e 100644 --- a/src/groveehr/javaupm_groveehr.i +++ b/src/groveehr/javaupm_groveehr.i @@ -8,3 +8,14 @@ %} %include "groveehr.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_groveehr"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/groveeldriver/javaupm_groveeldriver.i b/src/groveeldriver/javaupm_groveeldriver.i index e2648fff..061329cf 100644 --- a/src/groveeldriver/javaupm_groveeldriver.i +++ b/src/groveeldriver/javaupm_groveeldriver.i @@ -6,3 +6,14 @@ %} %include "groveeldriver.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_groveeldriver"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/groveelectromagnet/javaupm_groveelectromagnet.i b/src/groveelectromagnet/javaupm_groveelectromagnet.i index f0e8367e..5def2836 100644 --- a/src/groveelectromagnet/javaupm_groveelectromagnet.i +++ b/src/groveelectromagnet/javaupm_groveelectromagnet.i @@ -6,3 +6,14 @@ %} %include "groveelectromagnet.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_groveelectromagnet"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/groveemg/javaupm_groveemg.i b/src/groveemg/javaupm_groveemg.i index 6cb01c25..c829829f 100644 --- a/src/groveemg/javaupm_groveemg.i +++ b/src/groveemg/javaupm_groveemg.i @@ -6,3 +6,14 @@ %} %include "groveemg.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_groveemg"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovegprs/javaupm_grovegprs.i b/src/grovegprs/javaupm_grovegprs.i index 00f57499..e0486267 100644 --- a/src/grovegprs/javaupm_grovegprs.i +++ b/src/grovegprs/javaupm_grovegprs.i @@ -9,3 +9,14 @@ %include "grovegprs.h" %array_class(char, charArray); + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovegprs"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovegsr/javaupm_grovegsr.i b/src/grovegsr/javaupm_grovegsr.i index 6d01a103..658146d8 100644 --- a/src/grovegsr/javaupm_grovegsr.i +++ b/src/grovegsr/javaupm_grovegsr.i @@ -6,3 +6,14 @@ %} %include "grovegsr.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovegsr"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovelinefinder/javaupm_grovelinefinder.i b/src/grovelinefinder/javaupm_grovelinefinder.i index 7157f875..bee2ffd4 100644 --- a/src/grovelinefinder/javaupm_grovelinefinder.i +++ b/src/grovelinefinder/javaupm_grovelinefinder.i @@ -6,3 +6,14 @@ %} %include "grovelinefinder.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovelinefinder"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovemd/javaupm_grovemd.i b/src/grovemd/javaupm_grovemd.i index a0886b61..341297c7 100644 --- a/src/grovemd/javaupm_grovemd.i +++ b/src/grovemd/javaupm_grovemd.i @@ -6,3 +6,14 @@ %} %include "grovemd.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovemd"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovemoisture/javaupm_grovemoisture.i b/src/grovemoisture/javaupm_grovemoisture.i index c0dcf069..886991a8 100644 --- a/src/grovemoisture/javaupm_grovemoisture.i +++ b/src/grovemoisture/javaupm_grovemoisture.i @@ -6,3 +6,14 @@ %} %include "grovemoisture.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovemoisture"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/groveo2/javaupm_groveo2.i b/src/groveo2/javaupm_groveo2.i index b91db8b4..8ae03995 100644 --- a/src/groveo2/javaupm_groveo2.i +++ b/src/groveo2/javaupm_groveo2.i @@ -6,3 +6,14 @@ %} %include "groveo2.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_groveo2"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovescam/javaupm_grovescam.i b/src/grovescam/javaupm_grovescam.i index bd352b6e..8e55cdfc 100644 --- a/src/grovescam/javaupm_grovescam.i +++ b/src/grovescam/javaupm_grovescam.i @@ -7,3 +7,14 @@ %} %include "grovescam.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovescam"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovespeaker/javaupm_grovespeaker.i b/src/grovespeaker/javaupm_grovespeaker.i index 80aba338..c3f98a7b 100644 --- a/src/grovespeaker/javaupm_grovespeaker.i +++ b/src/grovespeaker/javaupm_grovespeaker.i @@ -6,3 +6,14 @@ %} %include "grovespeaker.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovespeaker"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovevdiv/javaupm_grovevdiv.i b/src/grovevdiv/javaupm_grovevdiv.i index e7d8b30a..1fb23bdf 100644 --- a/src/grovevdiv/javaupm_grovevdiv.i +++ b/src/grovevdiv/javaupm_grovevdiv.i @@ -6,3 +6,14 @@ %} %include "grovevdiv.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovevdiv"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovewater/javaupm_grovewater.i b/src/grovewater/javaupm_grovewater.i index 7b79d6d9..d679c2ed 100644 --- a/src/grovewater/javaupm_grovewater.i +++ b/src/grovewater/javaupm_grovewater.i @@ -6,3 +6,14 @@ %} %include "grovewater.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovewater"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/grovewfs/javaupm_grovewfs.i b/src/grovewfs/javaupm_grovewfs.i index 4c7ce6cc..7e650ac0 100644 --- a/src/grovewfs/javaupm_grovewfs.i +++ b/src/grovewfs/javaupm_grovewfs.i @@ -8,3 +8,14 @@ %} %include "grovewfs.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_grovewfs"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/guvas12d/javaupm_guvas12d.i b/src/guvas12d/javaupm_guvas12d.i index 7dec36b0..1b7af281 100644 --- a/src/guvas12d/javaupm_guvas12d.i +++ b/src/guvas12d/javaupm_guvas12d.i @@ -6,3 +6,14 @@ %} %include "guvas12d.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_guvas12d"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/h3lis331dl/javaupm_h3lis331dl.i b/src/h3lis331dl/javaupm_h3lis331dl.i index 7dfad790..812a53d4 100644 --- a/src/h3lis331dl/javaupm_h3lis331dl.i +++ b/src/h3lis331dl/javaupm_h3lis331dl.i @@ -49,3 +49,14 @@ %ignore getAcceleration(float *, float *, float *); %include "h3lis331dl.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_h3lis331dl"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/hcsr04/javaupm_hcsr04.i b/src/hcsr04/javaupm_hcsr04.i index 07611aa9..b1881a78 100644 --- a/src/hcsr04/javaupm_hcsr04.i +++ b/src/hcsr04/javaupm_hcsr04.i @@ -11,3 +11,14 @@ %} %include "hcsr04.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_hcsr04"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/hm11/javaupm_hm11.i b/src/hm11/javaupm_hm11.i index 7475551d..df710826 100644 --- a/src/hm11/javaupm_hm11.i +++ b/src/hm11/javaupm_hm11.i @@ -11,3 +11,14 @@ %include "hm11.h" speed_t int_B9600 = B9600; %array_class(char, charArray); + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_hm11"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/hmc5883l/javaupm_hmc5883l.i b/src/hmc5883l/javaupm_hmc5883l.i index 18ec4839..cc80059c 100644 --- a/src/hmc5883l/javaupm_hmc5883l.i +++ b/src/hmc5883l/javaupm_hmc5883l.i @@ -19,3 +19,14 @@ } %include "hmc5883l.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_hmc5883l"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/hmtrp/javaupm_hmtrp.i b/src/hmtrp/javaupm_hmtrp.i index c02e34a1..4e5cc780 100644 --- a/src/hmtrp/javaupm_hmtrp.i +++ b/src/hmtrp/javaupm_hmtrp.i @@ -17,3 +17,14 @@ %include "hmtrp.h" speed_t int_B9600 = B9600; + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_hmtrp"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/hp20x/javaupm_hp20x.i b/src/hp20x/javaupm_hp20x.i index 73ac8bfa..54d7c33b 100644 --- a/src/hp20x/javaupm_hp20x.i +++ b/src/hp20x/javaupm_hp20x.i @@ -6,3 +6,14 @@ %} %include "hp20x.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_hp20x"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ht9170/javaupm_ht9170.i b/src/ht9170/javaupm_ht9170.i index 10a7cd70..4bc6b1d5 100644 --- a/src/ht9170/javaupm_ht9170.i +++ b/src/ht9170/javaupm_ht9170.i @@ -6,3 +6,14 @@ %} %include "ht9170.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ht9170"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/htu21d/javaupm_htu21d.i b/src/htu21d/javaupm_htu21d.i index c288b8fd..7c6b1eff 100644 --- a/src/htu21d/javaupm_htu21d.i +++ b/src/htu21d/javaupm_htu21d.i @@ -6,3 +6,14 @@ %} %include "htu21d.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_htu21d"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/hx711/javaupm_hx711.i b/src/hx711/javaupm_hx711.i index b0bd0293..2d8fdf59 100644 --- a/src/hx711/javaupm_hx711.i +++ b/src/hx711/javaupm_hx711.i @@ -6,3 +6,14 @@ %} %include "hx711.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_hx711"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ina132/javaupm_ina132.i b/src/ina132/javaupm_ina132.i index ba5b82ef..b49ed207 100644 --- a/src/ina132/javaupm_ina132.i +++ b/src/ina132/javaupm_ina132.i @@ -6,3 +6,14 @@ %} %include "ina132.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ina132"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/isd1820/javaupm_isd1820.i b/src/isd1820/javaupm_isd1820.i index c7535404..ac5f341b 100644 --- a/src/isd1820/javaupm_isd1820.i +++ b/src/isd1820/javaupm_isd1820.i @@ -7,3 +7,14 @@ %include "isd1820.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_isd1820"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/itg3200/javaupm_itg3200.i b/src/itg3200/javaupm_itg3200.i index ff108311..012c6a06 100644 --- a/src/itg3200/javaupm_itg3200.i +++ b/src/itg3200/javaupm_itg3200.i @@ -33,3 +33,14 @@ } %include "itg3200.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_itg3200"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/joystick12/javaupm_joystick12.i b/src/joystick12/javaupm_joystick12.i index 017d8187..8ebe78f0 100644 --- a/src/joystick12/javaupm_joystick12.i +++ b/src/joystick12/javaupm_joystick12.i @@ -6,3 +6,14 @@ %} %include "joystick12.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_joystick12"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/l298/javaupm_l298.i b/src/l298/javaupm_l298.i index 86e35499..8a9355ea 100644 --- a/src/l298/javaupm_l298.i +++ b/src/l298/javaupm_l298.i @@ -6,3 +6,14 @@ %} %include "l298.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_l298"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/lcd/javaupm_i2clcd.i b/src/lcd/javaupm_i2clcd.i index 2daa0c98..4705025f 100644 --- a/src/lcd/javaupm_i2clcd.i +++ b/src/lcd/javaupm_i2clcd.i @@ -43,3 +43,14 @@ %include "lcm1602.h" %include "jhd1313m1.h" %include "sainsmartks.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_i2clcd"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ldt0028/javaupm_ldt0028.i b/src/ldt0028/javaupm_ldt0028.i index 3e10fbeb..6407f5f8 100644 --- a/src/ldt0028/javaupm_ldt0028.i +++ b/src/ldt0028/javaupm_ldt0028.i @@ -6,3 +6,14 @@ %} %include "ldt0028.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ldt0028"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/lm35/javaupm_lm35.i b/src/lm35/javaupm_lm35.i index b775f5d1..aafab80b 100644 --- a/src/lm35/javaupm_lm35.i +++ b/src/lm35/javaupm_lm35.i @@ -6,3 +6,14 @@ %} %include "lm35.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_lm35"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/lol/javaupm_lol.i b/src/lol/javaupm_lol.i index 8764e6a7..6c1ceaee 100644 --- a/src/lol/javaupm_lol.i +++ b/src/lol/javaupm_lol.i @@ -23,3 +23,14 @@ %} %include "lol.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_lol"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/loudness/javaupm_loudness.i b/src/loudness/javaupm_loudness.i index caaebab1..5818ee71 100644 --- a/src/loudness/javaupm_loudness.i +++ b/src/loudness/javaupm_loudness.i @@ -6,3 +6,14 @@ %} %include "loudness.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_loudness"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/lpd8806/javaupm_lpd8806.i b/src/lpd8806/javaupm_lpd8806.i index 7e4d60b2..5de138a5 100644 --- a/src/lpd8806/javaupm_lpd8806.i +++ b/src/lpd8806/javaupm_lpd8806.i @@ -6,3 +6,14 @@ %} %include "lpd8806.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_lpd8806"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/lsm303/javaupm_lsm303.i b/src/lsm303/javaupm_lsm303.i index eb99988d..961c74fd 100644 --- a/src/lsm303/javaupm_lsm303.i +++ b/src/lsm303/javaupm_lsm303.i @@ -19,3 +19,14 @@ } %include "lsm303.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_lsm303"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/lsm9ds0/javaupm_lsm9ds0.i b/src/lsm9ds0/javaupm_lsm9ds0.i index 0b8dd353..7bfc7910 100644 --- a/src/lsm9ds0/javaupm_lsm9ds0.i +++ b/src/lsm9ds0/javaupm_lsm9ds0.i @@ -48,3 +48,14 @@ %} %include "lsm9ds0.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_lsm9ds0"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/m24lr64e/javaupm_m24lr64e.i b/src/m24lr64e/javaupm_m24lr64e.i index 906c1abf..185e7e5f 100644 --- a/src/m24lr64e/javaupm_m24lr64e.i +++ b/src/m24lr64e/javaupm_m24lr64e.i @@ -24,3 +24,14 @@ %} %include "m24lr64e.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_m24lr64e"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/max31723/javaupm_max31723.i b/src/max31723/javaupm_max31723.i index da5f6886..419a34ac 100644 --- a/src/max31723/javaupm_max31723.i +++ b/src/max31723/javaupm_max31723.i @@ -6,3 +6,14 @@ %} %include "max31723.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_max31723"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/max31855/javaupm_max31855.i b/src/max31855/javaupm_max31855.i index d8deb0f7..a778d370 100644 --- a/src/max31855/javaupm_max31855.i +++ b/src/max31855/javaupm_max31855.i @@ -8,3 +8,14 @@ %include "max31855.h" //! [Interesting] + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_max31855"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/max44000/javaupm_max44000.i b/src/max44000/javaupm_max44000.i index 29b06030..fbf331a5 100644 --- a/src/max44000/javaupm_max44000.i +++ b/src/max44000/javaupm_max44000.i @@ -6,3 +6,14 @@ %} %include "max44000.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_max44000"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/max5487/javaupm_max5487.i b/src/max5487/javaupm_max5487.i index a97009b5..e31fed55 100644 --- a/src/max5487/javaupm_max5487.i +++ b/src/max5487/javaupm_max5487.i @@ -6,3 +6,14 @@ %} %include "max5487.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_max5487"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/maxds3231m/javaupm_maxds3231m.i b/src/maxds3231m/javaupm_maxds3231m.i index dea3fa14..4dcf6f33 100644 --- a/src/maxds3231m/javaupm_maxds3231m.i +++ b/src/maxds3231m/javaupm_maxds3231m.i @@ -6,3 +6,14 @@ %} %include "maxds3231m.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_maxds3231m"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/maxsonarez/javaupm_maxsonarez.i b/src/maxsonarez/javaupm_maxsonarez.i index 960f78a6..dc3faeff 100644 --- a/src/maxsonarez/javaupm_maxsonarez.i +++ b/src/maxsonarez/javaupm_maxsonarez.i @@ -6,3 +6,14 @@ %} %include "maxsonarez.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_maxsonarez"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mcp9808/javaupm_mcp9808.i b/src/mcp9808/javaupm_mcp9808.i index 7a7394d9..ff6383be 100644 --- a/src/mcp9808/javaupm_mcp9808.i +++ b/src/mcp9808/javaupm_mcp9808.i @@ -6,3 +6,14 @@ %} %include "mcp9808.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mcp9808"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mg811/javaupm_mg811.i b/src/mg811/javaupm_mg811.i index e405761c..3f7e201a 100644 --- a/src/mg811/javaupm_mg811.i +++ b/src/mg811/javaupm_mg811.i @@ -6,3 +6,14 @@ %} %include "mg811.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mg811"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mhz16/javaupm_mhz16.i b/src/mhz16/javaupm_mhz16.i index 1d50fb71..c2735a34 100644 --- a/src/mhz16/javaupm_mhz16.i +++ b/src/mhz16/javaupm_mhz16.i @@ -14,3 +14,14 @@ %include "mhz16.h" speed_t int_B9600 = B9600; + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mhz16"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mic/javaupm_mic.i b/src/mic/javaupm_mic.i index 4d3f5d52..5abc65ca 100644 --- a/src/mic/javaupm_mic.i +++ b/src/mic/javaupm_mic.i @@ -38,3 +38,14 @@ } %include "mic.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mic"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/micsv89/javaupm_micsv89.i b/src/micsv89/javaupm_micsv89.i index ee59da55..1e11060d 100644 --- a/src/micsv89/javaupm_micsv89.i +++ b/src/micsv89/javaupm_micsv89.i @@ -6,3 +6,14 @@ %} %include "micsv89.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_micsv89"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mlx90614/javaupm_mlx90614.i b/src/mlx90614/javaupm_mlx90614.i index 60cfb92c..a5809259 100644 --- a/src/mlx90614/javaupm_mlx90614.i +++ b/src/mlx90614/javaupm_mlx90614.i @@ -6,3 +6,14 @@ %} %include "mlx90614.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mlx90614"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mma7455/javaupm_mma7455.i b/src/mma7455/javaupm_mma7455.i index 3d4724ba..04a1f1f2 100644 --- a/src/mma7455/javaupm_mma7455.i +++ b/src/mma7455/javaupm_mma7455.i @@ -27,3 +27,14 @@ %} %include "mma7455.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mma7455"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mma7660/javaupm_mma7660.i b/src/mma7660/javaupm_mma7660.i index e967ab12..e1f0b590 100644 --- a/src/mma7660/javaupm_mma7660.i +++ b/src/mma7660/javaupm_mma7660.i @@ -48,3 +48,14 @@ %ignore getAcceleration(float *, float *, float *); %include "mma7660.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mma7660"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mpl3115a2/javaupm_mpl3115a2.i b/src/mpl3115a2/javaupm_mpl3115a2.i index a638390a..651dbccd 100644 --- a/src/mpl3115a2/javaupm_mpl3115a2.i +++ b/src/mpl3115a2/javaupm_mpl3115a2.i @@ -6,3 +6,14 @@ %} %include "mpl3115a2.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mpl3115a2"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mpr121/javaupm_mpr121.i b/src/mpr121/javaupm_mpr121.i index f045e0ea..8f1e146e 100644 --- a/src/mpr121/javaupm_mpr121.i +++ b/src/mpr121/javaupm_mpr121.i @@ -8,3 +8,14 @@ %} %include "mpr121.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mpr121"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mpu9150/javaupm_mpu9150.i b/src/mpu9150/javaupm_mpu9150.i index 614ec6f5..5e3d0b04 100644 --- a/src/mpu9150/javaupm_mpu9150.i +++ b/src/mpu9150/javaupm_mpu9150.i @@ -37,3 +37,14 @@ %include "mpu60x0.h" %include "mpu9150.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mpu9150"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/mq303a/javaupm_mq303a.i b/src/mq303a/javaupm_mq303a.i index b52ad96d..da7c5bb8 100644 --- a/src/mq303a/javaupm_mq303a.i +++ b/src/mq303a/javaupm_mq303a.i @@ -6,3 +6,14 @@ %} %include "mq303a.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_mq303a"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/my9221/javaupm_my9221.i b/src/my9221/javaupm_my9221.i index b6797cb4..afb248ae 100644 --- a/src/my9221/javaupm_my9221.i +++ b/src/my9221/javaupm_my9221.i @@ -6,3 +6,14 @@ %} %include "my9221.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_my9221"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/nrf24l01/javaupm_nrf24l01.i b/src/nrf24l01/javaupm_nrf24l01.i index df7af108..924b8516 100644 --- a/src/nrf24l01/javaupm_nrf24l01.i +++ b/src/nrf24l01/javaupm_nrf24l01.i @@ -12,3 +12,14 @@ %} %include "nrf24l01.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_nrf24l01"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/nrf8001/javaupm_nrf8001.i b/src/nrf8001/javaupm_nrf8001.i index bd6e25ef..9956b43c 100644 --- a/src/nrf8001/javaupm_nrf8001.i +++ b/src/nrf8001/javaupm_nrf8001.i @@ -6,3 +6,14 @@ %} %include "nrf8001.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_nrf8001"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/nunchuck/javaupm_nunchuck.i b/src/nunchuck/javaupm_nunchuck.i index a87273f2..e479d053 100644 --- a/src/nunchuck/javaupm_nunchuck.i +++ b/src/nunchuck/javaupm_nunchuck.i @@ -7,3 +7,14 @@ %} %include "nunchuck.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_nunchuck"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/otp538u/javaupm_otp538u.i b/src/otp538u/javaupm_otp538u.i index 55c542f4..90703b89 100644 --- a/src/otp538u/javaupm_otp538u.i +++ b/src/otp538u/javaupm_otp538u.i @@ -6,3 +6,14 @@ %} %include "otp538u.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_otp538u"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/pca9685/javaupm_pca9685.i b/src/pca9685/javaupm_pca9685.i index 3b34a436..4ff61980 100644 --- a/src/pca9685/javaupm_pca9685.i +++ b/src/pca9685/javaupm_pca9685.i @@ -7,3 +7,14 @@ %} %include "pca9685.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_pca9685"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/pn532/javaupm_pn532.i b/src/pn532/javaupm_pn532.i index d9765bd4..ad97bf3e 100644 --- a/src/pn532/javaupm_pn532.i +++ b/src/pn532/javaupm_pn532.i @@ -14,3 +14,14 @@ %} %include "pn532.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_pn532"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ppd42ns/javaupm_ppd42ns.i b/src/ppd42ns/javaupm_ppd42ns.i index 148bbfea..beecd3e0 100644 --- a/src/ppd42ns/javaupm_ppd42ns.i +++ b/src/ppd42ns/javaupm_ppd42ns.i @@ -6,3 +6,14 @@ %} %include "ppd42ns.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ppd42ns"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/pulsensor/javaupm_pulsensor.i b/src/pulsensor/javaupm_pulsensor.i index ee8ab0cc..7dc3a261 100644 --- a/src/pulsensor/javaupm_pulsensor.i +++ b/src/pulsensor/javaupm_pulsensor.i @@ -15,3 +15,14 @@ %} %include "pulsensor.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_pulsensor"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/rfr359f/javaupm_rfr359f.i b/src/rfr359f/javaupm_rfr359f.i index a7cf2962..ebd528f5 100644 --- a/src/rfr359f/javaupm_rfr359f.i +++ b/src/rfr359f/javaupm_rfr359f.i @@ -6,3 +6,14 @@ %} %include "rfr359f.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_rfr359f"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/rgbringcoder/javaupm_rgbringcoder.i b/src/rgbringcoder/javaupm_rgbringcoder.i index 9db247e7..2e67125e 100644 --- a/src/rgbringcoder/javaupm_rgbringcoder.i +++ b/src/rgbringcoder/javaupm_rgbringcoder.i @@ -6,3 +6,14 @@ %} %include "rgbringcoder.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_rgbringcoder"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/rotaryencoder/javaupm_rotaryencoder.i b/src/rotaryencoder/javaupm_rotaryencoder.i index 9140c95a..af10c233 100644 --- a/src/rotaryencoder/javaupm_rotaryencoder.i +++ b/src/rotaryencoder/javaupm_rotaryencoder.i @@ -8,3 +8,14 @@ %} %include "rotaryencoder.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_rotaryencoder"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/rpr220/javaupm_rpr220.i b/src/rpr220/javaupm_rpr220.i index d25f6a0b..f6d6e5e5 100644 --- a/src/rpr220/javaupm_rpr220.i +++ b/src/rpr220/javaupm_rpr220.i @@ -11,3 +11,14 @@ #include "rpr220.h" %} %include "rpr220.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_rpr220"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/servo/javaupm_servo.i b/src/servo/javaupm_servo.i index 87547860..38e04361 100644 --- a/src/servo/javaupm_servo.i +++ b/src/servo/javaupm_servo.i @@ -15,3 +15,14 @@ %{ #include "es9257.h" %} + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_servo"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/si114x/javaupm_si114x.i b/src/si114x/javaupm_si114x.i index 140f506f..173c4a66 100644 --- a/src/si114x/javaupm_si114x.i +++ b/src/si114x/javaupm_si114x.i @@ -7,3 +7,14 @@ %} %include "si114x.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_si114x"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/sm130/javaupm_sm130.i b/src/sm130/javaupm_sm130.i index ee439fd1..5c1e1a91 100644 --- a/src/sm130/javaupm_sm130.i +++ b/src/sm130/javaupm_sm130.i @@ -6,3 +6,14 @@ %} %include "sm130.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_sm130"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/st7735/javaupm_st7735.i b/src/st7735/javaupm_st7735.i index 5dd5e4a9..e60367c9 100644 --- a/src/st7735/javaupm_st7735.i +++ b/src/st7735/javaupm_st7735.i @@ -44,3 +44,14 @@ %{ #include "st7735.h" %} + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_st7735"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/stepmotor/javaupm_stepmotor.i b/src/stepmotor/javaupm_stepmotor.i index 18cf68dd..96ec7bcd 100644 --- a/src/stepmotor/javaupm_stepmotor.i +++ b/src/stepmotor/javaupm_stepmotor.i @@ -6,3 +6,14 @@ %} %include "stepmotor.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_stepmotor"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/sx6119/javaupm_sx6119.i b/src/sx6119/javaupm_sx6119.i index 5dece90c..f7e5327d 100644 --- a/src/sx6119/javaupm_sx6119.i +++ b/src/sx6119/javaupm_sx6119.i @@ -7,3 +7,14 @@ %include "sx6119.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_sx6119"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ta12200/javaupm_ta12200.i b/src/ta12200/javaupm_ta12200.i index d0259f79..3feb4688 100644 --- a/src/ta12200/javaupm_ta12200.i +++ b/src/ta12200/javaupm_ta12200.i @@ -6,3 +6,14 @@ %} %include "ta12200.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ta12200"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/tcs3414cs/javaupm_tcs3414cs.i b/src/tcs3414cs/javaupm_tcs3414cs.i index 9bd7960c..61724e1c 100644 --- a/src/tcs3414cs/javaupm_tcs3414cs.i +++ b/src/tcs3414cs/javaupm_tcs3414cs.i @@ -6,3 +6,14 @@ %} %include "tcs3414cs.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_tcs3414cs"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/th02/javaupm_th02.i b/src/th02/javaupm_th02.i index f8c5fa26..d16ae4fa 100644 --- a/src/th02/javaupm_th02.i +++ b/src/th02/javaupm_th02.i @@ -6,3 +6,14 @@ %} %include "th02.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_th02"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/tm1637/javaupm_tm1637.i b/src/tm1637/javaupm_tm1637.i index 24d8c2e4..a0e55467 100644 --- a/src/tm1637/javaupm_tm1637.i +++ b/src/tm1637/javaupm_tm1637.i @@ -16,3 +16,14 @@ %include "tm1637.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_tm1637"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/tsl2561/javaupm_tsl2561.i b/src/tsl2561/javaupm_tsl2561.i index 8186d998..2d542e6f 100644 --- a/src/tsl2561/javaupm_tsl2561.i +++ b/src/tsl2561/javaupm_tsl2561.i @@ -6,3 +6,14 @@ %} %include "tsl2561.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_tsl2561"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ttp223/javaupm_ttp223.i b/src/ttp223/javaupm_ttp223.i index cf7dd90a..a1595ef7 100644 --- a/src/ttp223/javaupm_ttp223.i +++ b/src/ttp223/javaupm_ttp223.i @@ -15,3 +15,14 @@ %} %include "ttp223.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ttp223"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/ublox6/javaupm_ublox6.i b/src/ublox6/javaupm_ublox6.i index 164bd298..c5f0777d 100644 --- a/src/ublox6/javaupm_ublox6.i +++ b/src/ublox6/javaupm_ublox6.i @@ -9,3 +9,14 @@ %include "ublox6.h" speed_t int_B9600 = B9600; + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_ublox6"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/uln200xa/javaupm_uln200xa.i b/src/uln200xa/javaupm_uln200xa.i index 2887ca82..0805ae30 100644 --- a/src/uln200xa/javaupm_uln200xa.i +++ b/src/uln200xa/javaupm_uln200xa.i @@ -6,3 +6,14 @@ %} %include "uln200xa.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_uln200xa"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/urm37/javaupm_urm37.i b/src/urm37/javaupm_urm37.i index f355ce40..725bafec 100644 --- a/src/urm37/javaupm_urm37.i +++ b/src/urm37/javaupm_urm37.i @@ -8,3 +8,14 @@ %include "urm37.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_urm37"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/waterlevel/javaupm_waterlevel.i b/src/waterlevel/javaupm_waterlevel.i index e49e0817..7365c37a 100644 --- a/src/waterlevel/javaupm_waterlevel.i +++ b/src/waterlevel/javaupm_waterlevel.i @@ -6,3 +6,14 @@ %} %include "waterlevel.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_waterlevel"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/wheelencoder/javaupm_wheelencoder.i b/src/wheelencoder/javaupm_wheelencoder.i index 92aae94b..2b29f35e 100644 --- a/src/wheelencoder/javaupm_wheelencoder.i +++ b/src/wheelencoder/javaupm_wheelencoder.i @@ -6,3 +6,14 @@ %} %include "wheelencoder.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_wheelencoder"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/wt5001/javaupm_wt5001.i b/src/wt5001/javaupm_wt5001.i index c95edbd0..fa38c569 100644 --- a/src/wt5001/javaupm_wt5001.i +++ b/src/wt5001/javaupm_wt5001.i @@ -32,3 +32,14 @@ READDATA_EXCEPTION(getCurrentFile()) %include "wt5001.h" speed_t int_B9600 = B9600; + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_wt5001"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/xbee/javaupm_xbee.i b/src/xbee/javaupm_xbee.i index fc9fb3b4..c886424b 100644 --- a/src/xbee/javaupm_xbee.i +++ b/src/xbee/javaupm_xbee.i @@ -9,3 +9,14 @@ %include "xbee.h" %array_class(char, charArray); + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_xbee"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/yg1006/javaupm_yg1006.i b/src/yg1006/javaupm_yg1006.i index 894e8af4..c3b01c42 100644 --- a/src/yg1006/javaupm_yg1006.i +++ b/src/yg1006/javaupm_yg1006.i @@ -6,3 +6,14 @@ %} %include "yg1006.h" + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_yg1006"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file diff --git a/src/zfm20/javaupm_zfm20.i b/src/zfm20/javaupm_zfm20.i index b466dbe0..561ec12a 100644 --- a/src/zfm20/javaupm_zfm20.i +++ b/src/zfm20/javaupm_zfm20.i @@ -15,3 +15,14 @@ %include "zfm20.h" speed_t int_B57600 = B57600; + +%pragma(java) jniclasscode=%{ + static { + try { + System.loadLibrary("javaupm_zfm20"); + } catch (UnsatisfiedLinkError e) { + System.err.println("Native code library failed to load. \n" + e); + System.exit(1); + } + } +%} \ No newline at end of file