Thread (5 messages) flat view 5 messages, 2 authors, 2013-02-26

Re: [PATCH BlueZ 1/2] adapter: add a btd_adapter_get_default_address() call

From: Johan Hedberg <hidden>
Date: 2013-02-26 11:51:22

Hi Antonio,

On Sun, Feb 24, 2013, Antonio Ospite wrote:
quoted hunk ↗ jump to hunk
Add a new btd_* call to get the default adapter address as a string.

This is meant to be used, for instance, by _external_ plugins which want
to know the default adapter address for some reason (e.g. to send it to
a device for some custom pairing scheme like in the case of Playstation
peripherals).

External plugins can only use symbols marked as "global" in
src/bluetooth.ver, this patch avoids making global these symbols:

  adapter_get_address
  bt_malloc
  ba2str
---
 src/adapter.h |    1 +
 src/adapter.c |   17 +++++++++++++++++
 2 files changed, 18 insertions(+)
diff --git a/src/adapter.h b/src/adapter.h
index 8d23a64..cb6d0d6 100644
--- a/src/adapter.h
+++ b/src/adapter.h
@@ -38,6 +38,7 @@
 struct btd_adapter;
 
 struct btd_adapter *btd_adapter_get_default(void);
+char *btd_adapter_get_default_address(void);
 bool btd_adapter_is_default(struct btd_adapter *adapter);
 uint16_t btd_adapter_get_index(struct btd_adapter *adapter);
Please fix adapter_get_address to have a btd_ prefix instead. There's no
reason why that should be hidden from plugins.

As for the libbluetooth symbols, I don't get what the issue is. Those
should always be available to any binary that links with libbluetooth.
If they don't work then I think we need to fix something in the way the
plugins and/or bluetoothd are built.

Johan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help