summaryrefslogtreecommitdiffstats
path: root/hcid/dbus-manager.c
diff options
context:
space:
mode:
Diffstat (limited to 'hcid/dbus-manager.c')
-rw-r--r--hcid/dbus-manager.c33
1 files changed, 26 insertions, 7 deletions
diff --git a/hcid/dbus-manager.c b/hcid/dbus-manager.c
index f7eda064..8af432a9 100644
--- a/hcid/dbus-manager.c
+++ b/hcid/dbus-manager.c
@@ -48,6 +48,7 @@
#include "dbus-security.h"
#include "dbus-service.h"
#include "dbus-manager.h"
+#include "dbus-hci.h"
#include "sdp-xml.h"
static int default_adapter_id = -1;
@@ -203,6 +204,9 @@ static DBusHandlerResult list_services(DBusConnection *conn,
DBusMessageIter iter;
DBusMessageIter array_iter;
+ if (!hcid_dbus_use_experimental())
+ return error_unknown_method(conn, msg);
+
if (!dbus_message_has_signature(msg, DBUS_TYPE_INVALID_AS_STRING))
return error_invalid_arguments(conn, msg);
@@ -265,6 +269,9 @@ static DBusHandlerResult register_service(DBusConnection *conn,
DBusMessage *message;
int err;
+ if (!hcid_dbus_use_experimental())
+ return error_unknown_method(conn, msg);
+
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &path,
DBUS_TYPE_STRING, &name,
@@ -333,6 +340,9 @@ static DBusHandlerResult unregister_service(DBusConnection *conn,
const char *path;
int err;
+ if (!hcid_dbus_use_experimental())
+ return error_unknown_method(conn, msg);
+
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &path,
DBUS_TYPE_INVALID))
@@ -391,6 +401,9 @@ static DBusHandlerResult add_service_record(DBusConnection *conn,
const char *path;
int err;
+ if (!hcid_dbus_use_experimental())
+ return error_unknown_method(conn, msg);
+
/* Check if it is an array of bytes */
if (strcmp(dbus_message_get_signature(msg), "say"))
return error_invalid_arguments(conn, msg);
@@ -467,6 +480,9 @@ static DBusHandlerResult add_service_record_xml(DBusConnection *conn,
const char *record;
int err;
+ if (!hcid_dbus_use_experimental())
+ return error_unknown_method(conn, msg);
+
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &path,
DBUS_TYPE_STRING, &record,
@@ -564,6 +580,9 @@ static DBusHandlerResult remove_service_record(DBusConnection *conn,
const char *path;
uint32_t handle;
+ if (!hcid_dbus_use_experimental())
+ return error_unknown_method(conn, msg);
+
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &path,
DBUS_TYPE_UINT32, &handle,
@@ -605,13 +624,13 @@ static DBusHandlerResult remove_service_record(DBusConnection *conn,
}
static struct service_data methods[] = {
- { "InterfaceVersion", interface_version },
- { "DefaultAdapter", default_adapter },
- { "FindAdapter", find_adapter },
- { "ListAdapters", list_adapters },
- { "ListServices", list_services },
- { "RegisterService", register_service },
- { "UnregisterService", unregister_service },
+ { "InterfaceVersion", interface_version },
+ { "DefaultAdapter", default_adapter },
+ { "FindAdapter", find_adapter },
+ { "ListAdapters", list_adapters },
+ { "ListServices", list_services },
+ { "RegisterService", register_service },
+ { "UnregisterService", unregister_service },
{ "AddServiceRecord", add_service_record },
{ "AddServiceRecordFromXML", add_service_record_xml },
{ "RemoveServiceRecord", remove_service_record },