upgrade obexd to 0.47
[profile/ivi/obexd.git] / tools / test-server.c
index 7db153e..3a660f4 100644 (file)
@@ -36,8 +36,6 @@
 #include <gobex/gobex.h>
 #include <btio/btio.h>
 
-#include "glib-helper.h"
-
 static GMainLoop *main_loop = NULL;
 
 static GSList *clients = NULL;
@@ -324,16 +322,27 @@ static guint bluetooth_listen(void)
        }
 
        if (option_packet || option_channel > 31) {
-               type = BT_IO_L2CAP;
+               type = option_packet ? BT_IO_L2CAP : BT_IO_L2ERTM;
                option = BT_IO_OPT_PSM;
        } else {
                type = BT_IO_RFCOMM;
                option = BT_IO_OPT_CHANNEL;
        }
 
-       io = bt_io_listen(type, bluetooth_accept, NULL, NULL, NULL, &err,
-                               option, option_channel,
-                               BT_IO_OPT_INVALID);
+       if (type == BT_IO_L2CAP)
+               io = bt_io_listen(type, bluetooth_accept, NULL, NULL,
+                                       NULL, &err,
+                                       option, option_channel,
+                                       BT_IO_OPT_MODE, BT_IO_MODE_ERTM,
+                                       BT_IO_OPT_OMTU, option_omtu,
+                                       BT_IO_OPT_IMTU, option_imtu,
+                                       BT_IO_OPT_INVALID);
+       else
+               io = bt_io_listen(type, bluetooth_accept, NULL, NULL,
+                                       NULL, &err,
+                                       option, option_channel,
+                                       BT_IO_OPT_INVALID);
+
        if (io == NULL) {
                g_printerr("%s\n", err->message);
                g_error_free(err);