iso-tester: Fix checks of latency and interval
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 23 Jun 2023 21:17:46 +0000 (14:17 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 5 Jan 2024 13:34:03 +0000 (19:04 +0530)
Due to rounding of latency, BAP uses msec while HCI uses slots of
1.25 ms, values may not return an exact match which is fine since the
BAP QoS suggests they are the maximum latency/interval so values bellow
that shall be considered a match.

tools/iso-tester.c

index d6c79db..bbd5a47 100644 (file)
@@ -1480,14 +1480,14 @@ static int connect_iso_sock(struct test_data *data, uint8_t num, int sk)
 static bool check_io_qos(const struct bt_iso_io_qos *io1,
                                const struct bt_iso_io_qos *io2)
 {
-       if (io1->interval && io2->interval && io1->interval != io2->interval) {
-               tester_warn("Unexpected IO interval: %u != %u",
+       if (io1->interval && io2->interval && io1->interval > io2->interval) {
+               tester_warn("Unexpected IO interval: %u > %u",
                                io1->interval, io2->interval);
                return false;
        }
 
-       if (io1->latency && io2->latency && io1->latency != io2->latency) {
-               tester_warn("Unexpected IO latency: %u != %u",
+       if (io1->latency && io2->latency && io1->latency > io2->latency) {
+               tester_warn("Unexpected IO latency: %u > %u",
                                io1->latency, io2->latency);
                return false;
        }