NPM package now only builds x86 builds, but for npm those are the only ones
that have ever worked due to a rework of the cmake code generating the
binding.gyp file is required
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Previously anything passed to an I2c::write() or Spi::write() function in
node.js that wasn't a node::Buffer or an object would likely cause a segfault
later on during future calls. This change calls node::Buffer::HasInstance(obj)
to make sure the buffer is valid prior to grabbing it's data
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
These files are required when building docs for python but are never used for
the node.js module
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
Note that if you compile a 0.12.x version it'll still have 0.10.x as a min req
but will likely not work with a 0.10.x interpreter
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
SWIG's preprocessor will not handle the SWIG_V8_VERSION these will go in the
wrapper code so that someone compiling with npm will use his version of node
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This introduces FindNodes.cmake which finds the v8 version and the nodejs
interp version and passes the information to SWIG via SWIG_V8_VERSION
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This requires setting #define SWIG_V8_VERSION 0x032873 in the
mraajsJAVASCRIPT_wrap.cxx file. Note most v8 APIs now require v8::Isolate and
v8::Persistent is no longer a v8::Handle so the gpio.hpp for ISR support is
also modified by this change
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit adds isr support to node.js mraa module, it also forces
SWIGJAVASCRIPT to be set at compile time by cmake (SWIG uses SWIGJAVASCRIPT and
not SWIGNODE in it's preprocessor). This uses libuv uv_queue_work to call v8isr
and is all done at a C++ level unlike the python isr, so this reuses the
mraa_gpio_isr call. This closes#110
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This change also changes the C++ API write(char) call to writeByte(uint8_t) and
the write() call now takes a uint8_t* instead of a char*. This should not alter
any code significantly and does not affect the C API.
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit adds all the infrastructure necessary for doing node-gyp builds of
mraa. Note this will only build the mraa js bindings and will dirty your git
tree whilst doing it. It also assumes the user does not have SWIG installed on
their machines and so the swig wrapper is static. The target to use this
feature is 'npmpkg'.
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
* Removed all C++ code and renamed all .cxx extensions to .c
* All functions are renamed to maa_ and modules are for example called maa_pwm
* Cmake can now 'make doc' using a Doxyfile.in to create documentation
* examples/ have been updated but swig generated API is untested
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
* API headers moved to api/
* smbus file added from libi2c and kernel i2c header cleaned up
* fix compilation of swig and use i2c.h header
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>