[PATCH BlueZ 1/2] Add storage function to remove CCC of a device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/storage.c |   11 +++++++++++
 src/storage.h |    1 +
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/src/storage.c b/src/storage.c
index 3aa1b7f..429351a 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -1304,3 +1304,14 @@ int write_device_ccc(bdaddr_t *local, bdaddr_t *peer, uint16_t handle,
 
 	return textfile_put(filename, key, config);
 }
+
+void delete_device_ccc(bdaddr_t *local, bdaddr_t *peer)
+{
+	char filename[PATH_MAX + 1], addr[18];
+
+	ba2str(peer, addr);
+
+	/* Deleting all CCC values of a given address */
+	create_filename(filename, PATH_MAX, local, "ccc");
+	delete_by_pattern(filename, addr);
+}
diff --git a/src/storage.h b/src/storage.h
index 1cb3637..51259f6 100644
--- a/src/storage.h
+++ b/src/storage.h
@@ -87,6 +87,7 @@ int read_device_ccc(bdaddr_t *local, bdaddr_t *peer, uint16_t handle,
 							uint16_t *value);
 int write_device_ccc(bdaddr_t *local, bdaddr_t *peer, uint16_t handle,
 							uint16_t value);
+void delete_device_ccc(bdaddr_t *local, bdaddr_t *peer);
 
 #define PNP_UUID		"00001200-0000-1000-8000-00805f9b34fb"
 
-- 
1.7.7

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux