diff --git a/nordicsemi/zigbee/ota_flasher.py b/nordicsemi/zigbee/ota_flasher.py index b186e23..64fbf70 100644 --- a/nordicsemi/zigbee/ota_flasher.py +++ b/nordicsemi/zigbee/ota_flasher.py @@ -92,11 +92,15 @@ def _fw_check(self, path_to_file): '''Check if the path_to_file hexfile was flashed correctly''' try: result = self.verify(path_to_file) - except subprocess.CalledProcessError as e: - if (e.returncode == OTAFlasher.ERROR_CODE_VERIFY_ERROR): + except subprocess.CalledProcessError as e: # for pc-ble-driver <= 0.14.2, can be removed when requirements + # will be updated to >= 0.15.0 + if e.returncode == OTAFlasher.ERROR_CODE_VERIFY_ERROR: return False else: raise + except RuntimeError: # for pc-ble-driver >= 0.15.0 + return False + return (re.search(b'^Verified OK.$', result, re.MULTILINE) is not None) def fw_check(self):