summaryrefslogtreecommitdiff
path: root/plugins/websocket/common.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/websocket/common.h')
-rw-r--r--plugins/websocket/common.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/plugins/websocket/common.h b/plugins/websocket/common.h
new file mode 100644
index 00000000..b246e1bb
--- /dev/null
+++ b/plugins/websocket/common.h
@@ -0,0 +1,44 @@
+#ifndef COMMON_WEBSOCKET_H_
+#define COMMON_WEBSOCKET_H_
+
+#include <QJsonDocument>
+#include <libwebsockets.h>
+#include <memory>
+
+extern bool doBinary;
+
+void cleanJson(QByteArray &json);
+
+// libwebsocket_write helper function
+int lwsWrite(struct libwebsocket *lws, QByteArray d);
+int lwsWriteVariant(struct libwebsocket *lws, QVariant d);
+
+namespace amb
+{
+namespace BasicTypes
+{
+enum BasicTypeEnum
+{
+ UInt16,
+ UInt32,
+ Int16,
+ Int32,
+ String,
+ Double,
+ Boolean
+};
+
+extern const char * UInt16Str;
+extern const char * UInt32Str;
+extern const char * Int16Str;
+extern const char * Int32Str;
+extern const char * StringStr;
+extern const char * DoubleStr;
+extern const char * BooleanStr;
+
+const std::string fromSignature(std::string const & sig);
+
+} // BasicTypes
+} // amb
+
+#endif