diff --git a/quantum/os_detection.c b/quantum/os_detection.c index 2a5237dfc31..8c78e4c94eb 100644 --- a/quantum/os_detection.c +++ b/quantum/os_detection.c @@ -147,7 +147,7 @@ void process_wlength(const uint16_t w_length) { // now try to make a guess os_variant_t guessed = OS_UNSURE; if (setups_data.count >= 3) { - if (setups_data.cnt_ff >= 2 && setups_data.cnt_04 >= 1) { + if (setups_data.cnt_ff >= 2 && setups_data.cnt_04 >= 1 && setups_data.cnt_02 < 2) { guessed = OS_WINDOWS; } else if (setups_data.count == setups_data.cnt_ff) { // Linux has 3 packets with 0xFF. diff --git a/quantum/os_detection/tests/os_detection.cpp b/quantum/os_detection/tests/os_detection.cpp index 21c4536243e..6a1f0b9db3e 100644 --- a/quantum/os_detection/tests/os_detection.cpp +++ b/quantum/os_detection/tests/os_detection.cpp @@ -71,6 +71,7 @@ macOS 12.5: [2, 24, 2, 28, FF] macOS 15.1.x: [ 2, 4E, 2, 1C, 2, 1A, FF, FF] macOS 15.x (another host): [ 2, 0E, 2, 1E, 2, 42, FF] macOS 15.x (periodic weirdness): [ 2, 42, 2, 1C, 2, 1A, FF, 2, 42, 2, 1C, 2, 1A, FF ] +macOS 26.x: [02, 22, 02, 0E, 02, 42, FF, FF, 4, FF] iOS/iPadOS 15.6: [2, 24, 2, 28] Linux (including Android, Raspberry Pi and WebOS TV): [FF, FF, FF] Linux (another host): [FF, FF, FF, FF, FF, FF] @@ -163,6 +164,12 @@ TEST_F(OsDetectionTest, TestChibiosMacSequoia3) { assert_not_reported(); } +TEST_F(OsDetectionTest, TestChibiosMacosWithLate04Packet) { + EXPECT_EQ(check_sequence({0x02, 0x22, 0x02, 0x0E, 0x02, 0x42, 0xFF, 0xFF, 0x04, 0xFF}), OS_MACOS); + os_detection_task(); + assert_not_reported(); +} + TEST_F(OsDetectionTest, TestLufaMacos) { EXPECT_EQ(check_sequence({0x2, 0x10, 0x2, 0xE, 0xFF}), OS_MACOS); os_detection_task();