diff options
author | Szymon Janc <szymon.janc@gmail.com> | 2013-11-25 22:15:46 +0000 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-11-27 11:21:42 +0200 |
commit | bc05407e078ad09a7845138421c939731205954a (patch) | |
tree | 6b70d58a245143f6239a5c34b9972f91ed5db1f1 /src | |
parent | f8f9f8e3094dec4d356429ed85bed30dc65f26c6 (diff) | |
download | bluez-bc05407e078ad09a7845138421c939731205954a.tar.gz |
Rename adapter_get_address to btd_adapter_get_address
Allow this symbol to be exported and usable from external plugins.
Diffstat (limited to 'src')
-rw-r--r-- | src/adapter.c | 6 | ||||
-rw-r--r-- | src/adapter.h | 2 | ||||
-rw-r--r-- | src/attrib-server.c | 4 | ||||
-rw-r--r-- | src/device.c | 31 | ||||
-rw-r--r-- | src/profile.c | 12 |
5 files changed, 28 insertions, 27 deletions
diff --git a/src/adapter.c b/src/adapter.c index be9877cc9..ef38d50ec 100644 --- a/src/adapter.c +++ b/src/adapter.c @@ -3991,7 +3991,7 @@ const char *adapter_get_path(struct btd_adapter *adapter) return adapter->path; } -const bdaddr_t *adapter_get_address(struct btd_adapter *adapter) +const bdaddr_t *btd_adapter_get_address(struct btd_adapter *adapter) { return &adapter->bdaddr; } @@ -5228,7 +5228,7 @@ static void store_link_key(struct btd_adapter *adapter, char *str; int i; - ba2str(adapter_get_address(adapter), adapter_addr); + ba2str(btd_adapter_get_address(adapter), adapter_addr); ba2str(device_get_address(device), device_addr); snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/info", adapter_addr, @@ -5385,7 +5385,7 @@ static void new_long_term_key_callback(uint16_t index, uint16_t length, if (ev->store_hint) { const struct mgmt_ltk_info *key = &ev->key; - const bdaddr_t *bdaddr = adapter_get_address(adapter); + const bdaddr_t *bdaddr = btd_adapter_get_address(adapter); store_longtermkey(bdaddr, &key->addr.bdaddr, key->addr.type, key->val, key->master, diff --git a/src/adapter.h b/src/adapter.h index 8a2ddae0d..e9822438a 100644 --- a/src/adapter.h +++ b/src/adapter.h @@ -99,7 +99,7 @@ struct btd_device *adapter_find_device(struct btd_adapter *adapter, const bdaddr_t *dst); const char *adapter_get_path(struct btd_adapter *adapter); -const bdaddr_t *adapter_get_address(struct btd_adapter *adapter); +const bdaddr_t *btd_adapter_get_address(struct btd_adapter *adapter); int adapter_set_name(struct btd_adapter *adapter, const char *name); int adapter_service_add(struct btd_adapter *adapter, sdp_record_t *rec); diff --git a/src/attrib-server.c b/src/attrib-server.c index 2861a0055..9231b5b3f 100644 --- a/src/attrib-server.c +++ b/src/attrib-server.c @@ -156,7 +156,7 @@ static int adapter_cmp_addr(gconstpointer a, gconstpointer b) const struct gatt_server *server = a; const bdaddr_t *bdaddr = b; - return bacmp(adapter_get_address(server->adapter), bdaddr); + return bacmp(btd_adapter_get_address(server->adapter), bdaddr); } static int adapter_cmp(gconstpointer a, gconstpointer b) @@ -1310,7 +1310,7 @@ int btd_adapter_gatt_server_start(struct btd_adapter *adapter) server = g_new0(struct gatt_server, 1); server->adapter = btd_adapter_ref(adapter); - addr = adapter_get_address(server->adapter); + addr = btd_adapter_get_address(server->adapter); /* BR/EDR socket */ server->l2cap_io = bt_io_listen(connect_event, NULL, NULL, NULL, &gerr, diff --git a/src/device.c b/src/device.c index 4ff8a14ba..4e952c5b4 100644 --- a/src/device.c +++ b/src/device.c @@ -263,7 +263,7 @@ static gboolean store_device_info_cb(gpointer user_data) device->store_id = 0; - ba2str(adapter_get_address(device->adapter), adapter_addr); + ba2str(btd_adapter_get_address(device->adapter), adapter_addr); ba2str(&device->bdaddr, device_addr); snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/info", adapter_addr, device_addr); @@ -409,7 +409,7 @@ void device_store_cached_name(struct btd_device *dev, const char *name) return; } - ba2str(adapter_get_address(dev->adapter), s_addr); + ba2str(btd_adapter_get_address(dev->adapter), s_addr); ba2str(&dev->bdaddr, d_addr); snprintf(filename, PATH_MAX, STORAGEDIR "/%s/cache/%s", s_addr, d_addr); filename[PATH_MAX] = '\0'; @@ -470,7 +470,7 @@ static void browse_request_cancel(struct browse_req *req) struct btd_device *device = req->device; struct btd_adapter *adapter = device->adapter; - bt_cancel_discovery(adapter_get_address(adapter), &device->bdaddr); + bt_cancel_discovery(btd_adapter_get_address(adapter), &device->bdaddr); attio_cleanup(device); @@ -2183,7 +2183,7 @@ struct btd_device *device_create_from_storage(struct btd_adapter *adapter, if (device == NULL) return NULL; - src = adapter_get_address(adapter); + src = btd_adapter_get_address(adapter); ba2str(src, srcaddr); load_info(device, srcaddr, address, key_file); @@ -2208,7 +2208,7 @@ struct btd_device *device_create(struct btd_adapter *adapter, return NULL; device->bdaddr_type = bdaddr_type; - sba = adapter_get_address(adapter); + sba = btd_adapter_get_address(adapter); ba2str(sba, src); str = load_cached_name(device, src, dst); @@ -2231,7 +2231,7 @@ char *btd_device_get_storage_path(struct btd_device *device, return NULL; } - ba2str(adapter_get_address(device->adapter), srcaddr); + ba2str(btd_adapter_get_address(device->adapter), srcaddr); ba2str(&device->bdaddr, dstaddr); if (!filename) @@ -2342,7 +2342,7 @@ static void delete_folder_tree(const char *dirname) static void device_remove_stored(struct btd_device *device) { - const bdaddr_t *src = adapter_get_address(device->adapter); + const bdaddr_t *src = btd_adapter_get_address(device->adapter); uint8_t dst_type = device->bdaddr_type; char adapter_addr[18]; char device_addr[18]; @@ -2717,7 +2717,7 @@ static void update_bredr_services(struct browse_req *req, sdp_list_t *recs) char *data; gsize length = 0; - ba2str(adapter_get_address(device->adapter), srcaddr); + ba2str(btd_adapter_get_address(device->adapter), srcaddr); ba2str(&device->bdaddr, dstaddr); if (!device->temporary) { @@ -2961,7 +2961,7 @@ static void browse_cb(sdp_list_t *recs, int err, gpointer user_data) /* Search for mandatory uuids */ if (uuid_list[req->search_uuid]) { sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]); - bt_search_service(adapter_get_address(adapter), + bt_search_service(btd_adapter_get_address(adapter), &device->bdaddr, &uuid, browse_cb, user_data, NULL); return; @@ -2994,7 +2994,7 @@ static void store_services(struct btd_device *device) if (prim_uuid == NULL) return; - ba2str(adapter_get_address(adapter), src_addr); + ba2str(btd_adapter_get_address(adapter), src_addr); ba2str(&device->bdaddr, dst_addr); snprintf(filename, PATH_MAX, STORAGEDIR "/%s/%s/attributes", src_addr, @@ -3370,7 +3370,8 @@ int device_connect_le(struct btd_device *dev) * pairing finishes */ io = bt_io_connect(att_connect_cb, attcb, NULL, &gerr, - BT_IO_OPT_SOURCE_BDADDR, adapter_get_address(adapter), + BT_IO_OPT_SOURCE_BDADDR, + btd_adapter_get_address(adapter), BT_IO_OPT_SOURCE_TYPE, BDADDR_LE_PUBLIC, BT_IO_OPT_DEST_BDADDR, &dev->bdaddr, BT_IO_OPT_DEST_TYPE, dev->bdaddr_type, @@ -3453,7 +3454,7 @@ static int device_browse_primary(struct btd_device *device, DBusMessage *msg) device->att_io = bt_io_connect(att_connect_cb, attcb, NULL, NULL, BT_IO_OPT_SOURCE_BDADDR, - adapter_get_address(adapter), + btd_adapter_get_address(adapter), BT_IO_OPT_SOURCE_TYPE, BDADDR_LE_PUBLIC, BT_IO_OPT_DEST_BDADDR, &device->bdaddr, BT_IO_OPT_DEST_TYPE, device->bdaddr_type, @@ -3499,8 +3500,8 @@ static int device_browse_sdp(struct btd_device *device, DBusMessage *msg) req->device = device; sdp_uuid16_create(&uuid, uuid_list[req->search_uuid++]); - err = bt_search_service(adapter_get_address(adapter), &device->bdaddr, - &uuid, browse_cb, req, NULL); + err = bt_search_service(btd_adapter_get_address(adapter), + &device->bdaddr, &uuid, browse_cb, req, NULL); if (err < 0) { browse_request_free(req); return err; @@ -4280,7 +4281,7 @@ static sdp_list_t *read_device_records(struct btd_device *device) sdp_list_t *recs = NULL; sdp_record_t *rec; - ba2str(adapter_get_address(device->adapter), local); + ba2str(btd_adapter_get_address(device->adapter), local); ba2str(&device->bdaddr, peer); snprintf(filename, PATH_MAX, STORAGEDIR "/%s/cache/%s", local, peer); diff --git a/src/profile.c b/src/profile.c index baadd9952..97cb1bc4e 100644 --- a/src/profile.c +++ b/src/profile.c @@ -718,7 +718,7 @@ static void ext_io_destroy(gpointer p) } if (ext_io->resolving) - bt_cancel_discovery(adapter_get_address(ext_io->adapter), + bt_cancel_discovery(btd_adapter_get_address(ext_io->adapter), device_get_address(ext_io->device)); if (ext_io->adapter) @@ -1257,7 +1257,7 @@ static uint32_t ext_start_servers(struct ext_profile *ext, io = bt_io_listen(connect, confirm, l2cap, NULL, &err, BT_IO_OPT_SOURCE_BDADDR, - adapter_get_address(adapter), + btd_adapter_get_address(adapter), BT_IO_OPT_MODE, ext->mode, BT_IO_OPT_PSM, psm, BT_IO_OPT_SEC_LEVEL, ext->sec_level, @@ -1295,7 +1295,7 @@ static uint32_t ext_start_servers(struct ext_profile *ext, io = bt_io_listen(connect, confirm, rfcomm, NULL, &err, BT_IO_OPT_SOURCE_BDADDR, - adapter_get_address(adapter), + btd_adapter_get_address(adapter), BT_IO_OPT_CHANNEL, chan, BT_IO_OPT_SEC_LEVEL, ext->sec_level, BT_IO_OPT_INVALID); @@ -1580,7 +1580,7 @@ static void record_cb(sdp_list_t *recs, int err, gpointer user_data) goto failed; } - err = connect_io(conn, adapter_get_address(conn->adapter), + err = connect_io(conn, btd_adapter_get_address(conn->adapter), device_get_address(conn->device)); if (err < 0) { error("Connecting %s failed: %s", ext->name, strerror(-err)); @@ -1637,10 +1637,10 @@ static int ext_connect_dev(struct btd_service *service) if (ext->remote_psm || ext->remote_chan) { conn->psm = ext->remote_psm; conn->chan = ext->remote_chan; - err = connect_io(conn, adapter_get_address(adapter), + err = connect_io(conn, btd_adapter_get_address(adapter), device_get_address(dev)); } else { - err = resolve_service(conn, adapter_get_address(adapter), + err = resolve_service(conn, btd_adapter_get_address(adapter), device_get_address(dev)); } |