summaryrefslogtreecommitdiff
path: root/plugins/websocket/websocketsink.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/websocket/websocketsink.h')
-rw-r--r--plugins/websocket/websocketsink.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/plugins/websocket/websocketsink.h b/plugins/websocket/websocketsink.h
new file mode 100644
index 00000000..1ddd73b2
--- /dev/null
+++ b/plugins/websocket/websocketsink.h
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 2012 Intel Corporation
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+
+#ifndef WEBSOCKETSINK_H
+#define WEBSOCKETSINK_H
+
+#include <glib.h>
+#include <abstractroutingengine.h>
+#include "abstractsink.h"
+#include <libwebsockets.h>
+
+class WebSocketSink : public AbstractSink
+{
+
+public:
+ WebSocketSink(AbstractRoutingEngine* re, libwebsocket *wsi, string uuid, VehicleProperty::Property property, std::string ambdproperty);
+ ~WebSocketSink();
+ const string uuid() ;
+ void propertyChanged(AbstractPropertyType *value);
+ void supportedChanged(const PropertyList & supportedProperties);
+ PropertyList subscriptions();
+ libwebsocket *socket() { return m_wsi; }
+
+private:
+ char *webSocketBuffer;
+ string m_amdbproperty;
+ AbstractRoutingEngine *m_re;
+ libwebsocket *m_wsi;
+ string m_uuid;
+ string m_property;
+};
+
+#endif // WEBSOCKETSINK_H