Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH BlueZ] Fix removing storage for device over BR/EDR
@ 2011-11-07 14:16 Claudio Takahasi
  2011-11-14 18:54 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Claudio Takahasi @ 2011-11-07 14:16 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Claudio Takahasi

"characteristic", "attributes" and "ccc" files will be shared by both
transports: LE and BR/EDR. Remove the entry from the "primary" file
should be the last operation to clean the storage properly if the
device operation mode is GATT/ATT over BR/EDR.
---
 Dependencies:
 [PATCH BlueZ 0/7] CCC persistence
 [PATCH BlueZ 0/2] CCC for bonded devices

 src/storage.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/storage.c b/src/storage.c
index e4ad4ab..a47720a 100644
--- a/src/storage.c
+++ b/src/storage.c
@@ -1170,17 +1170,10 @@ done:
 int delete_device_service(const bdaddr_t *sba, const bdaddr_t *dba)
 {
 	char filename[PATH_MAX + 1], address[18];
-	int err;
-
-	create_filename(filename, PATH_MAX, sba, "primary");
 
 	memset(address, 0, sizeof(address));
 	ba2str(dba, address);
 
-	err = textfile_del(filename, address);
-	if (err < 0)
-		return err;
-
 	/* Deleting all characteristics of a given address */
 	create_filename(filename, PATH_MAX, sba, "characteristic");
 	delete_by_pattern(filename, address);
@@ -1193,7 +1186,8 @@ int delete_device_service(const bdaddr_t *sba, const bdaddr_t *dba)
 	create_filename(filename, PATH_MAX, sba, "ccc");
 	delete_by_pattern(filename, address);
 
-	return 0;
+	create_filename(filename, PATH_MAX, sba, "primary");
+	return textfile_del(filename, address);
 }
 
 char *read_device_services(const bdaddr_t *sba, const bdaddr_t *dba)
-- 
1.7.7.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH BlueZ] Fix removing storage for device over BR/EDR
  2011-11-07 14:16 [PATCH BlueZ] Fix removing storage for device over BR/EDR Claudio Takahasi
@ 2011-11-14 18:54 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-11-14 18:54 UTC (permalink / raw)
  To: Claudio Takahasi; +Cc: linux-bluetooth

Hi Claudio,

On Mon, Nov 07, 2011, Claudio Takahasi wrote:
> "characteristic", "attributes" and "ccc" files will be shared by both
> transports: LE and BR/EDR. Remove the entry from the "primary" file
> should be the last operation to clean the storage properly if the
> device operation mode is GATT/ATT over BR/EDR.
> ---
>  Dependencies:
>  [PATCH BlueZ 0/7] CCC persistence
>  [PATCH BlueZ 0/2] CCC for bonded devices
> 
>  src/storage.c |   10 ++--------
>  1 files changed, 2 insertions(+), 8 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-14 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-07 14:16 [PATCH BlueZ] Fix removing storage for device over BR/EDR Claudio Takahasi
2011-11-14 18:54 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox