diff --git a/obexd/plugins/bluetooth.c b/obexd/plugins/bluetooth.c
index 613b2a5..e547857 100644
--- a/obexd/plugins/bluetooth.c
+++ b/obexd/plugins/bluetooth.c
g_slist_free_full(ios, stop);
}
+static int bluetooth_getpeername(GIOChannel *io, char **name)
+{
+ GError *gerr = NULL;
+ char address[18];
+
+ bt_io_get(io, BT_IO_RFCOMM, &gerr,
+ BT_IO_OPT_DEST, address,
+ BT_IO_OPT_INVALID);
+ if (gerr)
+ return -EINVAL;
+
+ *name = g_strdup(address);
+
+ return 0;
+}
+
static struct obex_transport_driver driver = {
.name = "bluetooth",
.start = bluetooth_start,
+ .getpeername = bluetooth_getpeername,
.stop = bluetooth_stop
};
diff --git a/obexd/src/transport.h b/obexd/src/transport.h
index 320fafb..b81615b 100644
--- a/obexd/src/transport.h
+++ b/obexd/src/transport.h
const char *name;
uint16_t service;
void *(*start) (struct obex_server *server, int *err);
+ int (*getpeername) (GIOChannel *io, char **name);
void (*stop) (void *data);
};