aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnderson Lizardo <anderson.lizardo@openbossa.org>2010-08-13 14:59:17 -0400
committerAnderson Lizardo <anderson.lizardo@openbossa.org>2010-08-26 09:29:56 -0400
commit08f1b750295cda5beaa4d948f499cd7c93b85f70 (patch)
tree8fd111b6f005ca6182dd5ba20c0fd4328b789235 /src
parenta5e5c9262a7fa20b03643c478f1620995a89ad79 (diff)
downloadbluez-08f1b750295cda5beaa4d948f499cd7c93b85f70.tar.gz
bluez-08f1b750295cda5beaa4d948f499cd7c93b85f70.tar.xz
bluez-08f1b750295cda5beaa4d948f499cd7c93b85f70.zip
Support for loading attribute data
Diffstat (limited to 'src')
-rw-r--r--src/storage.c11
-rw-r--r--src/storage.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/src/storage.c b/src/storage.c
index dcd6511d..1bfd9c5d 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -1312,3 +1312,14 @@ int write_device_attribute(const bdaddr_t *sba, const bdaddr_t *dba,
return textfile_put(filename, key, chars);
}
+
+int read_device_attributes(const bdaddr_t *sba, textfile_cb func, void *data)
+{
+ char filename[PATH_MAX + 1];
+
+ create_filename(filename, PATH_MAX, sba, "attributes");
+
+ create_file(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+ return textfile_foreach(filename, func, data);
+}
diff --git a/src/storage.h b/src/storage.h
index dcba2ce5..cf1ffdcf 100644
--- a/src/storage.h
+++ b/src/storage.h
@@ -21,6 +21,8 @@
*
*/
+#include "textfile.h"
+
int read_device_alias(const char *src, const char *dst, char *alias, size_t size);
int write_device_alias(const char *src, const char *dst, const char *alias);
int write_discoverable_timeout(bdaddr_t *bdaddr, int timeout);
@@ -87,6 +89,7 @@ char *read_device_characteristics(const bdaddr_t *sba, const bdaddr_t *dba,
uint16_t handle);
int write_device_attribute(const bdaddr_t *sba, const bdaddr_t *dba,
uint16_t handle, const char *chars);
+int read_device_attributes(const bdaddr_t *sba, textfile_cb func, void *data);
#define PNP_UUID "00001200-0000-1000-8000-00805f9b34fb"