void bt_uuid_to_uuid128(const bt_uuid_t *src, bt_uuid_t *dst) { switch (src->type) { case BT_UUID128: *dst = *src; break; case BT_UUID32: bt_uuid32_to_uuid128(src, dst); break; case BT_UUID16: bt_uuid16_to_uuid128(src, dst); break; default: break; } }
int bt_uuid_to_le(const bt_uuid_t *src, void *dst) { bt_uuid_t uuid; switch (src->type) { case BT_UUID16: bt_put_le16(src->value.u16, dst); return 0; case BT_UUID32: bt_uuid32_to_uuid128(src, &uuid); src = &uuid; /* Fallthrough */ case BT_UUID128: /* Convert from 128-bit BE to LE */ bswap_128(&src->value.u128, dst); return 0; case BT_UUID_UNSPEC: default: return -EINVAL; } }