device: handle a different signal for onboard profiles directory in ROM
This commit is contained in:
parent
86bab897d1
commit
d7ce636917
|
@ -1247,7 +1247,7 @@ class OnboardProfiles:
|
||||||
headers = []
|
headers = []
|
||||||
chunk = device.feature_request(FEATURE.ONBOARD_PROFILES, 0x50, 0, 0, 0, i)
|
chunk = device.feature_request(FEATURE.ONBOARD_PROFILES, 0x50, 0, 0, 0, i)
|
||||||
s = 0x00
|
s = 0x00
|
||||||
if chunk[0:4] == b"\x00\x00\x00\x00": # look in ROM instead
|
if chunk[0:4] == b"\x00\x00\x00\x00" or chunk[0:4] == b"\xFF\xFF\xFF\xFF": # look in ROM instead
|
||||||
chunk = device.feature_request(FEATURE.ONBOARD_PROFILES, 0x50, 0x01, 0, 0, i)
|
chunk = device.feature_request(FEATURE.ONBOARD_PROFILES, 0x50, 0x01, 0, 0, i)
|
||||||
s = 0x01
|
s = 0x01
|
||||||
while chunk[0:2] != b"\xff\xff":
|
while chunk[0:2] != b"\xff\xff":
|
||||||
|
|
|
@ -299,6 +299,28 @@ responses_profiles_rom = [ # OnboardProfile in ROM
|
||||||
Response("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 0x0950, "010100E0"),
|
Response("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 0x0950, "010100E0"),
|
||||||
Response("FFFFFFFFFFFFFFFFFFFFFFFFFF7C81AB", 0x0950, "010100EE"),
|
Response("FFFFFFFFFFFFFFFFFFFFFFFFFF7C81AB", 0x0950, "010100EE"),
|
||||||
]
|
]
|
||||||
|
responses_profiles_rom_2 = [ # OnboardProfile in ROM
|
||||||
|
Response("0104010101020100FE0200", 0x0900),
|
||||||
|
Response("FFFFFFFF", 0x0950, "00000000"),
|
||||||
|
Response("010101FF", 0x0950, "01000000"),
|
||||||
|
Response("FFFFFFFF", 0x0950, "01000004"),
|
||||||
|
Response("01010290018003000700140028FFFFFF", 0x0950, "01010000"),
|
||||||
|
Response("FFFF0000000000000000000000000000", 0x0950, "01010010"),
|
||||||
|
Response("8000FFFF900aFF00800204548000FFFF", 0x0950, "01010020"),
|
||||||
|
Response("900aFF00800204548000FFFF900aFF00", 0x0950, "01010030"),
|
||||||
|
Response("800204548000FFFF900aFF0080020454", 0x0950, "01010040"),
|
||||||
|
Response("8000FFFF900aFF00800204548000FFFF", 0x0950, "01010050"),
|
||||||
|
Response("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 0x0950, "01010060"),
|
||||||
|
Response("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 0x0950, "01010070"),
|
||||||
|
Response("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 0x0950, "01010080"),
|
||||||
|
Response("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 0x0950, "01010090"),
|
||||||
|
Response("54004500370000000000000000000000", 0x0950, "010100A0"),
|
||||||
|
Response("00000000000000000000000000000000", 0x0950, "010100B0"),
|
||||||
|
Response("00000000000000000000000000000000", 0x0950, "010100C0"),
|
||||||
|
Response("0A01020300500407000000FFFFFFFFFF", 0x0950, "010100D0"),
|
||||||
|
Response("FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF", 0x0950, "010100E0"),
|
||||||
|
Response("FFFFFFFFFFFFFFFFFFFFFFFFFF7C81AB", 0x0950, "010100EE"),
|
||||||
|
]
|
||||||
|
|
||||||
complex_responses_1 = [ # COLOR_LED_EFFECTS
|
complex_responses_1 = [ # COLOR_LED_EFFECTS
|
||||||
Response(4.2, 0x0010), # ping
|
Response(4.2, 0x0010), # ping
|
||||||
|
|
|
@ -775,6 +775,25 @@ hex2 = (
|
||||||
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
"FFFFFFFFFFFFFFFFFFFFFFFFFF27C9"
|
"FFFFFFFFFFFFFFFFFFFFFFFFFF27C9"
|
||||||
)
|
)
|
||||||
|
hex3 = (
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||||
|
"FFFFFFFFFFFFFFFFFFFFFFFFFF2307"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
|
@ -782,6 +801,7 @@ hex2 = (
|
||||||
[
|
[
|
||||||
(hex1, "TE7", 2, 1, 16, 0, [0x0190, 0x0380, 0x0700, 0x1400, 0x2800], "8000FFFF", "0A01020300500407000000"),
|
(hex1, "TE7", 2, 1, 16, 0, [0x0190, 0x0380, 0x0700, 0x1400, 0x2800], "8000FFFF", "0A01020300500407000000"),
|
||||||
(hex2, "", 2, 1, 16, 0, [0x0190, 0x0380, 0x0700, 0x1400, 0x2800], "8000FFFF", "0A01020300500407000000"),
|
(hex2, "", 2, 1, 16, 0, [0x0190, 0x0380, 0x0700, 0x1400, 0x2800], "8000FFFF", "0A01020300500407000000"),
|
||||||
|
(hex3, "", 2, 1, 16, 0, [0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF], "FFFFFFFF", "FFFFFFFFFFFFFFFFFFFFFF"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_OnboardProfile_bytes(hex, name, sector, enabled, buttons, gbuttons, resolutions, button, lighting):
|
def test_OnboardProfile_bytes(hex, name, sector, enabled, buttons, gbuttons, resolutions, button, lighting):
|
||||||
|
@ -802,6 +822,7 @@ def test_OnboardProfile_bytes(hex, name, sector, enabled, buttons, gbuttons, res
|
||||||
[
|
[
|
||||||
(hidpp.responses_profiles, "ONB", 1, 2, 2, 1, 254),
|
(hidpp.responses_profiles, "ONB", 1, 2, 2, 1, 254),
|
||||||
(hidpp.responses_profiles_rom, "ONB", 1, 2, 2, 1, 254),
|
(hidpp.responses_profiles_rom, "ONB", 1, 2, 2, 1, 254),
|
||||||
|
(hidpp.responses_profiles_rom_2, "ONB", 1, 2, 2, 1, 254),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
def test_OnboardProfiles_device(responses, name, count, buttons, gbuttons, sectors, size):
|
def test_OnboardProfiles_device(responses, name, count, buttons, gbuttons, sectors, size):
|
||||||
|
|
Loading…
Reference in New Issue