- i = sscanf(addr_str, "%X:%X:%X:%X:%X:%X", &addr[0], &addr[1], &addr[2], &addr[3], &addr[4], &addr[5]);
- if (i != BLUETOOTH_ADDRESS_LENGTH)
- BT_ERR("Invalid format string - [%s]", addr_str);
+ addr_hex->addr[0] = strtol(addr_str, &ptr5, 16);
+ addr_hex->addr[1] = strtol(ptr5 + 1, &ptr4, 16);
+ addr_hex->addr[2] = strtol(ptr4 + 1, &ptr3, 16);
+ addr_hex->addr[3] = strtol(ptr3 + 1, &ptr2, 16);
+ addr_hex->addr[4] = strtol(ptr2 + 1, &ptr1, 16);
+ addr_hex->addr[5] = strtol(ptr1 + 1, NULL, 16);
+}
+
+static char *__hps_convert_uuid_to_uuid128(const char *uuid)
+{
+ int len;
+ char *uuid128;
+
+ len = strlen(uuid);
+
+ switch (len) {
+ case 4:
+ /* UUID 16bits */
+ uuid128 = g_strdup_printf("0000%s-0000-1000-8000-00805F9B34FB", uuid);
+ break;
+
+ case 8:
+ /* UUID 32bits */
+ uuid128 = g_strdup_printf("%s-0000-1000-8000-00805F9B34FB", uuid);
+ break;
+
+ case 36:
+ /* UUID 128bits */
+ uuid128 = strdup(uuid);
+ break;