aboutsummaryrefslogtreecommitdiffstats
path: root/attrib/gatttool.c
diff options
context:
space:
mode:
Diffstat (limited to 'attrib/gatttool.c')
-rw-r--r--attrib/gatttool.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 18f32a22..4a663409 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -167,14 +167,13 @@ static void primary_cb(guint8 status, const guint8 *pdu, guint16 plen,
/* Each element contains: attribute handle, end group handle
* and attribute value */
length = list->len - 2 * sizeof(uint16_t);
- start = att_get_u16((uint16_t *) value);
- end = att_get_u16((uint16_t *) &value[2]);
+ start = att_get_u16(value);
+ end = att_get_u16(&value[2]);
g_print("attr handle = 0x%04x, end grp handle = 0x%04x, ",
start, end);
if (length == 2)
- sdp_uuid16_create(&uuid, att_get_u16((uint16_t *)
- &value[4]));
+ sdp_uuid16_create(&uuid, att_get_u16(&value[4]));
else
sdp_uuid128_create(&uuid, value + 4);
@@ -204,7 +203,7 @@ static void events_handler(const uint8_t *pdu, uint16_t len, gpointer user_data)
uint8_t opdu[ATT_MAX_MTU];
uint16_t handle, i, olen = 0;
- handle = att_get_u16((uint16_t *) &pdu[1]);
+ handle = att_get_u16(&pdu[1]);
switch (pdu[0]) {
case ATT_OP_HANDLE_NOTIFY:
@@ -279,15 +278,14 @@ static void char_discovered_cb(guint8 status, const guint8 *pdu, guint16 plen,
char uuidstr[MAX_LEN_UUID_STR];
uuid_t uuid;
- last = att_get_u16((uint16_t *) value);
+ last = att_get_u16(value);
g_print("handle = 0x%04x, char properties = 0x%02x, "
"char value handle = 0x%04x, ", last, value[2],
- att_get_u16((uint16_t *) &value[3]));
+ att_get_u16(&value[3]));
if (list->len == 7)
- sdp_uuid16_create(&uuid, att_get_u16((uint16_t *)
- &value[5]));
+ sdp_uuid16_create(&uuid, att_get_u16(&value[5]));
else
sdp_uuid128_create(&uuid, value + 5);
@@ -447,11 +445,10 @@ static void char_desc_cb(guint8 status, const guint8 *pdu, guint16 plen,
uuid_t uuid;
value = list->data[i];
- handle = att_get_u16((uint16_t *) value);
+ handle = att_get_u16(value);
if (format == 0x01)
- sdp_uuid16_create(&uuid, att_get_u16((uint16_t *)
- &value[2]));
+ sdp_uuid16_create(&uuid, att_get_u16(&value[2]));
else
sdp_uuid128_create(&uuid, &value[2]);