* [RFC BlueZ v0 0/4] Remove profile specific storage
@ 2012-09-28 20:01 Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 1/4] core: Add purge parameter to profile remove Claudio Takahasi
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Claudio Takahasi @ 2012-09-28 20:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
In the current implementation it is not possible to detect in the
profile driver remove callback if the device is being removed from
the system or if bluetoothd is exiting.
This patch series allows the profile to identify when a given device
is being removed from the system, allowing the profiles to execute
actions or remove stored data before being removed.
Another possible approach could be add a new callback in the profile
indicating that the device is being removed.
There is also a TODO file item: "Convert storage to user per-remote
device directories and ini-file format". What is the idea? Should the
core remove everything under the remote device address directory?
Claudio Takahasi (4):
core: Add purge parameter to profile remove
proximity: Remove alert level storage
proximity: Store Bluetooth Address type
gatt: Remove Service Changed handle from storage
audio/manager.c | 3 ++-
profiles/deviceinfo/manager.c | 2 +-
profiles/gatt/gas.c | 26 +++++++++++++++++++++++++-
profiles/gatt/gas.h | 2 +-
profiles/gatt/manager.c | 4 ++--
profiles/health/hdp_manager.c | 3 ++-
profiles/heartrate/manager.c | 2 +-
profiles/input/hog_manager.c | 3 ++-
profiles/input/manager.c | 3 ++-
profiles/network/manager.c | 3 ++-
profiles/proximity/manager.c | 4 ++--
profiles/proximity/monitor.c | 41 +++++++++++++++++++++++++++++------------
profiles/proximity/monitor.h | 2 +-
profiles/proximity/reporter.c | 3 ++-
profiles/proximity/reporter.h | 3 ++-
profiles/scanparam/manager.c | 3 ++-
profiles/thermometer/manager.c | 2 +-
src/device.c | 26 +++++++++++++++++---------
src/profile.h | 2 +-
19 files changed, 97 insertions(+), 40 deletions(-)
--
1.7.12
^ permalink raw reply [flat|nested] 6+ messages in thread
* [RFC BlueZ v0 1/4] core: Add purge parameter to profile remove
2012-09-28 20:01 [RFC BlueZ v0 0/4] Remove profile specific storage Claudio Takahasi
@ 2012-09-28 20:01 ` Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 2/4] proximity: Remove alert level storage Claudio Takahasi
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Claudio Takahasi @ 2012-09-28 20:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
This patch extends the profile device remove callback allowing the
profiles to remove stored data or execute other profile specific
actions before removing completely the device from the system.
---
audio/manager.c | 3 ++-
profiles/deviceinfo/manager.c | 2 +-
profiles/gatt/manager.c | 2 +-
profiles/health/hdp_manager.c | 3 ++-
profiles/heartrate/manager.c | 2 +-
profiles/input/hog_manager.c | 3 ++-
profiles/input/manager.c | 3 ++-
profiles/network/manager.c | 3 ++-
profiles/proximity/manager.c | 2 +-
profiles/proximity/reporter.c | 3 ++-
profiles/proximity/reporter.h | 3 ++-
profiles/scanparam/manager.c | 3 ++-
profiles/thermometer/manager.c | 2 +-
src/device.c | 26 +++++++++++++++++---------
src/profile.h | 2 +-
15 files changed, 39 insertions(+), 23 deletions(-)
diff --git a/audio/manager.c b/audio/manager.c
index 70be01b..3a89b0f 100644
--- a/audio/manager.c
+++ b/audio/manager.c
@@ -665,7 +665,8 @@ static struct audio_device *get_audio_dev(struct btd_device *device)
return manager_get_device(&src, &dst, TRUE);
}
-static void audio_remove(struct btd_profile *p, struct btd_device *device)
+static void audio_remove(struct btd_profile *p, struct btd_device *device,
+ gboolean purge)
{
struct audio_device *dev;
const char *path;
diff --git a/profiles/deviceinfo/manager.c b/profiles/deviceinfo/manager.c
index 3217283..f620f2c 100644
--- a/profiles/deviceinfo/manager.c
+++ b/profiles/deviceinfo/manager.c
@@ -62,7 +62,7 @@ static int deviceinfo_driver_probe(struct btd_profile *p,
}
static void deviceinfo_driver_remove(struct btd_profile *p,
- struct btd_device *device)
+ struct btd_device *device, gboolean purge)
{
deviceinfo_unregister(device);
}
diff --git a/profiles/gatt/manager.c b/profiles/gatt/manager.c
index 747760b..94921d2 100644
--- a/profiles/gatt/manager.c
+++ b/profiles/gatt/manager.c
@@ -68,7 +68,7 @@ static int gatt_driver_probe(struct btd_profile *p, struct btd_device *device,
}
static void gatt_driver_remove(struct btd_profile *p,
- struct btd_device *device)
+ struct btd_device *device, gboolean purge)
{
gas_unregister(device);
}
diff --git a/profiles/health/hdp_manager.c b/profiles/health/hdp_manager.c
index 7b799f4..5b98f21 100644
--- a/profiles/health/hdp_manager.c
+++ b/profiles/health/hdp_manager.c
@@ -60,7 +60,8 @@ static int hdp_driver_probe(struct btd_profile *p, struct btd_device *device,
return hdp_device_register(device);
}
-static void hdp_driver_remove(struct btd_profile *p, struct btd_device *device)
+static void hdp_driver_remove(struct btd_profile *p, struct btd_device *device,
+ gboolean purge)
{
hdp_device_unregister(device);
}
diff --git a/profiles/heartrate/manager.c b/profiles/heartrate/manager.c
index 19b18a8..7be9156 100644
--- a/profiles/heartrate/manager.c
+++ b/profiles/heartrate/manager.c
@@ -70,7 +70,7 @@ static int heartrate_device_probe(struct btd_profile *p,
}
static void heartrate_device_remove(struct btd_profile *p,
- struct btd_device *device)
+ struct btd_device *device, gboolean purge)
{
heartrate_device_unregister(device);
}
diff --git a/profiles/input/hog_manager.c b/profiles/input/hog_manager.c
index 362c38a..13cd902 100644
--- a/profiles/input/hog_manager.c
+++ b/profiles/input/hog_manager.c
@@ -107,7 +107,8 @@ static void remove_device(gpointer hogdev, gpointer b)
hog_device_unregister(hogdev);
}
-static void hog_device_remove(struct btd_profile *p, struct btd_device *device)
+static void hog_device_remove(struct btd_profile *p, struct btd_device *device,
+ gboolean purge)
{
const gchar *path = device_get_path(device);
diff --git a/profiles/input/manager.c b/profiles/input/manager.c
index 32698aa..4ef2ff2 100644
--- a/profiles/input/manager.c
+++ b/profiles/input/manager.c
@@ -70,7 +70,8 @@ static int hid_device_probe(struct btd_profile *p, struct btd_device *device,
idle_timeout * 60);
}
-static void hid_device_remove(struct btd_profile *p, struct btd_device *device)
+static void hid_device_remove(struct btd_profile *p, struct btd_device *device,
+ gboolean purge)
{
input_remove(device, HID_UUID);
}
diff --git a/profiles/network/manager.c b/profiles/network/manager.c
index e1f4164..dc09ced 100644
--- a/profiles/network/manager.c
+++ b/profiles/network/manager.c
@@ -95,7 +95,8 @@ static int network_probe(struct btd_profile *p, struct btd_device *device,
return 0;
}
-static void network_remove(struct btd_profile *p, struct btd_device *device)
+static void network_remove(struct btd_profile *p, struct btd_device *device,
+ gboolean purge)
{
const gchar *path = device_get_path(device);
diff --git a/profiles/proximity/manager.c b/profiles/proximity/manager.c
index 58e5193..93dc33e 100644
--- a/profiles/proximity/manager.c
+++ b/profiles/proximity/manager.c
@@ -78,7 +78,7 @@ static int monitor_device_probe(struct btd_profile *p,
}
static void monitor_device_remove(struct btd_profile *p,
- struct btd_device *device)
+ struct btd_device *device, gboolean purge)
{
monitor_unregister(device);
}
diff --git a/profiles/proximity/reporter.c b/profiles/proximity/reporter.c
index 6ec5f73..90f1f77 100644
--- a/profiles/proximity/reporter.c
+++ b/profiles/proximity/reporter.c
@@ -238,7 +238,8 @@ int reporter_device_probe(struct btd_profile *p, struct btd_device *device,
return 0;
}
-void reporter_device_remove(struct btd_profile *p, struct btd_device *device)
+void reporter_device_remove(struct btd_profile *p, struct btd_device *device,
+ gboolean purge)
{
struct reporter_adapter *radapter;
struct btd_adapter *adapter = device_get_adapter(device);
diff --git a/profiles/proximity/reporter.h b/profiles/proximity/reporter.h
index 480c668..bd64a92 100644
--- a/profiles/proximity/reporter.h
+++ b/profiles/proximity/reporter.h
@@ -36,7 +36,8 @@ enum {
HIGH_ALERT = 0x02,
};
-void reporter_device_remove(struct btd_profile *p, struct btd_device *device);
+void reporter_device_remove(struct btd_profile *p, struct btd_device *device,
+ gboolean purge);
int reporter_device_probe(struct btd_profile *p, struct btd_device *device,
GSList *uuids);
diff --git a/profiles/scanparam/manager.c b/profiles/scanparam/manager.c
index 24d1e78..0ce0583 100644
--- a/profiles/scanparam/manager.c
+++ b/profiles/scanparam/manager.c
@@ -68,7 +68,8 @@ static int scan_param_probe(struct btd_profile *p, struct btd_device *device,
return scan_register(device, l->data);
}
-static void scan_param_remove(struct btd_profile *p, struct btd_device *device)
+static void scan_param_remove(struct btd_profile *p, struct btd_device *device,
+ gboolean purge)
{
scan_unregister(device);
}
diff --git a/profiles/thermometer/manager.c b/profiles/thermometer/manager.c
index d965976..81eb8be 100644
--- a/profiles/thermometer/manager.c
+++ b/profiles/thermometer/manager.c
@@ -61,7 +61,7 @@ static int thermometer_driver_probe(struct btd_profile *p,
}
static void thermometer_driver_remove(struct btd_profile *p,
- struct btd_device *device)
+ struct btd_device *device, gboolean purge)
{
thermometer_unregister(device);
}
diff --git a/src/device.c b/src/device.c
index efa3dbe..8f34f01 100644
--- a/src/device.c
+++ b/src/device.c
@@ -497,7 +497,15 @@ static DBusMessage *set_trust(DBusMessage *msg, gboolean value, void *data)
static void profile_remove(struct btd_profile *profile,
struct btd_device *device)
{
- profile->device_remove(profile, device);
+ profile->device_remove(profile, device, FALSE);
+
+ device->profiles = g_slist_remove(device->profiles, profile);
+}
+
+static void profile_purge(struct btd_profile *profile,
+ struct btd_device *device)
+{
+ profile->device_remove(profile, device, TRUE);
device->profiles = g_slist_remove(device->profiles, profile);
}
@@ -1270,10 +1278,13 @@ void device_remove(struct btd_device *device, gboolean remove_stored)
if (device->connected)
do_disconnect(device);
- if (remove_stored)
+ if (remove_stored) {
device_remove_stored(device);
-
- g_slist_foreach(device->profiles, (GFunc) profile_remove, device);
+ g_slist_foreach(device->profiles, (GFunc) profile_purge,
+ device);
+ } else
+ g_slist_foreach(device->profiles, (GFunc) profile_remove,
+ device);
g_slist_free(device->profiles);
device->profiles = NULL;
@@ -1406,9 +1417,7 @@ void device_remove_profile(gpointer a, gpointer b)
if (!g_slist_find(device->profiles, profile))
return;
- device->profiles = g_slist_remove(device->profiles, profile);
-
- profile->device_remove(profile, device);
+ profile_remove(profile, device);
}
void device_probe_profiles(struct btd_device *device, GSList *uuids)
@@ -1486,8 +1495,7 @@ static void device_remove_profiles(struct btd_device *device, GSList *uuids)
continue;
}
- profile->device_remove(profile, device);
- device->profiles = g_slist_remove(device->profiles, profile);
+ profile_remove(profile, device);
}
}
diff --git a/src/profile.h b/src/profile.h
index 1702901..25da63c 100644
--- a/src/profile.h
+++ b/src/profile.h
@@ -39,7 +39,7 @@ struct btd_profile {
int (*device_probe) (struct btd_profile *p, struct btd_device *device,
GSList *uuids);
void (*device_remove) (struct btd_profile *p,
- struct btd_device *device);
+ struct btd_device *device, gboolean purge);
int (*connect) (struct btd_device *device, struct btd_profile *profile,
btd_profile_cb cb);
--
1.7.12
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC BlueZ v0 2/4] proximity: Remove alert level storage
2012-09-28 20:01 [RFC BlueZ v0 0/4] Remove profile specific storage Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 1/4] core: Add purge parameter to profile remove Claudio Takahasi
@ 2012-09-28 20:01 ` Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 3/4] proximity: Store Bluetooth Address type Claudio Takahasi
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Claudio Takahasi @ 2012-09-28 20:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
This patch fix leftover LinkLossAlertLevel store value when the device
is removed from the system.
---
profiles/proximity/manager.c | 2 +-
profiles/proximity/monitor.c | 15 +++++++++++++--
profiles/proximity/monitor.h | 2 +-
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/profiles/proximity/manager.c b/profiles/proximity/manager.c
index 93dc33e..afc2569 100644
--- a/profiles/proximity/manager.c
+++ b/profiles/proximity/manager.c
@@ -80,7 +80,7 @@ static int monitor_device_probe(struct btd_profile *p,
static void monitor_device_remove(struct btd_profile *p,
struct btd_device *device, gboolean purge)
{
- monitor_unregister(device);
+ monitor_unregister(device, purge);
}
static struct btd_profile pxp_monitor_profile = {
diff --git a/profiles/proximity/monitor.c b/profiles/proximity/monitor.c
index a791916..4745791 100644
--- a/profiles/proximity/monitor.c
+++ b/profiles/proximity/monitor.c
@@ -106,7 +106,10 @@ static int write_proximity_config(bdaddr_t *sba, bdaddr_t *dba,
snprintf(key, sizeof(key), "%17s#%s", addr, alert);
- return textfile_put(filename, key, level);
+ if (level)
+ return textfile_put(filename, key, level);
+ else
+ return textfile_del(filename, key);
}
static char *read_proximity_config(bdaddr_t *sba, bdaddr_t *dba,
@@ -659,10 +662,18 @@ int monitor_register(struct btd_device *device,
return 0;
}
-void monitor_unregister(struct btd_device *device)
+void monitor_unregister(struct btd_device *device, gboolean purge)
{
const char *path = device_get_path(device);
g_dbus_unregister_interface(btd_get_dbus_connection(), path,
PROXIMITY_INTERFACE);
+ if (purge) {
+ bdaddr_t sba, dba;
+
+ adapter_get_address(device_get_adapter(device), &sba);
+ device_get_address(device, &dba, NULL);
+
+ write_proximity_config(&sba, &dba, "LinkLossAlertLevel", NULL);
+ }
}
diff --git a/profiles/proximity/monitor.h b/profiles/proximity/monitor.h
index 191b562..bffc8af 100644
--- a/profiles/proximity/monitor.h
+++ b/profiles/proximity/monitor.h
@@ -31,4 +31,4 @@ struct enabled {
int monitor_register(struct btd_device *device, struct gatt_primary *linkloss,
struct gatt_primary *txpower, struct gatt_primary *immediate,
struct enabled *enabled);
-void monitor_unregister(struct btd_device *device);
+void monitor_unregister(struct btd_device *device, gboolean purge);
--
1.7.12
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC BlueZ v0 3/4] proximity: Store Bluetooth Address type
2012-09-28 20:01 [RFC BlueZ v0 0/4] Remove profile specific storage Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 1/4] core: Add purge parameter to profile remove Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 2/4] proximity: Remove alert level storage Claudio Takahasi
@ 2012-09-28 20:01 ` Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 4/4] gatt: Remove Service Changed handle from storage Claudio Takahasi
2012-10-01 9:54 ` [RFC BlueZ v0 0/4] Remove profile specific storage Johan Hedberg
4 siblings, 0 replies; 6+ messages in thread
From: Claudio Takahasi @ 2012-09-28 20:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
This patch stores the remote Bluetooth Address type in the "proximity"
file. The textfile key is now "address#type#alert"
---
profiles/proximity/monitor.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/profiles/proximity/monitor.c b/profiles/proximity/monitor.c
index 4745791..77caf35 100644
--- a/profiles/proximity/monitor.c
+++ b/profiles/proximity/monitor.c
@@ -94,9 +94,9 @@ static inline int create_filename(char *buf, size_t size,
}
static int write_proximity_config(bdaddr_t *sba, bdaddr_t *dba,
- const char *alert, const char *level)
+ uint8_t bdaddr_type, const char *alert, const char *level)
{
- char filename[PATH_MAX + 1], addr[18], key[38];
+ char filename[PATH_MAX + 1], addr[18], key[40];
create_filename(filename, PATH_MAX, sba, "proximity");
@@ -104,7 +104,7 @@ static int write_proximity_config(bdaddr_t *sba, bdaddr_t *dba,
ba2str(dba, addr);
- snprintf(key, sizeof(key), "%17s#%s", addr, alert);
+ snprintf(key, sizeof(key), "%17s#%hhu#%s", addr, bdaddr_type, alert);
if (level)
return textfile_put(filename, key, level);
@@ -113,15 +113,15 @@ static int write_proximity_config(bdaddr_t *sba, bdaddr_t *dba,
}
static char *read_proximity_config(bdaddr_t *sba, bdaddr_t *dba,
- const char *alert)
+ uint8_t bdaddr_type, const char *alert)
{
- char filename[PATH_MAX + 1], addr[18], key[38];
+ char filename[PATH_MAX + 1], addr[18], key[40];
char *str, *strnew;
create_filename(filename, PATH_MAX, sba, "proximity");
ba2str(dba, addr);
- snprintf(key, sizeof(key), "%17s#%s", addr, alert);
+ snprintf(key, sizeof(key), "%17s#%hhu#%s", addr, bdaddr_type, alert);
str = textfile_caseget(filename, key);
if (str == NULL)
@@ -411,6 +411,7 @@ static DBusMessage *set_link_loss_alert(DBusConnection *conn, DBusMessage *msg,
struct monitor *monitor = data;
struct btd_device *device = monitor->device;
bdaddr_t sba, dba;
+ uint8_t bdaddr_type;
if (!level_is_valid(level))
return btd_error_invalid_args(msg);
@@ -422,9 +423,10 @@ static DBusMessage *set_link_loss_alert(DBusConnection *conn, DBusMessage *msg,
monitor->linklosslevel = g_strdup(level);
adapter_get_address(device_get_adapter(device), &sba);
- device_get_address(device, &dba, NULL);
+ device_get_address(device, &dba, &bdaddr_type);
- write_proximity_config(&sba, &dba, "LinkLossAlertLevel", level);
+ write_proximity_config(&sba, &dba, bdaddr_type, "LinkLossAlertLevel",
+ level);
if (monitor->attrib)
write_alert_level(monitor);
@@ -597,12 +599,14 @@ int monitor_register(struct btd_device *device,
const char *path = device_get_path(device);
struct monitor *monitor;
bdaddr_t sba, dba;
+ uint8_t bdaddr_type;
char *level;
adapter_get_address(device_get_adapter(device), &sba);
- device_get_address(device, &dba, NULL);
+ device_get_address(device, &dba, &bdaddr_type);
- level = read_proximity_config(&sba, &dba, "LinkLossAlertLevel");
+ level = read_proximity_config(&sba, &dba, bdaddr_type,
+ "LinkLossAlertLevel");
monitor = g_new0(struct monitor, 1);
monitor->device = btd_device_ref(device);
@@ -670,10 +674,12 @@ void monitor_unregister(struct btd_device *device, gboolean purge)
PROXIMITY_INTERFACE);
if (purge) {
bdaddr_t sba, dba;
+ uint8_t bdaddr_type;
adapter_get_address(device_get_adapter(device), &sba);
- device_get_address(device, &dba, NULL);
+ device_get_address(device, &dba, &bdaddr_type);
- write_proximity_config(&sba, &dba, "LinkLossAlertLevel", NULL);
+ write_proximity_config(&sba, &dba, bdaddr_type,
+ "LinkLossAlertLevel", NULL);
}
}
--
1.7.12
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [RFC BlueZ v0 4/4] gatt: Remove Service Changed handle from storage
2012-09-28 20:01 [RFC BlueZ v0 0/4] Remove profile specific storage Claudio Takahasi
` (2 preceding siblings ...)
2012-09-28 20:01 ` [RFC BlueZ v0 3/4] proximity: Store Bluetooth Address type Claudio Takahasi
@ 2012-09-28 20:01 ` Claudio Takahasi
2012-10-01 9:54 ` [RFC BlueZ v0 0/4] Remove profile specific storage Johan Hedberg
4 siblings, 0 replies; 6+ messages in thread
From: Claudio Takahasi @ 2012-09-28 20:01 UTC (permalink / raw)
To: linux-bluetooth; +Cc: Claudio Takahasi
This patch removes the Service Changed handle from the GATT storage when
the device is removed from the system.
---
profiles/gatt/gas.c | 26 +++++++++++++++++++++++++-
profiles/gatt/gas.h | 2 +-
profiles/gatt/manager.c | 2 +-
3 files changed, 27 insertions(+), 3 deletions(-)
diff --git a/profiles/gatt/gas.c b/profiles/gatt/gas.c
index da6d555..6917ea8 100644
--- a/profiles/gatt/gas.c
+++ b/profiles/gatt/gas.c
@@ -130,6 +130,19 @@ static int read_ctp_handle(bdaddr_t *sba, bdaddr_t *dba, uint8_t bdaddr_type,
return 0;
}
+static int delete_ctp_handle(bdaddr_t *sba, bdaddr_t *dba, uint8_t bdaddr_type,
+ uint16_t uuid)
+{
+ char filename[PATH_MAX + 1], addr[18], key[25];
+
+ create_filename(filename, PATH_MAX, sba, "gatt");
+
+ ba2str(dba, addr);
+ snprintf(key, sizeof(key), "%17s#%hhu#0x%04x", addr, bdaddr_type, uuid);
+
+ return textfile_del(filename, key);
+}
+
static void gap_appearance_cb(guint8 status, const guint8 *pdu, guint16 plen,
gpointer user_data)
{
@@ -403,7 +416,7 @@ int gas_register(struct btd_device *device, struct att_range *gap,
return 0;
}
-void gas_unregister(struct btd_device *device)
+void gas_unregister(struct btd_device *device, gboolean purge)
{
struct gas *gas;
GSList *l;
@@ -414,5 +427,16 @@ void gas_unregister(struct btd_device *device)
gas = l->data;
devices = g_slist_remove(devices, gas);
+
+ if (gas->changed_handle && purge) {
+ bdaddr_t sba, dba;
+ uint8_t bdaddr_type;
+
+ adapter_get_address(device_get_adapter(gas->device), &sba);
+ device_get_address(gas->device, &dba, &bdaddr_type);
+ delete_ctp_handle(&sba, &dba, bdaddr_type,
+ GATT_CHARAC_SERVICE_CHANGED);
+ }
+
gas_free(gas);
}
diff --git a/profiles/gatt/gas.h b/profiles/gatt/gas.h
index 34853c7..436a543 100644
--- a/profiles/gatt/gas.h
+++ b/profiles/gatt/gas.h
@@ -22,4 +22,4 @@
int gas_register(struct btd_device *device, struct att_range *gap,
struct att_range *gatt);
-void gas_unregister(struct btd_device *device);
+void gas_unregister(struct btd_device *device, gboolean purge);
diff --git a/profiles/gatt/manager.c b/profiles/gatt/manager.c
index 94921d2..0392a23 100644
--- a/profiles/gatt/manager.c
+++ b/profiles/gatt/manager.c
@@ -70,7 +70,7 @@ static int gatt_driver_probe(struct btd_profile *p, struct btd_device *device,
static void gatt_driver_remove(struct btd_profile *p,
struct btd_device *device, gboolean purge)
{
- gas_unregister(device);
+ gas_unregister(device, purge);
}
static struct btd_profile gatt_profile = {
--
1.7.12
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [RFC BlueZ v0 0/4] Remove profile specific storage
2012-09-28 20:01 [RFC BlueZ v0 0/4] Remove profile specific storage Claudio Takahasi
` (3 preceding siblings ...)
2012-09-28 20:01 ` [RFC BlueZ v0 4/4] gatt: Remove Service Changed handle from storage Claudio Takahasi
@ 2012-10-01 9:54 ` Johan Hedberg
4 siblings, 0 replies; 6+ messages in thread
From: Johan Hedberg @ 2012-10-01 9:54 UTC (permalink / raw)
To: Claudio Takahasi; +Cc: linux-bluetooth
Hi Claudio,
On Fri, Sep 28, 2012, Claudio Takahasi wrote:
> There is also a TODO file item: "Convert storage to user per-remote
> device directories and ini-file format". What is the idea? Should the
> core remove everything under the remote device address directory?
I hadn't thought of that previously (i.e. it's not the reason for the
proposed layout) but now that you mention it I think that'd be a nicer
way of handling this. I.e. let's let the core remove the per-device
directory and everything stored inside it so that the drivers themselves
do not need to differentiate between bluetoothd exit and device removal.
Johan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-10-01 9:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-28 20:01 [RFC BlueZ v0 0/4] Remove profile specific storage Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 1/4] core: Add purge parameter to profile remove Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 2/4] proximity: Remove alert level storage Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 3/4] proximity: Store Bluetooth Address type Claudio Takahasi
2012-09-28 20:01 ` [RFC BlueZ v0 4/4] gatt: Remove Service Changed handle from storage Claudio Takahasi
2012-10-01 9:54 ` [RFC BlueZ v0 0/4] Remove profile specific storage Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).