upm/examples/java/CMakeLists.txt

224 lines
7.9 KiB
CMake
Raw Permalink Normal View History

find_package(Java REQUIRED)
include(UseJava)
macro(add_example example_name jar_name)
set(example_src "${example_name}.java")
set(example_jar "${CMAKE_CURRENT_BINARY_DIR}/../../src/${jar_name}/upm_${jar_name}.jar")
add_jar(${example_name} SOURCES ${example_src} INCLUDE_JARS ${example_jar})
add_dependencies(${example_name} javaupm_${jar_name})
endmacro()
macro(add_example_with_path example_name jar_path jar_name)
set(example_src "${example_name}.java")
set(example_jar "${CMAKE_CURRENT_BINARY_DIR}/../../src/${jar_path}/upm_${jar_name}.jar")
add_jar(${example_name} SOURCES ${example_src} INCLUDE_JARS ${example_jar})
add_dependencies(${example_name} javaupm_${jar_name})
endmacro()
macro(add_example_multiple_jars example_name example_jar_name jar_name_list)
set(example_src "${example_name}.java")
set(list_of_jars "")
foreach(jar_name ${jar_name_list})
set(example_jar "${CMAKE_CURRENT_BINARY_DIR}/../../src/${jar_name}/upm_${jar_name}.jar")
list(APPEND list_of_jars ${example_jar})
endforeach()
add_jar(${example_name} SOURCES ${example_src} INCLUDE_JARS ${list_of_jars})
add_dependencies(${example_name} javaupm_${example_jar_name})
endmacro()
add_example(A110X_intrSample a110x)
add_example(A110XSample a110x)
add_example(ADC121C021Sample adc121c021)
add_example(Adxl345Sample adxl345)
add_example(Apds9002 apds9002)
add_example(BISS0001Sample biss0001)
add_example_multiple_jars(BMPX8XSample bmpx8x "bmpx8x;interfaces")
add_example(BuzzerSample buzzer)
add_example(CJQ4435Sample cjq4435)
add_example(DS1307Sample ds1307)
add_example(ENC03RSample enc03r)
add_example(ES08ASample servo)
add_example(ButtonSample button)
add_example(GroveButtonSample grove)
add_example(Button_intrSample button)
add_example(GroveButton_intrSample grove)
add_example(Collision collision)
add_example(EHRSample ehr)
add_example(GroveEHRSample groveehr)
add_example(Emg emg)
add_example(GroveEmg groveemg)
add_example(Gsr gsr)
add_example(GroveGsr grovegsr)
add_example(LEDSample led)
add_example(LightSample light)
add_example(GroveLightSample grove)
add_example(GroveLineFinderSample grovelinefinder)
add_example(LineFinderSample linefinder)
add_example(GroveLed_multiSample grove)
add_example(GroveLEDSample grove)
add_example(GroveMDSample grovemd)
add_example(MDSample md)
add_example(MoistureSample moisture)
add_example(GroveMoistureSample grovemoisture)
add_example(GroveMQ3 gas)
add_example(GroveMQ9 gas)
add_example(O2Example o2)
add_example(GroveO2Example groveo2)
add_example(GroveQTouch at42qt1070)
add_example(RelaySample relay)
add_example(GroveRelaySample grove)
add_example(RotarySample rotary)
add_example(GroveRotarySample grove)
add_example(GROVESCAMSample grovescam)
add_example(SCAMSample scam)
add_example(SlideSample slide)
add_example(GroveSlideSample grove)
add_example(SpeakerSample speaker)
add_example(GroveSpeakerSample grovespeaker)
add_example(TemperatureSample temperature)
add_example(GroveTempSample grove)
add_example(VDivSample vdiv)
add_example(GroveVDivSample grovevdiv)
add_example(WaterSample water)
add_example(GroveWaterSample grovewater)
add_example(GroveWFSSample grovewfs)
add_example(WFSSample wfs)
add_example(GUVAS12DSample guvas12d)
add_example(H3LIS331DLSample h3lis331dl)
add_example(HCSR04Sample hcsr04)
add_example(HM11Sample hm11)
add_example(Hmc5883lSample hmc5883l)
add_example(HMTRPSample hmtrp)
add_example(HP20xExample hp20x)
add_example(HTU21DSample htu21d)
add_example(Itg3200Sample itg3200)
add_example(Joystick12Sample joystick12)
add_example(LDT0028Sample ldt0028)
add_example(LoLSample lol)
add_example(LSM303DLHSample lsm303dlh)
add_example(M24LR64ESample m24lr64e)
add_example(MAX44000Sample max44000)
add_example(MHZ16Sample mhz16)
add_example(MicrophoneSample mic)
add_example(MMA7455Sample mma7455)
add_example(MMA7660Sample mma7660)
add_example(MPL3115A2Sample mpl3115a2)
add_example(MPR121Sample mpr121)
add_example(MPU9150Sample mpu9150)
add_example(MQ2Sample gas)
add_example(MQ303ASample mq303a)
add_example(MQ5Sample gas)
add_example(GroveLEDBar my9221)
add_example(NRF24L01_receiverSample nrf24l01)
add_example(NRF24L01_transmitterSample nrf24l01)
add_example(NUNCHUCKSample nunchuck)
add_example(OTP538USample otp538u)
add_example(PPD42NSSample ppd42ns)
add_example(PulsensorSample pulsensor)
add_example(RFR359FSample rfr359f)
add_example(RotaryEncoderSample rotaryencoder)
add_example(RPR220_intrSample rpr220)
add_example(RPR220Sample rpr220)
add_example(ST7735Sample st7735)
if (NOT ANDROID)
add_example(StepMotorSample stepmotor)
endif ()
add_example(TM1637Sample tm1637)
add_example(TP401Sample gas)
add_example(TSL2561Sample tsl2561)
add_example(TTP223Sample ttp223)
add_example(ULN200XASample uln200xa)
add_example(WaterLevelSensor waterlevel)
add_example(WT5001Sample wt5001)
add_example(YG1006Sample yg1006)
add_example(ZFM20Sample zfm20)
add_example(Ad8232Example ad8232)
add_example(Gp2y0aExample gp2y0a)
add_example(Th02Example th02)
add_example(FlexSensorExample flex)
add_example(CWLSXXA_Example cwlsxxa)
add_example(TEAMS_Example teams)
add_example(APA102Sample apa102)
add_example(TEX00_Example tex00)
add_example(BMI160_Example bmi160)
add_example(Tsl2561 tsl2561)
add_example(AM2315Example am2315)
add_example(MAX31855Example max31855)
add_example(MAX5487Example max5487)
add_example(MAXds3231mExample maxds3231m)
add_example(ECS1030Example ecs1030)
add_example(SM130Example sm130)
if (MODBUS_FOUND)
add_example(H803X_Example h803x)
endif()
e50hx: Initial implementation This driver requires the UPM BACNETMSTP driver (PR #385) to be merged first. This module implements support for the Veris E50H2 and E50H5 BACnet Energy Meters. From the datasheet: The E50H5 BACnet MS/TP DIN Rail Meter with Data Logging combines exceptional performance and easy installation to deliver a cost-effective solution for power monitoring applications. Native serial communication via BACnet MS/TP provides complete accessibility of all measurements to your Building Automation System. The data logging capability protects data in the event of a power failure. The E50H5 can be easily installed on standard DIN rail, surface mounted or contained in an optional NEMA 4 enclosure, as needed. The front-panel LCD display makes device installation and setup easy and provides local access to the full set of detailed measurements. This module was developed using the upm::BACNETMSTP module, based on libbacnet-stack 0.8.3. Both libbacnet 0.8.3 and the upm::BACNETMSTP libraries must be present in order to build this module. This driver was developed on the E50H5. The Trend Log functionality is not currently supported. The Binary Input Objects are also not supported as these are only used for the Alarm bits which are already available from Analog Input Object 52 as an alarm bitfield incorporating all of the supported alarm indicators. It was connected using an RS232->RS485 interface. You cannot use the built in MCU TTL UART pins for accessing this device -- you must use a full Serial RS232->RS485 or USB-RS485 interface connected via USB. Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-04-01 17:29:48 -06:00
if (BACNET_FOUND)
add_example(E50HX_Example e50hx)
add_example(T8100_Example t8100)
add_example(TB7300_Example tb7300)
e50hx: Initial implementation This driver requires the UPM BACNETMSTP driver (PR #385) to be merged first. This module implements support for the Veris E50H2 and E50H5 BACnet Energy Meters. From the datasheet: The E50H5 BACnet MS/TP DIN Rail Meter with Data Logging combines exceptional performance and easy installation to deliver a cost-effective solution for power monitoring applications. Native serial communication via BACnet MS/TP provides complete accessibility of all measurements to your Building Automation System. The data logging capability protects data in the event of a power failure. The E50H5 can be easily installed on standard DIN rail, surface mounted or contained in an optional NEMA 4 enclosure, as needed. The front-panel LCD display makes device installation and setup easy and provides local access to the full set of detailed measurements. This module was developed using the upm::BACNETMSTP module, based on libbacnet-stack 0.8.3. Both libbacnet 0.8.3 and the upm::BACNETMSTP libraries must be present in order to build this module. This driver was developed on the E50H5. The Trend Log functionality is not currently supported. The Binary Input Objects are also not supported as these are only used for the Alarm bits which are already available from Analog Input Object 52 as an alarm bitfield incorporating all of the supported alarm indicators. It was connected using an RS232->RS485 interface. You cannot use the built in MCU TTL UART pins for accessing this device -- you must use a full Serial RS232->RS485 or USB-RS485 interface connected via USB. Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
2016-04-01 17:29:48 -06:00
endif()
if (JPEG_FOUND)
add_example(VCAP_Example vcap)
endif()
add_example_multiple_jars(BMP280_Example bmp280 "bmp280;interfaces")
add_example(BNO055_Example bno055)
add_example(BMX055_Example bmx055)
add_example(NMEAGPS_Example nmea_gps)
add_example(MMA7361_Example mma7361)
add_example(BH1750_Example bh1750)
add_example(HKA5_Example hka5)
add_example(DFRORP_Example dfrorp)
add_example(DFREC_Example dfrec)
add_example(SHT1X_Example sht1x)
add_example(MS5803_Example ms5803)
add_example(ECEZO_Example ecezo)
add_example(IMS_Example ims)
add_example(MB704X_Example mb704x)
add_example(MCP2515_Example mcp2515)
add_example_multiple_jars(Ads1015Sample ads1x15 "ads1x15;interfaces")
add_example(MAX30100_Example max30100)
add_example(Ads1115Sample ads1x15)
add_example(SensorTemplateSample sensortemplate)
add_example(P9813Sample p9813)
add_example(BMG160_Example bmg160)
add_example(BMA250E_Example bma250e)
add_example(BMM150_Example bmm150)
add_example(LSM303AGR_Example lsm303agr)
add_example(LSM303D_Example lsm303d)
add_example(VEML6070Sample veml6070)
add_example(RN2903_Example rn2903)
add_example(LIS2DS12_Example lis2ds12)
add_example(LSM6DS3H_Example lsm6ds3h)
add_example(LSM6DSL_Example lsm6dsl)
add_example_with_path(Jhd1313m1_lcdSample jhd1313m1 jhd1313m1)
add_example_with_path(Jhd1313m1Sample jhd1313m1 jhd1313m1)
add_example_with_path(Lcm1602_i2cSample lcm1602 lcm1602)
add_example_with_path(Lcm1602_parallelSample lcm1602 lcm1602)
add_example_with_path(SSD1308_oledSample lcd i2clcd)
add_example_with_path(SSD1327_oledSample lcd i2clcd)
add_example_multiple_jars(BME280_Example bmp280 "bmp280;interfaces")
SWIG_JAVA: C++ Interfaces to Java interfaces, Modified one Java Example This commit translates C++ interfaces to Java interfaces, previously C++ Interfaces implemented java classes. * Added java swig interface files for all C++ interfaces to simplify swig javaupm_iADC.i javaupm_iCO2Sensor.i javaupm_iHumiditySensor.i javaupm_iLightController.i javaupm_iLightSensor.i javaupm_iModuleStatus.i javaupm_interfaces.i javaupm_iPressureSensor.i javaupm_iTemperatureSensor.i <example Usage> %include"../interfaces/javaupm_iADC.i" * Modified swig interface files for few sensors that implements interfaces ads1x15 bmp280 bmpx8x ds1808lc hlg150h lp8860 max44009 ms5611 si1132 si7005 t6713 * Removed few methods that were mentioned Protected and made them public, so that menthods can be overridden * Made IModuleStatus virtual to avoid ambiguity in multiple inheritance For example class A {}; class B : public A {}; class C : public A {}; class D : public B, public C {}; This can be solved as class A {}; class B : virtual public A {}; class C : virtual public A {}; class D : public B, public C {}; * Modified java interface files to support multiple swig versions * Modified javaupm interface file to support standard auto load library code * Fixed autoloadlibrary tests for interfaces * Created one interface example separately <BME280_InterfaceExample.java>, <example Usage> BME280_InterfaceExample.java since we cann't define swig versions inside java example file. So, instaed added swig versions in Cmake. <example Usage> if (SWIG_VERSION VERSION_GREATER 3.0.8) add_example_with_path(BME280_InterfaceExample bmp280 bmp280) endif() Signed-off-by: sisinty sasmita patra <sisinty.s.patra@intel.com>
2017-02-06 14:59:00 -08:00
if(SWIG_VERSION VERSION_GREATER 3.0.8)
add_example_multiple_jars(BME280_InterfaceExample bmp280 "bmp280;interfaces")
SWIG_JAVA: C++ Interfaces to Java interfaces, Modified one Java Example This commit translates C++ interfaces to Java interfaces, previously C++ Interfaces implemented java classes. * Added java swig interface files for all C++ interfaces to simplify swig javaupm_iADC.i javaupm_iCO2Sensor.i javaupm_iHumiditySensor.i javaupm_iLightController.i javaupm_iLightSensor.i javaupm_iModuleStatus.i javaupm_interfaces.i javaupm_iPressureSensor.i javaupm_iTemperatureSensor.i <example Usage> %include"../interfaces/javaupm_iADC.i" * Modified swig interface files for few sensors that implements interfaces ads1x15 bmp280 bmpx8x ds1808lc hlg150h lp8860 max44009 ms5611 si1132 si7005 t6713 * Removed few methods that were mentioned Protected and made them public, so that menthods can be overridden * Made IModuleStatus virtual to avoid ambiguity in multiple inheritance For example class A {}; class B : public A {}; class C : public A {}; class D : public B, public C {}; This can be solved as class A {}; class B : virtual public A {}; class C : virtual public A {}; class D : public B, public C {}; * Modified java interface files to support multiple swig versions * Modified javaupm interface file to support standard auto load library code * Fixed autoloadlibrary tests for interfaces * Created one interface example separately <BME280_InterfaceExample.java>, <example Usage> BME280_InterfaceExample.java since we cann't define swig versions inside java example file. So, instaed added swig versions in Cmake. <example Usage> if (SWIG_VERSION VERSION_GREATER 3.0.8) add_example_with_path(BME280_InterfaceExample bmp280 bmp280) endif() Signed-off-by: sisinty sasmita patra <sisinty.s.patra@intel.com>
2017-02-06 14:59:00 -08:00
endif()
add_example_with_path(BMC150_Example bmx055 bmx055)
add_example_with_path(BMI055_Example bmx055 bmx055)
ozw: Rework and add some device specific drivers and examples. This commit reworks ozw somewhat and adds some device specific drivers with examples. All of these drivers are kept in the UPM ozw library. The OZW class has been reworked to make it a proper singleton, since the OpenZWave::Manager() it depends on is already a singleton. This avoids issues such as opening and initializing OpenZWave multiple times. A new, relatively thin base class, ozwInterface is also now present. This class wraps some basic functionality, and handles initialization of the OZW base class. It is intended to be inherited by device driver classes. It operates on a node id for a device. Each OZW device is referenced by a node id, which does not change unless the device is removed (and possibly re-added) to a Z-Wave network. Finally, a series of device specific drivers have been implemented. These provide basic functionality to monitor and in some cases control the operation of a Z-Wave device. They are the following: ozwdump - This is a fake 'device' driver that initializes an OZW network and dumps information on all of the nodes (devices) present. Along with each node, available information on each valueid associated with that node is also printed. This fake device and it's examples replace the original ozw example. aeotecss6 - Aeotec Smart Switch 6. This device allows control of the switch, as well as reporting of information the switch makes available, such as current consumption, volts, watts, and accumulated energy use (kWh). aeotecsdg2 - Aeotec Smart Dimmer Gen 2. This device is similar to the Smart Switch 6, but also provides dimming functionality. It also provides information on energy use. aeotecdw2e - Aeotec Door/Window Sensor 2nd Edition. This device is a magnetic switch with an embedded tamper switch used to detect the opening/closing of windows and doors. This is a battery powered device. aeotecdsb09104 - Aeotec Home Energy Monitor. This device is intended to be installed at the MAINS or Breaker box. It reports current and cumulative energy consumption. tzemt400 - Trane TZEMT400 Thermostat. This device is a thermostat with Z-Wave functionality. The variant tested was the TZEMT400BB32MAA. The driver reports various information on the status of the thermostat, as well as the current measured temperature. Signed-off-by: Jon Trulson <jtrulson@ics.com>
2016-07-06 13:25:39 -06:00
if (OPENZWAVE_FOUND)
add_example_with_path(AeotecSS6_Example ozw ozw)
add_example_with_path(AeotecSDG2_Example ozw ozw)
add_example_with_path(AeotecDW2E_Example ozw ozw)
add_example_with_path(AeotecDSB09104_Example ozw ozw)
add_example_with_path(TZEMT400_Example ozw ozw)
endif()
add_example_with_path(NMEAGPS_I2C_Example nmea_gps nmea_gps)
add_example_with_path(MCP2515_TXRX_Example mcp2515 mcp2515)
add_example_with_path(LE910_Example uartat uartat)
add_example_with_path(SpeakerPWMSample speaker speaker)
add_example_with_path(RN2903_P2P_RX_Example rn2903 rn2903)
add_example_with_path(RN2903_P2P_TX_Example rn2903 rn2903)