diff --git a/doc/settings-storage.txt b/doc/settings-storage.txt
index 351b17e..11b127f 100644
--- a/doc/settings-storage.txt
+++ b/doc/settings-storage.txt
Each group contains:
- UUID String 128-bit UUID of the attribute
+ UUID String 128-bit UUID of the attribute
- Value String Value of the attribute as hexadecimal encoded
- string
+ Value String Value of the attribute as hexadecimal encoded
+ string
+
+ EndGroupHandle Integer End group handle in decimal format
Sample:
[1]
diff --git a/src/adapter.c b/src/adapter.c
index 6753790..3282608 100644
--- a/src/adapter.c
+++ b/src/adapter.c
}
static void store_attribute_uuid(GKeyFile *key_file, uint16_t start,
- char *att_uuid, uuid_t uuid)
+ uint16_t end, char *att_uuid,
+ uuid_t uuid)
{
char handle[6], uuid_str[33];
int i;
sprintf(handle, "%hu", start);
g_key_file_set_string(key_file, handle, "UUID", att_uuid);
g_key_file_set_string(key_file, handle, "Value", uuid_str);
+ g_key_file_set_integer(key_file, handle, "EndGroupHandle", end);
}
static void store_sdp_record(char *local, char *peer, int handle, char *value)
key_file = g_key_file_new();
g_key_file_load_from_file(key_file, filename, 0, NULL);
- store_attribute_uuid(key_file, start, prim_uuid, uuid);
+ store_attribute_uuid(key_file, start, end, prim_uuid, uuid);
data = g_key_file_to_data(key_file, &length, NULL);
if (length > 0) {
bt_string2uuid(&uuid, uuid_str);
sdp_uuid128_to_uuid(&uuid);
- store_attribute_uuid(key_file, start, prim_uuid, uuid);
+ store_attribute_uuid(key_file, start, end, prim_uuid, uuid);
}
g_strfreev(services);
diff --git a/src/device.c b/src/device.c
index 8f82203..ffcf57c 100644
--- a/src/device.c
+++ b/src/device.c
for (handle = groups; *handle; handle++) {
gboolean uuid_ok;
+ gint end;
str = g_key_file_get_string(key_file, *handle, "UUID", NULL);
if (!str)
if (!str)
continue;
+ end = g_key_file_get_integer(key_file, *handle,
+ "EndGroupHandle", NULL);
+ if (end == 0) {
+ g_free(str);
+ continue;
+ }
+
prim = g_new0(struct gatt_primary, 1);
prim->range.start = atoi(*handle);
+ prim->range.end = end;
switch (strlen(str)) {
case 4:
g_key_file_set_string(key_file, handle, "UUID", prim_uuid);
g_key_file_set_string(key_file, handle, "Value", uuid_str);
+ g_key_file_set_integer(key_file, handle, "EndGroupHandle", end);
done:
g_free(prim_uuid);