Skip to content

Commit

Permalink
Began to add kovan-serial dbus support
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcdorman committed Jan 27, 2013
1 parent a60abf1 commit 52b76b3
Show file tree
Hide file tree
Showing 40 changed files with 111 additions and 31 deletions.
8 changes: 4 additions & 4 deletions CMakeLists.txt
Expand Up @@ -13,12 +13,12 @@ SET(DEVICES ${botui_SOURCE_DIR}/devices)
SET(KOVAN ${DEVICES}/kovan)
SET(SIMULATOR ${DEVICES}/simulator)

SET(NETWORK_MANAGER ${CMAKE_SOURCE_DIR}/NetworkManager)
SET(DBUS ${CMAKE_SOURCE_DIR}/dbus)

INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/src
${NETWORK_MANAGER}/include
${DBUS}/include
${botui_SOURCE_DIR}
${botui_BINARY_DIR}
${KOVAN}/include
Expand All @@ -32,8 +32,8 @@ SET(QT_USE_QTDBUS TRUE)

INCLUDE(${QT_USE_FILE})

FILE(GLOB INCLUDES ${INCLUDE}/*.h ${KOVAN}/include/*.h ${SIMULATOR}/include/*.h ${NETWORK_MANAGER}/include/*.h)
FILE(GLOB SOURCES ${SRC}/*.cpp ${KOVAN}/src/*.cpp ${SIMULATOR}/src/*.cpp ${NETWORK_MANAGER}/src/*.cpp)
FILE(GLOB INCLUDES ${INCLUDE}/*.h ${KOVAN}/include/*.h ${SIMULATOR}/include/*.h ${DBUS}/include/*.h)
FILE(GLOB SOURCES ${SRC}/*.cpp ${KOVAN}/src/*.cpp ${SIMULATOR}/src/*.cpp ${DBUS}/src/*.cpp)
FILE(GLOB UIS ${UI}/*)

SET(botui_SRCS_CXX ${SOURCES})
Expand Down
21 changes: 12 additions & 9 deletions NetworkManager/generate.sh → dbus/generate.sh
Expand Up @@ -5,32 +5,35 @@ rm -Rf src

generate()
{
qdbusxml2cpp -c NM${1} -p NM${1} -N -i NetworkManagerConnection.h ${2}.xml
qdbusxml2cpp -c ${1} -p ${1} -N -i NetworkManagerConnection.h ${2}.xml
}

echo "Generating NetworkManager class..."
generate NetworkManager nm-manager
generate NMNetworkManager nm-manager

echo "Generating Device class..."
generate Device nm-device
generate NMDevice nm-device

echo "Generating DeviceEthernet class..."
generate DeviceEthernet nm-device-ethernet
generate NMDeviceEthernet nm-device-ethernet

echo "Generating DeviceWifi class..."
generate DeviceWifi nm-device-wifi
generate NMDeviceWifi nm-device-wifi

echo "Generating Settings class..."
generate Settings nm-settings
generate NMSettings nm-settings

echo "Generating SettingsConnection class..."
generate SettingsConnection nm-settings-connection
generate NMSettingsConnection nm-settings-connection

echo "Generating SecretAgent class..."
generate SecretAgent nm-secret-agent
generate NMSecretAgent nm-secret-agent

echo "Generating AccessPoint class..."
generate AccessPoint nm-access-point
generate NMAccessPoint nm-access-point

echo "Generating Serial class..."
generate Serial org.kipr.Serial

mkdir -p src
mkdir -p include
Expand Down
File renamed without changes.
Expand Up @@ -8,8 +8,8 @@
* Do not edit! All changes made to it will be lost.
*/

#ifndef NMACCESSPOINT_H_1353454821
#define NMACCESSPOINT_H_1353454821
#ifndef NMACCESSPOINT_H_1359245779
#define NMACCESSPOINT_H_1359245779

#include <QtCore/QObject>
#include <QtCore/QByteArray>
Expand Down
4 changes: 2 additions & 2 deletions NetworkManager/include/NMDevice.h → dbus/include/NMDevice.h
Expand Up @@ -8,8 +8,8 @@
* Do not edit! All changes made to it will be lost.
*/

#ifndef NMDEVICE_H_1353454821
#define NMDEVICE_H_1353454821
#ifndef NMDEVICE_H_1359245778
#define NMDEVICE_H_1359245778

#include <QtCore/QObject>
#include <QtCore/QByteArray>
Expand Down
Expand Up @@ -8,8 +8,8 @@
* Do not edit! All changes made to it will be lost.
*/

#ifndef NMDEVICEETHERNET_H_1353454821
#define NMDEVICEETHERNET_H_1353454821
#ifndef NMDEVICEETHERNET_H_1359245778
#define NMDEVICEETHERNET_H_1359245778

#include <QtCore/QObject>
#include <QtCore/QByteArray>
Expand Down
Expand Up @@ -8,8 +8,8 @@
* Do not edit! All changes made to it will be lost.
*/

#ifndef NMDEVICEWIFI_H_1353454821
#define NMDEVICEWIFI_H_1353454821
#ifndef NMDEVICEWIFI_H_1359245778
#define NMDEVICEWIFI_H_1359245778

#include <QtCore/QObject>
#include <QtCore/QByteArray>
Expand Down
Expand Up @@ -8,8 +8,8 @@
* Do not edit! All changes made to it will be lost.
*/

#ifndef NMNETWORKMANAGER_H_1353454821
#define NMNETWORKMANAGER_H_1353454821
#ifndef NMNETWORKMANAGER_H_1359245778
#define NMNETWORKMANAGER_H_1359245778

#include <QtCore/QObject>
#include <QtCore/QByteArray>
Expand Down
Expand Up @@ -8,8 +8,8 @@
* Do not edit! All changes made to it will be lost.
*/

#ifndef NMSECRETAGENT_H_1353454821
#define NMSECRETAGENT_H_1353454821
#ifndef NMSECRETAGENT_H_1359245779
#define NMSECRETAGENT_H_1359245779

#include <QtCore/QObject>
#include <QtCore/QByteArray>
Expand Down
Expand Up @@ -8,8 +8,8 @@
* Do not edit! All changes made to it will be lost.
*/

#ifndef NMSETTINGS_H_1353454821
#define NMSETTINGS_H_1353454821
#ifndef NMSETTINGS_H_1359245779
#define NMSETTINGS_H_1359245779

#include <QtCore/QObject>
#include <QtCore/QByteArray>
Expand Down
Expand Up @@ -8,8 +8,8 @@
* Do not edit! All changes made to it will be lost.
*/

#ifndef NMSETTINGSCONNECTION_H_1353454821
#define NMSETTINGSCONNECTION_H_1353454821
#ifndef NMSETTINGSCONNECTION_H_1359245779
#define NMSETTINGSCONNECTION_H_1359245779

#include <QtCore/QObject>
#include <QtCore/QByteArray>
Expand Down
44 changes: 44 additions & 0 deletions dbus/include/Serial.h
@@ -0,0 +1,44 @@
/*
* This file was generated by qdbusxml2cpp version 0.7
* Command line was: qdbusxml2cpp -c Serial -p Serial -N -i NetworkManagerConnection.h org.kipr.Serial.xml
*
* qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
*
* This is an auto-generated file.
* Do not edit! All changes made to it will be lost.
*/

#ifndef SERIAL_H_1359245779
#define SERIAL_H_1359245779

#include <QtCore/QObject>
#include <QtCore/QByteArray>
#include <QtCore/QList>
#include <QtCore/QMap>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QVariant>
#include <QtDBus/QtDBus>
#include "NetworkManagerConnection.h"

/*
* Proxy class for interface org.kipr.Serial
*/
class Serial: public QDBusAbstractInterface
{
Q_OBJECT
public:
static inline const char *staticInterfaceName()
{ return "org.kipr.Serial"; }

public:
Serial(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0);

~Serial();

public Q_SLOTS: // METHODS
Q_SIGNALS: // SIGNALS
void Run(const QString &path);
};

#endif
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 7 additions & 0 deletions dbus/org.kipr.Serial.xml
@@ -0,0 +1,7 @@
<node>
<interface name="org.kipr.Serial">
<signal name="Run">
<arg name="path" type="s" direction="out" />
</signal>
</interface>
</node>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions dbus/src/Serial.cpp
@@ -0,0 +1,26 @@
/*
* This file was generated by qdbusxml2cpp version 0.7
* Command line was: qdbusxml2cpp -c Serial -p Serial -N -i NetworkManagerConnection.h org.kipr.Serial.xml
*
* qdbusxml2cpp is Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
*
* This is an auto-generated file.
* This file may have been hand-edited. Look for HAND-EDIT comments
* before re-generating it.
*/

#include "Serial.h"

/*
* Implementation of interface class Serial
*/

Serial::Serial(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent)
: QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent)
{
}

Serial::~Serial()
{
}

File renamed without changes.
2 changes: 1 addition & 1 deletion devices/kovan/src/KovanDevice.cpp
Expand Up @@ -31,7 +31,7 @@

#include <QDebug>

//#define NOT_A_KOVAN
#define NOT_A_KOVAN

namespace Kovan
{
Expand Down
2 changes: 1 addition & 1 deletion include/Program.h
Expand Up @@ -12,14 +12,14 @@ Q_OBJECT
public:
~Program();

bool start(const QString& path, const QStringList &arguments);
bool isRunning();

QProcess *process() const;

static Program *instance();

public slots:
bool start(const QString& path, const QStringList &arguments = QStringList());
void stop();

signals:
Expand Down

0 comments on commit 52b76b3

Please sign in to comment.