diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2013-11-08 15:53:29 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-11-08 15:57:25 +0200 |
commit | d18c36e232d92b3bd1fa0e5599b470a769bc0834 (patch) | |
tree | 9b968ce18afab33c11397db63014c6bf9967e6d0 /android/hal-utils.c | |
parent | 97a5801394644ff87a9a7ec5b0042f598f2ffd1d (diff) | |
download | bluez-d18c36e232d92b3bd1fa0e5599b470a769bc0834.tar.gz |
android/debug: Convert uuid helper to use uint8_t buffer
At this moment Android uses uint8_t * and bt_uuid_t for representing
UUID for different HALs. Convert debug helper to use uint8_t * string.
Diffstat (limited to 'android/hal-utils.c')
-rw-r--r-- | android/hal-utils.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/android/hal-utils.c b/android/hal-utils.c index 84cfad1a8..96dc23469 100644 --- a/android/hal-utils.c +++ b/android/hal-utils.c @@ -17,8 +17,7 @@ #include <stdio.h> #include <string.h> - -#include <hardware/bluetooth.h> +#include <stdint.h> #include "hal-utils.h" @@ -28,15 +27,15 @@ * * returns string representation of uuid */ -char *bt_uuid_t2str(const bt_uuid_t *uuid, char *buf) +char *bt_uuid_t2str(const uint8_t *uuid, char *buf) { int shift = 0; - int i; + unsigned int i; int is_bt; - is_bt = !memcmp(&uuid->uu[4], &BT_BASE_UUID[4], sizeof(bt_uuid_t) - 4); + is_bt = !memcmp(&uuid[4], &BT_BASE_UUID[4], HAL_UUID_LEN - 4); - for (i = 0; i < (int) sizeof(bt_uuid_t); i++) { + for (i = 0; i < HAL_UUID_LEN; i++) { if (i == 4 && is_bt) break; @@ -44,13 +43,13 @@ char *bt_uuid_t2str(const bt_uuid_t *uuid, char *buf) buf[i * 2 + shift] = '-'; shift++; } - sprintf(buf + i * 2 + shift, "%02x", uuid->uu[i]); + sprintf(buf + i * 2 + shift, "%02x", uuid[i]); } return buf; } -char *btuuid2str(const bt_uuid_t *uuid) +char *btuuid2str(const uint8_t *uuid) { static char buf[MAX_UUID_STR_LEN]; |