Commit e5e39b54 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼 Committed by Léo-Paul Géneau

Put droneVariableArray in header file

parent f0906899
#ifndef __DRONEDGE_H__
#define __DRONEDGE_H__
#include <open62541/server.h>
#include "pubsub.h"
UA_Float defaultFloat = 0;
UA_Double defaultDouble = 0;
const VariableData droneVariableArray[] = {
{
.name = "latitude",
.description = "Latitude",
.pdefaultValue = &defaultDouble,
.type = UA_TYPES_DOUBLE,
.builtInType = UA_NS0ID_DOUBLE,
},
{
.name = "longitude",
.description = "Longitude",
.pdefaultValue = &defaultDouble,
.type = UA_TYPES_DOUBLE,
.builtInType = UA_NS0ID_DOUBLE,
},
{
.name = "altitude_abs",
.description = "Absolute Altitude (AMSL)",
.pdefaultValue = &defaultFloat,
.type = UA_TYPES_FLOAT,
.builtInType = UA_NS0ID_FLOAT,
},
{
.name = "altitude_rel",
.description = "Relative Altitude",
.pdefaultValue = &defaultFloat,
.type = UA_TYPES_FLOAT,
.builtInType = UA_NS0ID_FLOAT,
},
};
#endif /* __DRONEDGE_H__ */
...@@ -41,4 +41,4 @@ int runPubsub(UA_String *transportProfile, ...@@ -41,4 +41,4 @@ int runPubsub(UA_String *transportProfile,
void (*update)(UA_UInt32 id, const UA_DataValue*), void (*update)(UA_UInt32 id, const UA_DataValue*),
UA_Boolean *running); UA_Boolean *running);
#endif /* __PUBSUB_H__ */ #endif /* __PUBSUB_H__ */
\ No newline at end of file
...@@ -408,4 +408,4 @@ int runPubsub(UA_String *transportProfile, ...@@ -408,4 +408,4 @@ int runPubsub(UA_String *transportProfile,
retval |= UA_Server_run(server, running); retval |= UA_Server_run(server, running);
UA_Server_delete(server); UA_Server_delete(server);
return retval == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE; return retval == UA_STATUSCODE_GOOD ? EXIT_SUCCESS : EXIT_FAILURE;
} }
\ No newline at end of file
#include <quickjs/quickjs.h> #include <quickjs/quickjs.h>
#include "mavsdk_wrapper.h" #include "mavsdk_wrapper.h"
#include "pubsub.h" #include "dronedge.h"
static JSClassID js_drone_class_id; static JSClassID js_drone_class_id;
UA_Float defaultFloat = 0;
UA_Double defaultDouble = 0;
const VariableData droneVariableArray[] = {
{
.name = "latitude",
.description = "Latitude",
.pdefaultValue = &defaultDouble,
.type = UA_TYPES_DOUBLE,
.builtInType = UA_NS0ID_DOUBLE,
},
{
.name = "longitude",
.description = "Longitude",
.pdefaultValue = &defaultDouble,
.type = UA_TYPES_DOUBLE,
.builtInType = UA_NS0ID_DOUBLE,
},
{
.name = "altitude_abs",
.description = "Absolute Altitude (AMSL)",
.pdefaultValue = &defaultFloat,
.type = UA_TYPES_FLOAT,
.builtInType = UA_NS0ID_FLOAT,
},
{
.name = "altitude_rel",
.description = "Relative Altitude",
.pdefaultValue = &defaultFloat,
.type = UA_TYPES_FLOAT,
.builtInType = UA_NS0ID_FLOAT,
},
};
static UA_Boolean pubsub_running = true; static UA_Boolean pubsub_running = true;
int nbDrone; int nbDrone;
......
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