{
"sources" : [ "../plugins/examplesourceplugin.so" ],
- "sinks": [ "../plugins/examplesinkplugin.so", "../plugins/dbus/dbussinkplugin.so" ,"../plugins/tcpsink/tcpsinkplugin.so" ]
+ "sinks": [ "../plugins/examplesinkplugin.so", "../plugins/dbus/dbussinkplugin.so" ,"../plugins/tcpsink/websocketsinkplugin.so" ]
}
add_subdirectory(wheel)
add_subdirectory(dbus)
-add_subdirectory(tcpsink)
\ No newline at end of file
+add_subdirectory(websocketsink)
+++ /dev/null
-
-include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs})
-
-set(tcpsinkplugin_headers tcpsinkplugin.h)
-set(tcpsinkplugin_sources tcpsinkmanager.cpp tcpsinkplugin.cpp)
-add_library(tcpsinkplugin MODULE ${tcpsinkplugin_sources})
-set_target_properties(tcpsinkplugin PROPERTIES PREFIX "")
-target_link_libraries(tcpsinkplugin -lamb -lwebsockets -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries})
\ No newline at end of file
+++ /dev/null
-/*
- <one line to give the library's name and an idea of what it does.>
- Copyright (C) 2012 Michael Carpenter <email>
-
- 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 TCPSINKMANAGER_H
-#define TCPSINKMANAGER_H
-
-#include <abstractroutingengine.h>
-#include <abstractsink.h>
-#include <gio/gio.h>
-#include <libwebsockets.h>
-
-class TcpSinkManager: public AbstractSinkManager
-{
-public:
- TcpSinkManager(AbstractRoutingEngine* engine);
- void addSink(libwebsocket *socket,VehicleProperty::Property property);
-private:
- AbstractRoutingEngine *m_engine;
- struct libwebsocket_protocols protocollist[2];
-};
-
-#endif // TCPSINKMANAGER_H
+++ /dev/null
-/*
- <one line to give the library's name and an idea of what it does.>
- Copyright (C) 2012 Michael Carpenter <email>
-
- 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
-*/
-
-
-#include "tcpsinkplugin.h"
-#include <glib.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-
-
-
-
-TcpSinkPlugin::TcpSinkPlugin(AbstractRoutingEngine* re) : AbstractSink(re)
-{
-
-}
-string TcpSinkPlugin::uuid()
-{
- return "e43f6cad-60e3-4454-9638-01ffa9ab8c8f";
-}
-void TcpSinkPlugin::propertyChanged(VehicleProperty::Property property, boost::any value, string uuid)
-{
-}
-void TcpSinkPlugin::supportedChanged(PropertyList supportedProperties)
-{
-}
-PropertyList TcpSinkPlugin::subscriptions()
-{
- return PropertyList();
-}
-
+++ /dev/null
-/*
- <one line to give the library's name and an idea of what it does.>
- Copyright (C) 2012 Michael Carpenter <email>
-
- 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 TCPSINKPLUGIN_H
-#define TCPSINKPLUGIN_H
-#include <glib.h>
-#include <abstractroutingengine.h>
-#include "abstractsink.h"
-class TcpSinkPlugin : public AbstractSink
-{
-
-public:
- TcpSinkPlugin(AbstractRoutingEngine* re);
- string uuid() ;
- void propertyChanged(VehicleProperty::Property property, boost::any value, string uuid);
- void supportedChanged(PropertyList supportedProperties);
- PropertyList subscriptions();
-
-};
-
-#endif // TCPSINKPLUGIN_H
--- /dev/null
+
+include_directories(${CMAKE_SOURCE_DIR}/lib ${include_dirs})
+
+set(websocketsinkplugin_headers websocketsink.h websocketmanager.h)
+set(websocketsinkplugin_sources websocketsinkmanager.cpp websocketsink.cpp)
+add_library(websocketsinkplugin MODULE ${websocketsinkplugin_sources})
+set_target_properties(websocketsinkplugin PROPERTIES PREFIX "")
+target_link_libraries(websocketsinkplugin -lamb -lwebsockets -L${CMAKE_CURRENT_BINARY_DIR}/lib ${link_libraries})
--- /dev/null
+/*
+ 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
+*/
+
+
+#include "websocketsink.h"
+#include <glib.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <sys/types.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+
+
+
+WebSocketSink::WebSocketSink(AbstractRoutingEngine* re) : AbstractSink(re)
+{
+
+}
+string WebSocketSink::uuid()
+{
+ return "e43f6cad-60e3-4454-9638-01ffa9ab8c8f";
+}
+void WebSocketSink::propertyChanged(VehicleProperty::Property property, boost::any value, string uuid)
+{
+}
+void WebSocketSink::supportedChanged(PropertyList supportedProperties)
+{
+}
+PropertyList WebSocketSink::subscriptions()
+{
+ return PropertyList();
+}
+
--- /dev/null
+/*
+ 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"
+class WebSocketSink : public AbstractSink
+{
+
+public:
+ WebSocketSink(AbstractRoutingEngine* re);
+ string uuid() ;
+ void propertyChanged(VehicleProperty::Property property, boost::any value, string uuid);
+ void supportedChanged(PropertyList supportedProperties);
+ PropertyList subscriptions();
+
+};
+
+#endif // WEBSOCKETSINK_H
/*
- <one line to give the library's name and an idea of what it does.>
- Copyright (C) 2012 Michael Carpenter <email>
+ 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 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.
+ 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
+ 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
*/
-#include "tcpsinkmanager.h"
+#include "websocketsinkmanager.h"
#include <sstream>
#include <json-glib/json-glib.h>
struct pollfd pollfds[100];
int count_pollfds = 0;
libwebsocket_context *context;
-TcpSinkManager *sinkManager;
+WebSocketSinkManager *sinkManager;
static int websocket_callback(struct libwebsocket_context *context,struct libwebsocket *wsi,enum libwebsocket_callback_reasons reason, void *user,void *in, size_t len);
bool gioPollingFunc(GIOChannel *source,GIOCondition condition,gpointer data);
-TcpSinkManager::TcpSinkManager(AbstractRoutingEngine* engine):AbstractSinkManager(engine)
+WebSocketSinkManager::WebSocketSinkManager(AbstractRoutingEngine* engine):AbstractSinkManager(engine)
{
m_engine = engine;
//Create a listening socket on port 23000 on localhost.
context = libwebsocket_create_context(port, interface, protocollist,libwebsocket_internal_extensions,ssl_cert_path, ssl_key_path, -1, -1, options);
}
-void TcpSinkManager::addSink(libwebsocket* socket, VehicleProperty::Property property)
+void WebSocketSinkManager::addSink(libwebsocket* socket, VehicleProperty::Property property)
{
AsyncPropertyRequest velocityRequest;
velocityRequest.property = VehicleProperty::VehicleSpeed;
extern "C" AbstractSinkManager * create(AbstractRoutingEngine* routingengine)
{
- sinkManager = new TcpSinkManager(routingengine);
+ sinkManager = new WebSocketSinkManager(routingengine);
return sinkManager;
}
static int websocket_callback(struct libwebsocket_context *context,struct libwebsocket *wsi,enum libwebsocket_callback_reasons reason, void *user,void *in, size_t len)
--- /dev/null
+/*
+ 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 WEBSOCKETSINKMANAGER_H
+#define WEBSOCKETSINKMANAGER_H
+
+#include <abstractroutingengine.h>
+#include <abstractsink.h>
+#include <gio/gio.h>
+#include <libwebsockets.h>
+
+class WebSocketSinkManager: public AbstractSinkManager
+{
+public:
+ WebSocketSinkManager(AbstractRoutingEngine* engine);
+ void addSink(libwebsocket *socket,VehicleProperty::Property property);
+private:
+ AbstractRoutingEngine *m_engine;
+ struct libwebsocket_protocols protocollist[2];
+};
+
+#endif // WEBSOCKETSINKMANAGER_H