summaryrefslogtreecommitdiff
path: root/attrib/gatttool.c
diff options
context:
space:
mode:
authorClaudio Takahasi <claudio.takahasi@openbossa.org>2014-03-24 16:25:38 -0300
committerJohan Hedberg <johan.hedberg@intel.com>2014-03-24 22:08:54 +0200
commit1a1e9b4fa98bec70229cc88fbc7bb7b143853dd7 (patch)
tree5eb0e48fb0de510e99a48f140bf690ca38a8870d /attrib/gatttool.c
parent91744cb56f13be246a8614800aea3065b46181d3 (diff)
downloadbluez-1a1e9b4fa98bec70229cc88fbc7bb7b143853dd7.tar.gz
Replace att_get_uuid128() by bswap_128()
GATT/ATT use little-endian byte order format for 128-bit UUID. No matter the system byte order representation, internally the core will handle 128-bit UUID on big-endian format.
Diffstat (limited to 'attrib/gatttool.c')
-rw-r--r--attrib/gatttool.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/attrib/gatttool.c b/attrib/gatttool.c
index 4eb252850..ca178ceff 100644
--- a/attrib/gatttool.c
+++ b/attrib/gatttool.c
@@ -428,8 +428,13 @@ static void char_desc_cb(guint8 status, const guint8 *pdu, guint16 plen,
if (format == 0x01)
bt_uuid16_create(&uuid, get_le16(&value[2]));
- else
- uuid = att_get_uuid128(&value[2]);
+ else {
+ uint128_t u128;
+
+ /* Converts from LE to BE byte order */
+ bswap_128(&value[2], &u128);
+ bt_uuid128_create(&uuid, u128);
+ }
bt_uuid_to_string(&uuid, uuidstr, MAX_LEN_UUID_STR);
g_print("handle = 0x%04x, uuid = %s\n", handle, uuidstr);