aboutsummaryrefslogtreecommitdiffstats
path: root/src/storage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage.c')
-rw-r--r--src/storage.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/storage.c b/src/storage.c
index 4fb5f9e8..dcd6511d 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -1296,3 +1296,19 @@ char *read_device_characteristics(const bdaddr_t *sba, const bdaddr_t *dba,
return textfile_caseget(filename, key);
}
+
+int write_device_attribute(const bdaddr_t *sba, const bdaddr_t *dba,
+ uint16_t handle, const char *chars)
+{
+ char filename[PATH_MAX + 1], addr[18], key[23];
+
+ create_filename(filename, PATH_MAX, sba, "attributes");
+
+ create_file(filename, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
+
+ ba2str(dba, addr);
+
+ snprintf(key, sizeof(key), "%17s#%04X", addr, handle);
+
+ return textfile_put(filename, key, chars);
+}