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 4d4607a6..08778bcf 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -1264,3 +1264,19 @@ char *read_device_services(const bdaddr_t *sba, const bdaddr_t *dba)
return textfile_caseget(filename, addr);
}
+
+int write_device_characteristics(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, "characteristic");
+
+ 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);
+}