From dce6ee99a3e9dc99c032654dd4fb7de15be698bd Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 10 Oct 2007 09:20:20 +0000 Subject: Store Extended Inquiry Response data information --- hcid/dbus-hci.c | 3 +++ hcid/hcid.h | 1 + hcid/storage.c | 17 +++++++++++++++++ 3 files changed, 21 insertions(+) diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c index 46646d27..48841318 100644 --- a/hcid/dbus-hci.c +++ b/hcid/dbus-hci.c @@ -1285,6 +1285,9 @@ void hcid_dbus_inquiry_result(bdaddr_t *local, bdaddr_t *peer, uint32_t class, write_remote_class(local, peer, class); + if (data) + write_remote_eir(local, peer, data); + /* * workaround to identify situation when the daemon started and * a standard inquiry or periodic inquiry was already running diff --git a/hcid/hcid.h b/hcid/hcid.h index 4da1bdb7..6679c773 100644 --- a/hcid/hcid.h +++ b/hcid/hcid.h @@ -191,6 +191,7 @@ int write_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t class); int read_remote_class(bdaddr_t *local, bdaddr_t *peer, uint32_t *class); int write_device_name(bdaddr_t *local, bdaddr_t *peer, char *name); int read_device_name(bdaddr_t *local, bdaddr_t *peer, char *name); +int write_remote_eir(bdaddr_t *local, bdaddr_t *peer, uint8_t *data); int write_l2cap_info(bdaddr_t *local, bdaddr_t *peer, uint16_t mtu_result, uint16_t mtu, uint16_t mask_result, uint32_t mask); diff --git a/hcid/storage.c b/hcid/storage.c index bec8fec1..8cf15d1a 100644 --- a/hcid/storage.c +++ b/hcid/storage.c @@ -289,6 +289,23 @@ int read_device_name(bdaddr_t *local, bdaddr_t *peer, char *name) return 0; } +int write_remote_eir(bdaddr_t *local, bdaddr_t *peer, uint8_t *data) +{ + char filename[PATH_MAX + 1], addr[18], str[481]; + int i; + + memset(str, 0, sizeof(str)); + for (i = 0; i < 240; i++) + sprintf(str + (i * 2), "%2.2X", data[i]); + + create_filename(filename, PATH_MAX, local, "eir"); + + create_file(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + + ba2str(peer, addr); + return textfile_put(filename, addr, str); +} + int write_l2cap_info(bdaddr_t *local, bdaddr_t *peer, uint16_t mtu_result, uint16_t mtu, uint16_t mask_result, uint32_t mask) -- cgit