summaryrefslogtreecommitdiff
path: root/android/avdtptest.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2015-02-20 14:43:15 +0200
committerSzymon Janc <szymon.janc@tieto.com>2015-02-22 21:26:25 +0100
commit37c942ff2ba1fc4e42a95957c8f24c19e468d4f0 (patch)
tree92c2c12f6d0e2fc8108c61eec2aefd418fd3320a /android/avdtptest.c
parent49450bf6f01f8f08ee585bda8f75ac7d7f40d0af (diff)
downloadbluez-37c942ff2ba1fc4e42a95957c8f24c19e468d4f0.tar.gz
android/avdtp: Refactor local SEP list handling
In order to deduplicate similar code in android/ and profiles/ we need to handle local SEP queue outside of avdtp.c. GSList is transformed to queue.
Diffstat (limited to 'android/avdtptest.c')
-rw-r--r--android/avdtptest.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/android/avdtptest.c b/android/avdtptest.c
index ce3951986..652942337 100644
--- a/android/avdtptest.c
+++ b/android/avdtptest.c
@@ -40,6 +40,7 @@
#include "src/shared/util.h"
#include "btio/btio.h"
+#include "src/shared/queue.h"
#include "avdtp.h"
static GMainLoop *mainloop = NULL;
@@ -57,6 +58,7 @@ static uint16_t version = 0x0103;
static guint media_player = 0;
static guint media_recorder = 0;
static guint idle_id = 0;
+static struct queue *lseps = NULL;
static bool fragment = false;
@@ -411,7 +413,7 @@ static void connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
return;
}
- avdtp = avdtp_new(fd, imtu, omtu, version);
+ avdtp = avdtp_new(fd, imtu, omtu, version, lseps);
if (!avdtp) {
printf("Failed to create avdtp instance\n");
g_main_loop_quit(mainloop);
@@ -864,13 +866,15 @@ int main(int argc, char *argv[])
}
}
- local_sep = avdtp_register_sep(dev_role, AVDTP_MEDIA_TYPE_AUDIO,
+ local_sep = avdtp_register_sep(lseps, dev_role, AVDTP_MEDIA_TYPE_AUDIO,
0x00, TRUE, &sep_ind, &sep_cfm, NULL);
if (!local_sep) {
printf("Failed to register sep\n");
exit(0);
}
+ queue_push_tail(lseps, local_sep);
+
if (!bacmp(&dst, BDADDR_ANY)) {
printf("Listening...\n");
io = do_listen(&err);
@@ -889,6 +893,8 @@ int main(int argc, char *argv[])
printf("Done\n");
+ queue_destroy(lseps, NULL);
+
avdtp_unref(avdtp);
avdtp = NULL;