"sources" : [
{
- "name" : "ExampleSouce",
- "path" : "/usr/lib/automotive-message-broker/examplesourceplugin.so"
+ "name" : "Database",
+ "path" : "/usr/lib/automotive-message-broker/databasesinkplugin.so",
+ "properties" : "{ 'properties' : ['VehicleSpeed','EngineSpeed'] }"
}
],
"sinks": [
{
- "name" : "Database",
- "path" : "/usr/lib/automotive-message-broker/databasesinkplugin.so",
- "properties" : "{ 'properties' : ['VehicleSpeed','EngineSpeed'] }"
- },
- {
"name" : "Bluemonkey Sink",
"path" : "/usr/lib/automotive-message-broker/bluemonkeyplugin.so"
}
--- /dev/null
+var address = "chat.freenode.com"
+var port = 8001
+var proxy = ""
+var username = ""
+var nick = ""
+var pass = ""
+
+
+function ircConnecting() {
+ print("connecting to irc");
+}
+
+function ircConnected() {
+ print("connected");
+ for(var i=0;i<irc.channels.length;i++)
+ {
+ irc.join(irc.channels[i]);
+ }
+}
+
+
+irc.channels = ["#bluemonkey","#linuxice"]
+irc.connected.connect(ircConnected);
+irc.connecting.connect(ircConnecting);
+
+irc.connect(address,port,proxy,username,nick,pass);
BluemonkeySink::BluemonkeySink(AbstractRoutingEngine* e, map<string, string> config): QObject(0), AbstractSink(e, config), engine(nullptr)
{
irc = new IrcCommunication(this);
- irc->connect("chat.freenode.com",8001,"","tripzero","bluemonkey","");
- connect(irc,&IrcCommunication::connected, [&]() {
- irc->join("#linuxice");
- irc->join("#bluemonkey");
- });
reloadEngine();
#include <QFile>
#include <QNetworkProxy>
#include <QTimer>
+#include <QScriptEngine>
#define foreach Q_FOREACH
QObject::connect(session,SIGNAL(connecting()),this,SIGNAL(connecting()));
QObject::connect(session,SIGNAL(messageReceived(IrcMessage*)),this,SLOT(messageReceived(IrcMessage*)));
+ QScriptEngine *engine = new QScriptEngine(this);
+
+ QScriptValue eventEngineValue = engine->newQObject(this);
+ engine->globalObject().setProperty("irc", eventEngineValue);
+
+ QString str = "ircSettings.js";
+
+ QFile file(str);
+ if(!file.open(QIODevice::ReadOnly))
+ {
+ qDebug()<<"failed to open config file: "<<str;
+ return;
+ }
+
+ QString script = file.readAll();
+
+ file.close();
+
+ engine->evaluate(script);
+
}
void IrcCommunication::announce(QString s)
install (TARGETS dbussinkplugin LIBRARY DESTINATION lib${LIB_SUFFIX}/automotive-message-broker)
install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/amb.conf DESTINATION /etc/dbus-1/system.d )
-add_custom_target(idl COMMAND c++2idl ${dbussinkplugin_headers} > ${CMAKE_CURRENT_SOURCE_DIR}/amb.idl WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+#add_custom_target(idl COMMAND c++2idl ${dbussinkplugin_headers} > ${CMAKE_CURRENT_SOURCE_DIR}/amb.idl WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_subdirectory(amb-qt)