aboutsummaryrefslogtreecommitdiffstats
path: root/src/storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage.c')
-rw-r--r--src/storage.c11
1 files changed, 11 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);
+}