def resolve_hex_path(filename): if filename == "connectivity": hex_version = config.get_connectivity_hex_version() filename = 'connectivity_{}_115k2_with_s132_3.1.hex'.format( hex_version) return os.path.join(connectivity_root, filename) elif filename == "connectivity_usb": hex_version = config.get_connectivity_hex_version() filename = 'connectivity_{}_usb_for_s132_3.hex'.format(hex_version) runner = CliRunner() # Creating connectivity dfu package with trigger interface args = [ "pkg", "generate", "--application", os.path.join(connectivity_root, filename), "--softdevice", os.path.join(connectivity_root, "s132_nrf52_3.1.0_softdevice.hex"), "--sd-req", "0", "--sd-id", "0x91", "--hw-version", "52", "--application-version", "0", os.path.join(connectivity_root, filename.replace(".hex", ".zip")) ] result = runner.invoke(cli, args) assert result.exit_code == 0, "Could not create DFU package for trigger interface test." return os.path.join(connectivity_root, filename.replace(".hex", ".zip")) else: filename = os.path.join(*filename.split("\\")) assert "SDK_ROOT" in os.environ, \ "Environment variable 'SDK_ROOT' must be exported" SDK_ROOT = os.environ["SDK_ROOT"] return os.path.join(SDK_ROOT, filename)
def resolve_hex_path(filename): if filename == "connectivity": hex_version = config.get_connectivity_hex_version() filename = 'connectivity_{}_115k2_with_s132_3.1.hex'.format(hex_version) return os.path.join(connectivity_root, filename) elif filename == "connectivity_usb": hex_version = config.get_connectivity_hex_version() filename = 'connectivity_{}_usb_for_s132_3.hex'.format(hex_version) runner = CliRunner() # Creating connectivity dfu package with trigger interface args = ["pkg", "generate", "--application", os.path.join(connectivity_root, filename), "--softdevice", os.path.join(connectivity_root, "s132_nrf52_3.1.0_softdevice.hex"), "--sd-req", "0", "--sd-id", "0x91", "--hw-version", "52", "--application-version", "0", os.path.join(connectivity_root, filename.replace(".hex", ".zip"))] result = runner.invoke(cli, args) assert result.exit_code == 0, "Could not create DFU package for trigger interface test." return os.path.join(connectivity_root, filename.replace(".hex", ".zip")) else: filename = os.path.join(*filename.split("\\")) assert "SDK_ROOT" in os.environ, \ "Environment variable 'SDK_ROOT' must be exported" SDK_ROOT = os.environ["SDK_ROOT"] return os.path.join(SDK_ROOT, filename)
def resolve_hex_path(filename): if filename == "connectivity": hex_version = config.get_connectivity_hex_version() filename = f'connectivity_{hex_version}_1m_with_s132_5.1.0.hex' return os.path.join(connectivity_root, filename) elif filename == "connectivity_usb": hex_version = config.get_connectivity_hex_version() filename = f'connectivity_{hex_version}_usb_with_s132_5.1.0_dfu_pkg.zip' return os.path.join(connectivity_root, filename) else: return os.path.join(*filename.split("\\"))
def resolve_hex_path(filename): if filename == "connectivity": hex_version = config.get_connectivity_hex_version() filename = 'connectivity_{}_115k2_with_s132_3.1.hex'.format( hex_version) return os.path.join(connectivity_root, filename) elif filename == "connectivity_usb": hex_version = config.get_connectivity_hex_version() filename = 'connectivity_{}_usb_with_s132_3.1.hex'.format(hex_version) return os.path.join(connectivity_root, filename) else: filename = os.path.join(*filename.split("\\")) assert "SDK_ROOT" in os.environ, \ "Environment variable 'SDK_ROOT' must be exported" SDK_ROOT = os.environ["SDK_ROOT"] return os.path.join(SDK_ROOT, filename)