feat(connector): add tests and run via XPC

This commit is contained in:
Anthony
2024-05-01 17:49:10 +01:00
parent 515c06e46a
commit 452756e3d3
2 changed files with 87 additions and 10 deletions

View File

@@ -26,4 +26,21 @@ class XPC {
return false
}
}
/**
* Sets a dataref in X-Plane to the set goal
*
* @param dref Dataref name in X-Plane to change the value for
* @param goal The value that should be set for the dataref in X-Plane
*
* @return `true` if successfully set, `false` otherwise
*/
@Throws(SocketException::class, IOException::class)
fun runChecklist(dref: String, goal: Int) : Boolean {
xpc.sendDREF(dref, goal.toFloat())
val result = xpc.getDREF(dref)
return goal.toFloat() == result[0]
}
}