@@ -405,8 +405,11 @@ tools_hwsim_SOURCES = tools/hwsim.c src/mpdu.h \
src/storage.h src/storage.c \
src/common.h src/common.c \
src/band.h src/band.c \
- src/crypto.h src/crypto.c
+ src/crypto.h src/crypto.c \
+ src/dbus.h src/dbus.c
+
tools_hwsim_LDADD = $(ell_ldadd)
+tools_hwsim_CFLAGS = -DDBUS_SERVICE=\"net.connman.hwsim\"
if DBUS_POLICY
dist_dbus_data_DATA += tools/hwsim-dbus.conf
@@ -45,6 +45,7 @@
#include "src/crypto.h"
#include "src/nl80211util.h"
#include "src/nl80211cmd.h"
+#include "src/dbus.h"
#define HWSIM_SERVICE "net.connman.hwsim"
@@ -541,27 +542,6 @@ static const char *interface_get_path(const struct interface_info_rec *rec)
return path;
}
-static struct l_dbus_message *dbus_error_failed(struct l_dbus_message *msg)
-{
- return l_dbus_message_new_error(msg, HWSIM_SERVICE ".Failed",
- "Operation failed");
-}
-
-static struct l_dbus_message *dbus_error_invalid_args(
- struct l_dbus_message *msg)
-{
- return l_dbus_message_new_error(msg, HWSIM_SERVICE ".InvalidArgs",
- "Argument type is wrong");
-}
-
-static void dbus_pending_reply(struct l_dbus_message **msg,
- struct l_dbus_message *reply)
-{
- l_dbus_send(dbus, reply);
- l_dbus_message_unref(*msg);
- *msg = NULL;
-}
-
static const char *rule_get_path(struct hwsim_rule *rule)
{
static char path[16];
@@ -2867,6 +2847,8 @@ static bool setup_dbus_hwsim(void)
return false;
}
+ dbus_init(dbus);
+
if (!l_dbus_register_interface(dbus, HWSIM_RADIO_MANAGER_INTERFACE,
setup_radio_manager_interface,
NULL, false)) {