aboutsummaryrefslogtreecommitdiffstats
path: root/attrib
diff options
context:
space:
mode:
Diffstat (limited to 'attrib')
-rw-r--r--attrib/client.c10
-rw-r--r--attrib/gatt.c4
-rw-r--r--attrib/gatt.h3
-rw-r--r--attrib/gatttool.c2
-rw-r--r--attrib/interactive.c2
5 files changed, 10 insertions, 11 deletions
diff --git a/attrib/client.c b/attrib/client.c
index 7c01514a..c0e00c10 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -860,10 +860,10 @@ static void char_discovered_cb(GSList *characteristics, guint8 status,
}
if (previous_end)
- *previous_end = prim->end;
+ *previous_end = prim->range.end;
gatt_get_address(gatt, &sba, &dba);
- store_characteristics(&sba, &dba, prim->start, gatt->chars);
+ store_characteristics(&sba, &dba, prim->range.start, gatt->chars);
g_slist_foreach(gatt->chars, register_characteristic, gatt->path);
@@ -899,7 +899,7 @@ static void send_discover(GAttrib *attrib, gpointer user_data)
gatt->attrib = g_attrib_ref(attrib);
- gatt_discover_char(gatt->attrib, prim->start, prim->end, NULL,
+ gatt_discover_char(gatt->attrib, prim->range.start, prim->range.end, NULL,
char_discovered_cb, qchr);
}
@@ -1009,12 +1009,12 @@ static struct gatt_service *primary_register(DBusConnection *conn,
gatt->psm = psm;
gatt->conn = dbus_connection_ref(conn);
gatt->path = g_strdup_printf("%s/service%04x", device_path,
- prim->start);
+ prim->range.start);
g_dbus_register_interface(gatt->conn, gatt->path,
CHAR_INTERFACE, prim_methods,
NULL, NULL, gatt, NULL);
- gatt->chars = load_characteristics(gatt, prim->start);
+ gatt->chars = load_characteristics(gatt, prim->range.start);
g_slist_foreach(gatt->chars, register_characteristic, gatt->path);
return gatt;
diff --git a/attrib/gatt.c b/attrib/gatt.c
index 7cf718db..1c3ff78b 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
@@ -193,8 +193,8 @@ static void primary_all_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
err = ATT_ECODE_INSUFF_RESOURCES;
goto done;
}
- primary->start = start;
- primary->end = end;
+ primary->range.start = start;
+ primary->range.end = end;
bt_uuid_to_string(&uuid, primary->uuid, sizeof(primary->uuid));
dp->primaries = g_slist_append(dp->primaries, primary);
}
diff --git a/attrib/gatt.h b/attrib/gatt.h
index cf379145..1732270f 100644
--- a/attrib/gatt.h
+++ b/attrib/gatt.h
@@ -27,8 +27,7 @@ typedef void (*gatt_cb_t) (GSList *l, guint8 status, gpointer user_data);
struct gatt_primary {
char uuid[MAX_LEN_UUID_STR + 1];
- uint16_t start;
- uint16_t end;
+ struct att_range range;
};
struct gatt_char {
diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 24a85a4f..21514af9 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -148,7 +148,7 @@ static void primary_all_cb(GSList *services, guint8 status, gpointer user_data)
for (l = services; l; l = l->next) {
struct gatt_primary *prim = l->data;
g_print("attr handle = 0x%04x, end grp handle = 0x%04x "
- "uuid: %s\n", prim->start, prim->end, prim->uuid);
+ "uuid: %s\n", prim->range.start, prim->range.end, prim->uuid);
}
done:
diff --git a/attrib/interactive.c b/attrib/interactive.c
index 2d650d64..59418119 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -163,7 +163,7 @@ static void primary_all_cb(GSList *services, guint8 status, gpointer user_data)
for (l = services; l; l = l->next) {
struct gatt_primary *prim = l->data;
printf("attr handle: 0x%04x, end grp handle: 0x%04x "
- "uuid: %s\n", prim->start, prim->end, prim->uuid);
+ "uuid: %s\n", prim->range.start, prim->range.end, prim->uuid);
}
rl_forced_update_display();