diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c
index 79de9a2..2506aec 100644
--- a/obexd/plugins/bluetooth.c
+++ b/obexd/plugins/bluetooth.c
stream = FALSE;
/* Read MTU if io is an L2CAP socket */
- bt_io_get(io, BT_IO_L2CAP, NULL, BT_IO_OPT_OMTU, &omtu,
- BT_IO_OPT_IMTU, &imtu,
- BT_IO_OPT_INVALID);
+ bt_io_get(io, NULL, BT_IO_OPT_OMTU, &omtu, BT_IO_OPT_IMTU, &imtu,
+ BT_IO_OPT_INVALID);
done:
if (obex_server_new_connection(server, io, omtu, imtu, stream) < 0)
char address[18];
uint8_t channel;
- bt_io_get(io, BT_IO_RFCOMM, &err,
+ bt_io_get(io, &err,
BT_IO_OPT_SOURCE, source,
BT_IO_OPT_DEST, address,
BT_IO_OPT_CHANNEL, &channel,
char address[18];
uint16_t psm;
- bt_io_get(io, BT_IO_L2CAP, &err,
+ bt_io_get(io, &err,
BT_IO_OPT_SOURCE, source,
BT_IO_OPT_DEST, address,
BT_IO_OPT_PSM, &psm,
else
sec_level = BT_IO_SEC_LOW;
- io = bt_io_listen(BT_IO_RFCOMM, NULL, confirm_rfcomm,
+ io = bt_io_listen(NULL, confirm_rfcomm,
service, NULL, &err,
BT_IO_OPT_CHANNEL, service->channel,
BT_IO_OPT_SEC_LEVEL, sec_level,
psm = service->port == OBEX_PORT_RANDOM ? 0 : service->port;
- io = bt_io_listen(BT_IO_L2CAP, NULL, confirm_l2cap,
+ io = bt_io_listen(NULL, confirm_l2cap,
service, NULL, &err,
BT_IO_OPT_PSM, psm,
BT_IO_OPT_MODE, BT_IO_MODE_ERTM,
service->port = 0;
} else {
l = g_slist_prepend(l, io);
- bt_io_get(io, BT_IO_L2CAP, &err, BT_IO_OPT_PSM, &service->port,
+ bt_io_get(io, &err, BT_IO_OPT_PSM, &service->port,
BT_IO_OPT_INVALID);
DBG("listening on psm %d", service->port);
}
static int bluetooth_getpeername(GIOChannel *io, char **name)
{
- int sk = g_io_channel_unix_get_fd(io);
GError *gerr = NULL;
char address[18];
- int type;
- socklen_t len = sizeof(int);
- if (getsockopt(sk, SOL_SOCKET, SO_TYPE, &type, &len) < 0)
- return -errno;
-
- if (type == SOCK_STREAM)
- bt_io_get(io, BT_IO_RFCOMM, &gerr,
- BT_IO_OPT_DEST, address,
- BT_IO_OPT_INVALID);
- else
- bt_io_get(io, BT_IO_L2CAP, &gerr,
- BT_IO_OPT_DEST, address,
- BT_IO_OPT_INVALID);
+ bt_io_get(io, &gerr, BT_IO_OPT_DEST, address, BT_IO_OPT_INVALID);
if (gerr) {
error("%s", gerr->message);