Water: Removed grove dependency

* Renamed all files from grovewater to water
    * Replaced all instances of grovewater with water
    * Updated all CMake files

Signed-off-by: Sisinty Sasmita Patra <sisinty.s.patra@intel.com>
This commit is contained in:
Sisinty Sasmita Patra
2016-09-13 15:03:26 -07:00
committed by Noel Eck
parent e9b0deaf75
commit ddab71e896
16 changed files with 54 additions and 54 deletions

View File

@ -1,5 +0,0 @@
set (libname "grovewater")
set (libdescription "upm grove water module")
set (module_src ${libname}.cxx)
set (module_hpp ${libname}.hpp)
upm_module_init()

View File

@ -1,8 +0,0 @@
%module jsupm_grovewater
%include "../upm.i"
%{
#include "grovewater.hpp"
%}
%include "grovewater.hpp"

5
src/water/CMakeLists.txt Normal file
View File

@ -0,0 +1,5 @@
upm_mixed_module_init (NAME water
DESCRIPTION "UPM water sensor module"
CPP_HDR water.hpp
CPP_SRC water.cxx
REQUIRES mraa)

View File

@ -1,16 +1,16 @@
%module javaupm_grovewater
%module javaupm_water
%include "../upm.i"
%{
#include "grovewater.hpp"
#include "water.hpp"
%}
%include "grovewater.hpp"
%include "water.hpp"
%pragma(java) jniclasscode=%{
static {
try {
System.loadLibrary("javaupm_grovewater");
System.loadLibrary("javaupm_water");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
System.exit(1);

8
src/water/jsupm_water.i Normal file
View File

@ -0,0 +1,8 @@
%module jsupm_water
%include "../upm.i"
%{
#include "water.hpp"
%}
%include "water.hpp"

View File

@ -1,11 +1,11 @@
// Include doxygen-generated documentation
%include "pyupm_doxy2swig.i"
%module pyupm_grovewater
%module pyupm_water
%include "../upm.i"
%feature("autodoc", "3");
%include "grovewater.hpp"
%include "water.hpp"
%{
#include "grovewater.hpp"
#include "water.hpp"
%}

View File

@ -26,12 +26,12 @@
#include <string>
#include <stdexcept>
#include "grovewater.hpp"
#include "water.hpp"
using namespace upm;
using namespace std;
GroveWater::GroveWater(int pin)
Water::Water(int pin)
{
if ( !(m_gpio = mraa_gpio_init(pin)) )
{
@ -43,12 +43,12 @@ GroveWater::GroveWater(int pin)
mraa_gpio_dir(m_gpio, MRAA_GPIO_IN);
}
GroveWater::~GroveWater()
Water::~Water()
{
mraa_gpio_close(m_gpio);
}
bool GroveWater::isWet()
bool Water::isWet()
{
return (!mraa_gpio_read(m_gpio) ? true : false);
}

View File

@ -28,39 +28,39 @@
namespace upm {
/**
* @brief Grove Water Sensor library
* @defgroup grovewater libupm-grovewater
* @brief Water Sensor library
* @defgroup water libupm-water
* @ingroup seeed gpio liquid eak
*/
/**
* @library grovewater
* @sensor grovewater
* @comname Grove Water Sensor
* @library water
* @sensor water
* @comname Water Sensor
* @type liquid
* @man seeed
* @con gpio
* @kit eak
*
* @brief API for the Grove Water Sensor
* @brief API for the Water Sensor
*
* UPM module for the Grove Water sensor
* UPM module for the Water sensor
*
* @image html grovewater.jpg
* @snippet grovewater.cxx Interesting
* @image html water.jpg
* @snippet water.cxx Interesting
*/
class GroveWater {
class Water {
public:
/**
* Grove digital water sensor constructor
* digital water sensor constructor
*
* @param pin Digital pin to use
*/
GroveWater(int pin);
Water(int pin);
/**
* GroveWater destructor
* Water destructor
*/
~GroveWater();
~Water();
/**
* Gets the water (wet/not wet) value from the sensor
*