javascript: fix swig generation of node.js api
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "maa.h"
|
||||
@@ -116,3 +120,7 @@ int maa_gpio_read(maa_gpio_context *dev);
|
||||
* @return maa result type
|
||||
*/
|
||||
maa_result_t maa_gpio_write(maa_gpio_context *dev, int value);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
@@ -116,3 +120,7 @@ void maa_i2c_address(maa_i2c_context* dev, int address);
|
||||
* @param dev the i2c context
|
||||
*/
|
||||
void maa_i2c_stop(maa_i2c_context* dev);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -30,6 +30,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
MAA_SUCCESS = 0,
|
||||
MAA_ERROR_FEATURE_NOT_IMPLEMENTED = 1,
|
||||
@@ -52,3 +56,7 @@ typedef enum {
|
||||
* @return version string from version.h
|
||||
*/
|
||||
const char* maa_get_version();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
@@ -92,3 +96,7 @@ void maa_pwm_enable(maa_pwm_context* pwm, int enable);
|
||||
/** Close and unexport the PWM pin.
|
||||
*/
|
||||
void maa_pwm_close(maa_pwm_context* pwm);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -14,8 +14,9 @@ include_directories(
|
||||
)
|
||||
|
||||
SET_SOURCE_FILES_PROPERTIES(maajs.i PROPERTIES SWIG_FLAGS "-node")
|
||||
SET_SOURCE_FILES_PROPERTIES(maajs.i PROPERTIES CPLUSPLUS ON)
|
||||
|
||||
SWIG_ADD_MODULE(maajs javascript ${maa_LIB_SRCS})
|
||||
SWIG_ADD_MODULE(maajs javascript maajs.i ${maa_LIB_SRCS})
|
||||
SWIG_LINK_LIBRARIES(maajs ${NODE_LIBRARIES})
|
||||
|
||||
set_target_properties(maajs PROPERTIES
|
||||
|
||||
Reference in New Issue
Block a user