#include <gobex/gobex.h>
#include <btio/btio.h>
-#include "glib-helper.h"
-
static GMainLoop *main_loop = NULL;
static GSList *clients = NULL;
}
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);