summaryrefslogtreecommitdiff
path: root/hcid
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-10-10 09:20:20 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-10-10 09:20:20 +0000
commitdce6ee99a3e9dc99c032654dd4fb7de15be698bd (patch)
tree4fdf984bf79185e61102486c4c9a875f58180f7a /hcid
parent8cfa0ed821e386e1fb8e31f16522f7be67ba1d31 (diff)
downloadbluez-dce6ee99a3e9dc99c032654dd4fb7de15be698bd.tar.gz
Store Extended Inquiry Response data information
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus-hci.c3
-rw-r--r--hcid/hcid.h1
-rw-r--r--hcid/storage.c17
3 files changed, 21 insertions, 0 deletions
diff --git a/hcid/dbus-hci.c b/hcid/dbus-hci.c
index 46646d27a..488413189 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 4da1bdb7c..6679c773d 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 bec8fec19..8cf15d1ab 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)