From 49409754ae766fe5febc94b13241a093c43e180e Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Fri, 2 Jun 2023 00:10:12 -0700 Subject: [PATCH] in func --- selfdrive/car/hyundai/values.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/selfdrive/car/hyundai/values.py b/selfdrive/car/hyundai/values.py index 623381b095..27fbc0463a 100644 --- a/selfdrive/car/hyundai/values.py +++ b/selfdrive/car/hyundai/values.py @@ -343,14 +343,12 @@ FINGERPRINTS = { }], } -# TODO: use HYUNDAI_VERSION_REQUEST_LONG[1:]? -PLATFORM_CODE_REGEX = b'(?<=\xf1\x00)[A-Z]{2}[A-Za-z0-9]{0,2}' - def get_platform_codes(fw_versions: List[bytes]) -> Set[bytes]: + platform_code_regex = b'(?<=' + HYUNDAI_VERSION_REQUEST_LONG[1:] + b')[A-Z]{2}[A-Za-z0-9]{0,2}' codes = set() for fw in fw_versions: - matches = re.findall(PLATFORM_CODE_REGEX, fw) + matches = re.findall(platform_code_regex, fw) if len(matches): codes.add(matches[0]) return codes