diff options
author | Szymon Janc <szymon.janc@tieto.com> | 2012-09-04 16:41:32 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2012-09-05 12:30:54 +0300 |
commit | 885b72f1e3a93a470d89eeb0dceb6ea18d7ad7e9 (patch) | |
tree | 5d76ed8439e2fa1ba1d19732a9f8a4c53775541d /src/eir.c | |
parent | 149396765c0acead51ce798a5ca0a27b62174079 (diff) | |
download | bluez-885b72f1e3a93a470d89eeb0dceb6ea18d7ad7e9.tar.gz |
eir: Use bt_get_* helper functions to access unaligned memory
Diffstat (limited to 'src/eir.c')
-rw-r--r-- | src/eir.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -55,7 +55,8 @@ static void eir_parse_uuid16(struct eir_data *eir, void *data, uint8_t len) service.type = SDP_UUID16; for (i = 0; i < len / 2; i++, uuid16++) { - service.value.uuid16 = btohs(bt_get_unaligned(uuid16)); + service.value.uuid16 = bt_get_le16(uuid16); + uuid_str = bt_uuid2string(&service); eir->services = g_slist_append(eir->services, uuid_str); } @@ -70,7 +71,8 @@ static void eir_parse_uuid32(struct eir_data *eir, void *data, uint8_t len) service.type = SDP_UUID32; for (i = 0; i < len / 4; i++, uuid32++) { - service.value.uuid32 = btohl(bt_get_unaligned(uuid32)); + service.value.uuid32 = bt_get_le32(uuid32); + uuid_str = bt_uuid2string(&service); eir->services = g_slist_append(eir->services, uuid_str); } |