int bt_uuid_cmp(const struct bt_uuid *u1, const struct bt_uuid *u2) { /* Convert to 128 bit if types don't match */ if (u1->type != u2->type) return uuid128_cmp(u1, u2); switch (u1->type) { case BT_UUID_TYPE_16: return (int)BT_UUID_16(u1)->val - (int)BT_UUID_16(u2)->val; case BT_UUID_TYPE_128: return memcmp(BT_UUID_128(u1)->val, BT_UUID_128(u2)->val, 16); } return -EINVAL; }
int is_anki_vehicle_service_uuid(uuid128_t *a) { static const uint8_t ANKI_SERVICE_UUID_BYTES[16] = ANKI_SERVICE_UUID_LE; return (uuid128_cmp(a, (uuid128_t *)ANKI_SERVICE_UUID_BYTES) == 0); }