From 2abb3498e8e6296c2564b410e226450a3419c54e Mon Sep 17 00:00:00 2001 From: Claudio Takahasi Date: Mon, 7 Nov 2011 11:09:13 -0300 Subject: [PATCH] Add storage function to remove CCC of a device --- src/storage.c | 11 +++++++++++ src/storage.h | 1 + 2 files changed, 12 insertions(+) diff --git a/src/storage.c b/src/storage.c index 7471b0f2e..e4ad4abc8 100644 --- a/src/storage.c +++ b/src/storage.c @@ -1305,3 +1305,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 1cb363795..51259f603 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" -- 2.47.3