aboutsummaryrefslogtreecommitdiffstats
path: root/attrib
diff options
context:
space:
mode:
Diffstat (limited to 'attrib')
-rw-r--r--attrib/att.h13
-rw-r--r--attrib/client.c12
-rw-r--r--attrib/gatt.c8
-rw-r--r--attrib/gatt.h13
-rw-r--r--attrib/gatttool.c4
-rw-r--r--attrib/interactive.c4
6 files changed, 27 insertions, 27 deletions
diff --git a/attrib/att.h b/attrib/att.h
index dc266f18..09511d22 100644
--- a/attrib/att.h
+++ b/attrib/att.h
@@ -148,19 +148,6 @@ struct att_range {
uint16_t end;
};
-struct att_primary {
- char uuid[MAX_LEN_UUID_STR + 1];
- uint16_t start;
- uint16_t end;
-};
-
-struct att_char {
- char uuid[MAX_LEN_UUID_STR + 1];
- uint16_t handle;
- uint8_t properties;
- uint16_t value_handle;
-};
-
/* These functions do byte conversion */
static inline uint8_t att_get_u8(const void *ptr)
{
diff --git a/attrib/client.c b/attrib/client.c
index 60cff016..7c01514a 100644
--- a/attrib/client.c
+++ b/attrib/client.c
@@ -68,7 +68,7 @@ struct query {
struct gatt_service {
struct btd_device *dev;
- struct att_primary *prim;
+ struct gatt_primary *prim;
DBusConnection *conn;
GAttrib *attrib;
guint attioid;
@@ -821,7 +821,7 @@ static void char_discovered_cb(GSList *characteristics, guint8 status,
DBusMessageIter iter, array_iter;
struct query_data *current = user_data;
struct gatt_service *gatt = current->gatt;
- struct att_primary *prim = gatt->prim;
+ struct gatt_primary *prim = gatt->prim;
uint16_t *previous_end = NULL;
GSList *l;
bdaddr_t sba, dba;
@@ -835,7 +835,7 @@ static void char_discovered_cb(GSList *characteristics, guint8 status,
}
for (l = characteristics; l; l = l->next) {
- struct att_char *current_chr = l->data;
+ struct gatt_char *current_chr = l->data;
struct characteristic *chr;
guint handle = current_chr->value_handle;
GSList *lchr;
@@ -895,7 +895,7 @@ static void send_discover(GAttrib *attrib, gpointer user_data)
{
struct query_data *qchr = user_data;
struct gatt_service *gatt = qchr->gatt;
- struct att_primary *prim = gatt->prim;
+ struct gatt_primary *prim = gatt->prim;
gatt->attrib = g_attrib_ref(attrib);
@@ -995,7 +995,7 @@ static GDBusMethodTable prim_methods[] = {
static struct gatt_service *primary_register(DBusConnection *conn,
struct btd_device *device,
- struct att_primary *prim,
+ struct gatt_primary *prim,
int psm)
{
struct gatt_service *gatt;
@@ -1027,7 +1027,7 @@ GSList *attrib_client_register(DBusConnection *connection,
GSList *l, *services;
for (l = primaries, services = NULL; l; l = l->next) {
- struct att_primary *prim = l->data;
+ struct gatt_primary *prim = l->data;
struct gatt_service *gatt;
gatt = primary_register(connection, device, prim, psm);
diff --git a/attrib/gatt.c b/attrib/gatt.c
index 452a4cf8..7cf718db 100644
--- a/attrib/gatt.c
+++ b/attrib/gatt.c
@@ -172,7 +172,7 @@ static void primary_all_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
for (i = 0, end = 0; i < list->num; i++) {
const uint8_t *data = list->data[i];
- struct att_primary *primary;
+ struct gatt_primary *primary;
bt_uuid_t uuid;
start = att_get_u16(&data[0]);
@@ -188,7 +188,7 @@ static void primary_all_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
continue;
}
- primary = g_try_new0(struct att_primary, 1);
+ primary = g_try_new0(struct gatt_primary, 1);
if (!primary) {
err = ATT_ECODE_INSUFF_RESOURCES;
goto done;
@@ -274,7 +274,7 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
for (i = 0; i < list->num; i++) {
uint8_t *value = list->data[i];
- struct att_char *chars;
+ struct gatt_char *chars;
bt_uuid_t uuid;
last = att_get_u16(value);
@@ -285,7 +285,7 @@ static void char_discovered_cb(guint8 status, const guint8 *ipdu, guint16 iplen,
} else
uuid = att_get_uuid128(&value[5]);
- chars = g_try_new0(struct att_char, 1);
+ chars = g_try_new0(struct gatt_char, 1);
if (!chars) {
err = ATT_ECODE_INSUFF_RESOURCES;
goto done;
diff --git a/attrib/gatt.h b/attrib/gatt.h
index c5f95ac4..cf379145 100644
--- a/attrib/gatt.h
+++ b/attrib/gatt.h
@@ -25,6 +25,19 @@
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 gatt_char {
+ char uuid[MAX_LEN_UUID_STR + 1];
+ uint16_t handle;
+ uint8_t properties;
+ uint16_t value_handle;
+};
+
guint gatt_discover_primary(GAttrib *attrib, bt_uuid_t *uuid, gatt_cb_t func,
gpointer user_data);
diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 17ee9136..24a85a4f 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -146,7 +146,7 @@ static void primary_all_cb(GSList *services, guint8 status, gpointer user_data)
}
for (l = services; l; l = l->next) {
- struct att_primary *prim = l->data;
+ 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);
}
@@ -201,7 +201,7 @@ static void char_discovered_cb(GSList *characteristics, guint8 status,
}
for (l = characteristics; l; l = l->next) {
- struct att_char *chars = l->data;
+ struct gatt_char *chars = l->data;
g_print("handle = 0x%04x, char properties = 0x%02x, char value "
"handle = 0x%04x, uuid = %s\n", chars->handle,
diff --git a/attrib/interactive.c b/attrib/interactive.c
index be814249..2d650d64 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -161,7 +161,7 @@ static void primary_all_cb(GSList *services, guint8 status, gpointer user_data)
printf("\n");
for (l = services; l; l = l->next) {
- struct att_primary *prim = l->data;
+ 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);
}
@@ -202,7 +202,7 @@ static void char_cb(GSList *characteristics, guint8 status, gpointer user_data)
printf("\n");
for (l = characteristics; l; l = l->next) {
- struct att_char *chars = l->data;
+ struct gatt_char *chars = l->data;
printf("handle: 0x%04x, char properties: 0x%02x, char value "
"handle: 0x%04x, uuid: %s\n", chars->handle,