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,9 +20,9 @@ DLL_PUBLIC int takeOff(void);
DLL_PUBLIC int land(void);
// 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);
DLL_PUBLIC void setTargetCoordinates(double latitude, double longitude,
DLL_PUBLIC int setTargetCoordinates(double latitude, double longitude,
float altitude, float speed);
// Information functions
......
......@@ -721,8 +721,7 @@ static JSValue js_loiter(JSContext *ctx, JSValueConst thisVal,
if (JS_ToFloat64(ctx, &speed, argv[4]))
return JS_EXCEPTION;
loiter(latitude, longitude, (float)altitude, (float)radius, (float)speed);
return JS_NewInt32(ctx, 0);
return JS_NewInt32(ctx, loiter(latitude, longitude, (float)altitude, (float)radius, (float)speed));
}
static JSValue js_setTargetCoordinates(JSContext *ctx,
......@@ -743,8 +742,7 @@ static JSValue js_setTargetCoordinates(JSContext *ctx,
if (JS_ToFloat64(ctx, &speed, argv[3]))
return JS_EXCEPTION;
setTargetCoordinates(latitude, longitude, (float)altitude, (float)speed);
return JS_NewInt32(ctx, 0);
return JS_NewInt32(ctx, setTargetCoordinates(latitude, longitude, (float)altitude, (float)speed));
}
// 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