forked from StikDebug/StikJIT
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStikJIT.swift
More file actions
41 lines (30 loc) · 1.16 KB
/
Copy pathStikJIT.swift
File metadata and controls
41 lines (30 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import Foundation
public enum StikJIT {
public enum Script: Sendable {
case universal
case legacy
var resourceName: String {
switch self {
case .universal: return "universal"
case .legacy: return "legacy"
}
}
}
public struct Configuration: Sendable {
public var deviceAddress: String
public var rsdPort: UInt16
public init(deviceAddress: String = "10.7.0.1", rsdPort: UInt16 = 49152) {
self.deviceAddress = deviceAddress
self.rsdPort = rsdPort
}
public static let `default` = Configuration()
}
public static func enableJIT(targetPID: Int32,
pairingFile: URL,
configuration: Configuration = .default,
script: Script = .universal,
progress: @escaping (String) -> Void = { _ in }) throws {
let session = JITSession(pairingFilePath: pairingFile.path, configuration: configuration)
try session.enableJIT(targetPID: targetPID, script: script, progress: progress)
}
}