Commit 1a387ecc authored by Léo-Paul Géneau's avatar Léo-Paul Géneau 👾

Add return value for setTargetCoordinates and loiter

parent f7fde3a4
...@@ -20,10 +20,10 @@ DLL_PUBLIC int takeOff(void); ...@@ -20,10 +20,10 @@ DLL_PUBLIC int takeOff(void);
DLL_PUBLIC int land(void); DLL_PUBLIC int land(void);
// Flight management functions // Flight management functions
DLL_PUBLIC void loiter(double latitude, double longitude, float altitude, DLL_PUBLIC int loiter(double latitude, double longitude, float altitude,
float radius, float speed); float radius, float speed);
DLL_PUBLIC void setTargetCoordinates(double latitude, double longitude, DLL_PUBLIC int setTargetCoordinates(double latitude, double longitude,
float altitude, float speed); float altitude, float speed);
// Information functions // Information functions
DLL_PUBLIC float getAltitude(void); DLL_PUBLIC float getAltitude(void);
......
...@@ -721,8 +721,7 @@ static JSValue js_loiter(JSContext *ctx, JSValueConst thisVal, ...@@ -721,8 +721,7 @@ static JSValue js_loiter(JSContext *ctx, JSValueConst thisVal,
if (JS_ToFloat64(ctx, &speed, argv[4])) if (JS_ToFloat64(ctx, &speed, argv[4]))
return JS_EXCEPTION; return JS_EXCEPTION;
loiter(latitude, longitude, (float)altitude, (float)radius, (float)speed); return JS_NewInt32(ctx, loiter(latitude, longitude, (float)altitude, (float)radius, (float)speed));
return JS_NewInt32(ctx, 0);
} }
static JSValue js_setTargetCoordinates(JSContext *ctx, static JSValue js_setTargetCoordinates(JSContext *ctx,
...@@ -743,8 +742,7 @@ static JSValue js_setTargetCoordinates(JSContext *ctx, ...@@ -743,8 +742,7 @@ static JSValue js_setTargetCoordinates(JSContext *ctx,
if (JS_ToFloat64(ctx, &speed, argv[3])) if (JS_ToFloat64(ctx, &speed, argv[3]))
return JS_EXCEPTION; return JS_EXCEPTION;
setTargetCoordinates(latitude, longitude, (float)altitude, (float)speed); return JS_NewInt32(ctx, setTargetCoordinates(latitude, longitude, (float)altitude, (float)speed));
return JS_NewInt32(ctx, 0);
} }
// Information functions // Information functions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment