From: Chan-yeol Park <[email protected]>
BlueZ supports only Media API. So option handler's are useless.
---
audio/audio.conf | 2 +-
audio/manager.c | 12 ++----------
audio/manager.h | 2 --
3 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/audio/audio.conf b/audio/audio.conf
index 662647c..d1c57d3 100644
--- a/audio/audio.conf
+++ b/audio/audio.conf
@@ -8,7 +8,7 @@
#Master=true
# If we want to disable support for specific services
-# Defaults to supporting the services: HFP, Headset, Sink, Control and Media
+# Defaults to supporting the services: HFP, Headset, Sink, Control
#Disable=Gateway,Source
# SCO routing. Either PCM or HCI (in which case audio is routed to/from ALSA)
diff --git a/audio/manager.c b/audio/manager.c
index 999124d..6411707 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -112,7 +112,6 @@ static struct enabled_interfaces enabled = {
.sink = TRUE,
.source = FALSE,
.control = TRUE,
- .media = TRUE,
};
static struct audio_adapter *find_adapter(GSList *list,
@@ -1180,9 +1179,6 @@ int audio_manager_init(DBusConnection *conn, GKeyFile *conf,
enabled.source = TRUE;
else if (g_str_equal(list[i], "Control"))
enabled.control = TRUE;
- else if (g_str_equal(list[i], "Media"))
- enabled.media = TRUE;
-
}
g_strfreev(list);
@@ -1199,8 +1195,6 @@ int audio_manager_init(DBusConnection *conn, GKeyFile *conf,
enabled.source = FALSE;
else if (g_str_equal(list[i], "Control"))
enabled.control = FALSE;
- else if (g_str_equal(list[i], "Media"))
- enabled.media = FALSE;
}
g_strfreev(list);
@@ -1231,8 +1225,7 @@ proceed:
if (enabled.control)
btd_register_adapter_driver(&avrcp_server_driver);
- if (enabled.media)
- btd_register_adapter_driver(&media_server_driver);
+ btd_register_adapter_driver(&media_server_driver);
if (enabled.headset)
btd_register_adapter_driver(&headset_server_driver);
@@ -1264,8 +1257,7 @@ void audio_manager_exit(void)
config = NULL;
}
- if (enabled.media)
- btd_unregister_adapter_driver(&media_server_driver);
+ btd_unregister_adapter_driver(&media_server_driver);
if (enabled.headset)
btd_unregister_adapter_driver(&headset_server_driver);
diff --git a/audio/manager.h b/audio/manager.h
index f1d3021..3c8b1e0 100644
--- a/audio/manager.h
+++ b/audio/manager.h
@@ -29,8 +29,6 @@ struct enabled_interfaces {
gboolean sink;
gboolean source;
gboolean control;
- gboolean socket;
- gboolean media;
gboolean media_player;
};
--
1.7.9.5
From: Chan-yeol Park <[email protected]>
This patch replaces NULL with dbus invalid arguments return
if dbus method call gets invalid arguments from the peer.
This will avoid dbus peer coommander's infinite wait.
---
audio/media.c | 4 ++--
audio/transport.c | 4 ++--
plugins/service.c | 8 ++++----
profiles/network/connection.c | 2 +-
profiles/network/server.c | 4 ++--
src/adapter.c | 4 ++--
src/manager.c | 2 +-
7 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/audio/media.c b/audio/media.c
index ea6d582..b0ea4e9 100644
--- a/audio/media.c
+++ b/audio/media.c
@@ -926,7 +926,7 @@ static DBusMessage *unregister_endpoint(DBusConnection *conn, DBusMessage *msg,
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID))
- return NULL;
+ return btd_error_invalid_args(msg);
sender = dbus_message_get_sender(msg);
@@ -1808,7 +1808,7 @@ static DBusMessage *unregister_player(DBusConnection *conn, DBusMessage *msg,
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID))
- return NULL;
+ return btd_error_invalid_args(msg);
sender = dbus_message_get_sender(msg);
diff --git a/audio/transport.c b/audio/transport.c
index 832ad2a..d40c92d 100644
--- a/audio/transport.c
+++ b/audio/transport.c
@@ -667,7 +667,7 @@ static DBusMessage *acquire(DBusConnection *conn, DBusMessage *msg,
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &accesstype,
DBUS_TYPE_INVALID))
- return NULL;
+ return btd_error_invalid_args(msg);
sender = dbus_message_get_sender(msg);
@@ -704,7 +704,7 @@ static DBusMessage *release(DBusConnection *conn, DBusMessage *msg,
if (!dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &accesstype,
DBUS_TYPE_INVALID))
- return NULL;
+ return btd_error_invalid_args(msg);
sender = dbus_message_get_sender(msg);
diff --git a/plugins/service.c b/plugins/service.c
index 9f7bdb7..f16abe7 100644
--- a/plugins/service.c
+++ b/plugins/service.c
@@ -422,7 +422,7 @@ static DBusMessage *update_xml_record(DBusConnection *conn,
DBUS_TYPE_UINT32, &handle,
DBUS_TYPE_STRING, &record,
DBUS_TYPE_INVALID) == FALSE)
- return NULL;
+ return btd_error_invalid_args(msg);
len = (record ? strlen(record) : 0);
if (len == 0)
@@ -475,7 +475,7 @@ static DBusMessage *add_service_record(DBusConnection *conn,
if (dbus_message_get_args(msg, NULL,
DBUS_TYPE_STRING, &record, DBUS_TYPE_INVALID) == FALSE)
- return NULL;
+ return btd_error_invalid_args(msg);
sender = dbus_message_get_sender(msg);
err = add_xml_record(conn, sender, serv_adapter, record, &handle);
@@ -509,7 +509,7 @@ static DBusMessage *remove_service_record(DBusConnection *conn,
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &handle,
DBUS_TYPE_INVALID) == FALSE)
- return NULL;
+ return btd_error_invalid_args(msg);
sender = dbus_message_get_sender(msg);
@@ -582,7 +582,7 @@ static DBusMessage *request_authorization(DBusConnection *conn,
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &address,
DBUS_TYPE_UINT32, &handle,
DBUS_TYPE_INVALID) == FALSE)
- return NULL;
+ return btd_error_invalid_args(msg);
sender = dbus_message_get_sender(msg);
if (find_pending_by_sender(serv_adapter, sender))
diff --git a/profiles/network/connection.c b/profiles/network/connection.c
index e8ac643..c1ae3fa 100644
--- a/profiles/network/connection.c
+++ b/profiles/network/connection.c
@@ -402,7 +402,7 @@ static DBusMessage *connection_connect(DBusConnection *conn,
if (dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &svc,
DBUS_TYPE_INVALID) == FALSE)
- return NULL;
+ return btd_error_invalid_args(msg);
id = bnep_service_id(svc);
nc = find_connection(peer->connections, id);
diff --git a/profiles/network/server.c b/profiles/network/server.c
index cfad893..a3274d9 100644
--- a/profiles/network/server.c
+++ b/profiles/network/server.c
@@ -633,7 +633,7 @@ static DBusMessage *register_server(DBusConnection *conn,
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &uuid,
DBUS_TYPE_STRING, &bridge, DBUS_TYPE_INVALID))
- return NULL;
+ return btd_error_invalid_args(msg);
if (g_strcmp0(uuid, "nap"))
return btd_error_failed(msg, "Invalid UUID");
@@ -668,7 +668,7 @@ static DBusMessage *unregister_server(DBusConnection *conn,
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &uuid,
DBUS_TYPE_INVALID))
- return NULL;
+ return btd_error_invalid_args(msg);
if (g_strcmp0(uuid, "nap"))
return btd_error_failed(msg, "Invalid UUID");
diff --git a/src/adapter.c b/src/adapter.c
index 50779fd..4c70e2f 100644
--- a/src/adapter.c
+++ b/src/adapter.c
@@ -1574,7 +1574,7 @@ static DBusMessage *register_agent(DBusConnection *conn, DBusMessage *msg,
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_STRING, &capability, DBUS_TYPE_INVALID))
- return NULL;
+ return btd_error_invalid_args(msg);
if (adapter->agent)
return btd_error_already_exists(msg);
@@ -1604,7 +1604,7 @@ static DBusMessage *unregister_agent(DBusConnection *conn, DBusMessage *msg,
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID))
- return NULL;
+ return btd_error_invalid_args(msg);
name = dbus_message_get_sender(msg);
diff --git a/src/manager.c b/src/manager.c
index 4a39461..738bf0b 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -96,7 +96,7 @@ static DBusMessage *find_adapter(DBusConnection *conn,
if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &pattern,
DBUS_TYPE_INVALID))
- return NULL;
+ return btd_error_invalid_args(msg);
/* hci_devid() would make sense to use here, except it is
* restricted to devices which are up */
--
1.7.9.5
From: Chan-yeol Park <[email protected]>
This patch initializes rsp varialbe again for the remain failure
procedure.
---
profiles/network/server.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/profiles/network/server.c b/profiles/network/server.c
index a3274d9..bcb233e 100644
--- a/profiles/network/server.c
+++ b/profiles/network/server.c
@@ -343,7 +343,7 @@ static uint16_t bnep_setup_decode(struct bnep_setup_conn_req *req,
return BNEP_CONN_INVALID_SVC;
}
- return 0;
+ return BNEP_SUCCESS;
}
static void session_free(void *data)
@@ -425,6 +425,8 @@ static gboolean bnep_setup(GIOChannel *chan,
if (rsp)
goto reply;
+ rsp = BNEP_CONN_NOT_ALLOWED;
+
ns = find_server(na->servers, dst_role);
if (!ns) {
error("Server unavailable: (0x%x)", dst_role);
--
1.7.9.5
From: Chan-yeol Park <[email protected]>
---
audio/manager.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/audio/manager.c b/audio/manager.c
index 6411707..7634a68 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -69,23 +69,6 @@
#include "sdpd.h"
#include "telephony.h"
-typedef enum {
- HEADSET = 1 << 0,
- GATEWAY = 1 << 1,
- SINK = 1 << 2,
- SOURCE = 1 << 3,
- CONTROL = 1 << 4,
- TARGET = 1 << 5,
- INVALID = 1 << 6
-} audio_service_type;
-
-typedef enum {
- GENERIC_AUDIO = 0,
- ADVANCED_AUDIO,
- AV_REMOTE,
- GET_RECORDS
-} audio_sdp_state_t;
-
struct audio_adapter {
struct btd_adapter *btd_adapter;
gboolean powered;
--
1.7.9.5
Hi Chanyeol,
On Tue, Aug 28, 2012, [email protected] wrote:
> From: Chan-yeol Park <[email protected]>
>
> BlueZ supports only Media API. So option handler's are useless.
> ---
> audio/audio.conf | 2 +-
> audio/manager.c | 12 ++----------
> audio/manager.h | 2 --
> 3 files changed, 3 insertions(+), 13 deletions(-)
All four patches have been applied. Thanks!
Johan