This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-networkmanager/nymea-networkmanager/nymeanetworkmanagerdbusservice.cpp
Michael Zanetti 5a52c00596 Add a dbus interface to trigger the bluetooth server
Also fixes the button config not working at all
2021-03-25 23:47:39 +01:00

28 lines
1021 B
C++

#include "nymeanetworkmanagerdbusservice.h"
#include <QLoggingCategory>
Q_LOGGING_CATEGORY(dcDBus, "DBus");
NymeaNetworkManagerDBusService::NymeaNetworkManagerDBusService(QDBusConnection::BusType busType, QObject *parent) : QObject(parent),
m_connection(busType == QDBusConnection::SystemBus ? QDBusConnection::systemBus() : QDBusConnection::sessionBus())
{
bool status = m_connection.registerService("io.nymea.networkmanager");
if (!status) {
qCWarning(dcDBus()) << "Failed to register D-Bus service.";
return;
}
status = m_connection.registerObject("/io/nymea/networkmanager", "io.nymea.networkmanager", this, QDBusConnection::ExportScriptableSlots);
if (!status) {
qCWarning(dcDBus()) << "Failed to register D-Bus object.";
return;
}
qCDebug(dcDBus()) << "Registered DBus interface";
}
void NymeaNetworkManagerDBusService::enableBluetoothServer()
{
qCDebug(dcDBus()) << "Enable bluetooth server called";
emit enableBluetoothServerCalled();
}