@@ -24,7 +24,7 @@ BASIC FUNCTIONS
|
|||||||
|
|
||||||
USE:
|
USE:
|
||||||
unsigned short portNumber = 49067;
|
unsigned short portNumber = 49067;
|
||||||
struct xpcSocket theSocket = openUDP(portNumber);
|
struct xpcSocket theSocket = openUDP(portNumber, “127.0.0.1”, 49009);
|
||||||
|
|
||||||
2. closeUDP closes an opened UDP Socket for communication. This is to be done after the program has finished using that socket. Use opedUDP to open socket.
|
2. closeUDP closes an opened UDP Socket for communication. This is to be done after the program has finished using that socket. Use opedUDP to open socket.
|
||||||
INPUT:
|
INPUT:
|
||||||
|
|||||||
@@ -238,7 +238,7 @@ short sendDATA(struct xpcSocket recfd, float dataRef[][9], unsigned short rows)
|
|||||||
|
|
||||||
short sendDREF(struct xpcSocket recfd, const char *dataRef, unsigned short length_of_DREF, float *values, unsigned short number_of_values) {
|
short sendDREF(struct xpcSocket recfd, const char *dataRef, unsigned short length_of_DREF, float *values, unsigned short number_of_values) {
|
||||||
char message[5000];
|
char message[5000];
|
||||||
int length = 6+length_of_DREF+number_of_values*sizeof(float);
|
int length = 7+length_of_DREF+number_of_values*sizeof(float);
|
||||||
|
|
||||||
//HEADER
|
//HEADER
|
||||||
strncpy(message,"DREF",4);
|
strncpy(message,"DREF",4);
|
||||||
@@ -285,7 +285,7 @@ short requestDREF(struct xpcSocket sendfd, struct xpcSocket recfd, char DREFArra
|
|||||||
|
|
||||||
sendRequest(sendfd, DREFArray, DREFSizes, listLength);
|
sendRequest(sendfd, DREFArray, DREFSizes, listLength);
|
||||||
|
|
||||||
for (i=0; i<40; i++)
|
for (i=0; i<80; i++)
|
||||||
{
|
{
|
||||||
int size = readDREF(recfd, resultArray, arraySizes);
|
int size = readDREF(recfd, resultArray, arraySizes);
|
||||||
if (size != -1) // Received input
|
if (size != -1) // Received input
|
||||||
@@ -404,7 +404,7 @@ short sendCTRL(struct xpcSocket recfd, short numArgs, float valueArray[])
|
|||||||
|
|
||||||
//READ
|
//READ
|
||||||
//----------------------------------------
|
//----------------------------------------
|
||||||
int readUDP(struct xpcSocket recfd, char *dataRef, struct sockaddr *recvaddr)
|
short readUDP(struct xpcSocket recfd, char *dataRef, struct sockaddr *recvaddr)
|
||||||
{
|
{
|
||||||
socklen_t recvaddrlen = sizeof(*recvaddr);
|
socklen_t recvaddrlen = sizeof(*recvaddr);
|
||||||
int status = 0;
|
int status = 0;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
struct xpcSocket openUDP(unsigned short port, const char *xpIP, unsigned short xpPort);
|
struct xpcSocket openUDP(unsigned short port, const char *xpIP, unsigned short xpPort);
|
||||||
void closeUDP(struct xpcSocket);
|
void closeUDP(struct xpcSocket);
|
||||||
short sendUDP(struct xpcSocket recfd, char my_message[], short messageLength);
|
short sendUDP(struct xpcSocket recfd, char my_message[], short messageLength);
|
||||||
int readUDP(struct xpcSocket recfd, char *dataRef, struct sockaddr *recvaddr);
|
short readUDP(struct xpcSocket recfd, char *dataRef, struct sockaddr *recvaddr);
|
||||||
|
|
||||||
// Configuration
|
// Configuration
|
||||||
short setCONN(struct xpcSocket recfd, unsigned short recPort);
|
short setCONN(struct xpcSocket recfd, unsigned short recPort);
|
||||||
|
|||||||
Binary file not shown.
@@ -2,22 +2,4 @@
|
|||||||
<Bucket
|
<Bucket
|
||||||
type = "1"
|
type = "1"
|
||||||
version = "2.0">
|
version = "2.0">
|
||||||
<Breakpoints>
|
|
||||||
<BreakpointProxy
|
|
||||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
||||||
<BreakpointContent
|
|
||||||
shouldBeEnabled = "No"
|
|
||||||
ignoreCount = "0"
|
|
||||||
continueAfterRunningActions = "No"
|
|
||||||
filePath = "../src/xplaneConnect.c"
|
|
||||||
timestampString = "433458275.8587"
|
|
||||||
startingColumnNumber = "9223372036854775807"
|
|
||||||
endingColumnNumber = "9223372036854775807"
|
|
||||||
startingLineNumber = "342"
|
|
||||||
endingLineNumber = "342"
|
|
||||||
landmarkName = "setCONN()"
|
|
||||||
landmarkType = "7">
|
|
||||||
</BreakpointContent>
|
|
||||||
</BreakpointProxy>
|
|
||||||
</Breakpoints>
|
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
|||||||
241
TestScripts/XPC Tests/Cpp Tests.xcodeproj/project.pbxproj
Normal file
241
TestScripts/XPC Tests/Cpp Tests.xcodeproj/project.pbxproj
Normal file
@@ -0,0 +1,241 @@
|
|||||||
|
// !$*UTF8*$!
|
||||||
|
{
|
||||||
|
archiveVersion = 1;
|
||||||
|
classes = {
|
||||||
|
};
|
||||||
|
objectVersion = 46;
|
||||||
|
objects = {
|
||||||
|
|
||||||
|
/* Begin PBXBuildFile section */
|
||||||
|
BE9C6BAF1A253FA100EBE08A /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BE9C6BAE1A253FA100EBE08A /* main.cpp */; };
|
||||||
|
BE9C6BB11A253FA100EBE08A /* XPC_Tests.1 in CopyFiles */ = {isa = PBXBuildFile; fileRef = BE9C6BB01A253FA100EBE08A /* XPC_Tests.1 */; };
|
||||||
|
BE9C6BB91A25402300EBE08A /* xplaneConnect.c in Sources */ = {isa = PBXBuildFile; fileRef = BE9C6BB71A25402300EBE08A /* xplaneConnect.c */; };
|
||||||
|
BE9C6BBA1A25402300EBE08A /* xplaneConnect.h in Sources */ = {isa = PBXBuildFile; fileRef = BE9C6BB81A25402300EBE08A /* xplaneConnect.h */; };
|
||||||
|
/* End PBXBuildFile section */
|
||||||
|
|
||||||
|
/* Begin PBXCopyFilesBuildPhase section */
|
||||||
|
BE9C6BA91A253FA100EBE08A /* CopyFiles */ = {
|
||||||
|
isa = PBXCopyFilesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
dstPath = /usr/share/man/man1/;
|
||||||
|
dstSubfolderSpec = 0;
|
||||||
|
files = (
|
||||||
|
BE9C6BB11A253FA100EBE08A /* XPC_Tests.1 in CopyFiles */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 1;
|
||||||
|
};
|
||||||
|
/* End PBXCopyFilesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXFileReference section */
|
||||||
|
BE9C6BAB1A253FA100EBE08A /* Cpp Tests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "Cpp Tests"; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||||
|
BE9C6BAE1A253FA100EBE08A /* main.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = main.cpp; sourceTree = "<group>"; };
|
||||||
|
BE9C6BB01A253FA100EBE08A /* XPC_Tests.1 */ = {isa = PBXFileReference; lastKnownFileType = text.man; path = XPC_Tests.1; sourceTree = "<group>"; };
|
||||||
|
BE9C6BB71A25402300EBE08A /* xplaneConnect.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = xplaneConnect.c; path = ../../C/src/xplaneConnect.c; sourceTree = "<group>"; };
|
||||||
|
BE9C6BB81A25402300EBE08A /* xplaneConnect.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = xplaneConnect.h; path = ../../C/src/xplaneConnect.h; sourceTree = "<group>"; };
|
||||||
|
/* End PBXFileReference section */
|
||||||
|
|
||||||
|
/* Begin PBXFrameworksBuildPhase section */
|
||||||
|
BE9C6BA81A253FA100EBE08A /* Frameworks */ = {
|
||||||
|
isa = PBXFrameworksBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXFrameworksBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin PBXGroup section */
|
||||||
|
BE9C6BA21A253FA100EBE08A = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
BE9C6BB71A25402300EBE08A /* xplaneConnect.c */,
|
||||||
|
BE9C6BB81A25402300EBE08A /* xplaneConnect.h */,
|
||||||
|
BE9C6BAD1A253FA100EBE08A /* Cpp Tests */,
|
||||||
|
BE9C6BAC1A253FA100EBE08A /* Products */,
|
||||||
|
);
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
BE9C6BAC1A253FA100EBE08A /* Products */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
BE9C6BAB1A253FA100EBE08A /* Cpp Tests */,
|
||||||
|
);
|
||||||
|
name = Products;
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
BE9C6BAD1A253FA100EBE08A /* Cpp Tests */ = {
|
||||||
|
isa = PBXGroup;
|
||||||
|
children = (
|
||||||
|
BE9C6BAE1A253FA100EBE08A /* main.cpp */,
|
||||||
|
BE9C6BB01A253FA100EBE08A /* XPC_Tests.1 */,
|
||||||
|
);
|
||||||
|
name = "Cpp Tests";
|
||||||
|
path = "XPC Tests";
|
||||||
|
sourceTree = "<group>";
|
||||||
|
};
|
||||||
|
/* End PBXGroup section */
|
||||||
|
|
||||||
|
/* Begin PBXNativeTarget section */
|
||||||
|
BE9C6BAA1A253FA100EBE08A /* Cpp Tests */ = {
|
||||||
|
isa = PBXNativeTarget;
|
||||||
|
buildConfigurationList = BE9C6BB41A253FA100EBE08A /* Build configuration list for PBXNativeTarget "Cpp Tests" */;
|
||||||
|
buildPhases = (
|
||||||
|
BE9C6BA71A253FA100EBE08A /* Sources */,
|
||||||
|
BE9C6BA81A253FA100EBE08A /* Frameworks */,
|
||||||
|
BE9C6BA91A253FA100EBE08A /* CopyFiles */,
|
||||||
|
);
|
||||||
|
buildRules = (
|
||||||
|
);
|
||||||
|
dependencies = (
|
||||||
|
);
|
||||||
|
name = "Cpp Tests";
|
||||||
|
productName = "XPC Tests";
|
||||||
|
productReference = BE9C6BAB1A253FA100EBE08A /* Cpp Tests */;
|
||||||
|
productType = "com.apple.product-type.tool";
|
||||||
|
};
|
||||||
|
/* End PBXNativeTarget section */
|
||||||
|
|
||||||
|
/* Begin PBXProject section */
|
||||||
|
BE9C6BA31A253FA100EBE08A /* Project object */ = {
|
||||||
|
isa = PBXProject;
|
||||||
|
attributes = {
|
||||||
|
LastUpgradeCheck = 0500;
|
||||||
|
ORGANIZATIONNAME = "Chris Teubert";
|
||||||
|
};
|
||||||
|
buildConfigurationList = BE9C6BA61A253FA100EBE08A /* Build configuration list for PBXProject "Cpp Tests" */;
|
||||||
|
compatibilityVersion = "Xcode 3.2";
|
||||||
|
developmentRegion = English;
|
||||||
|
hasScannedForEncodings = 0;
|
||||||
|
knownRegions = (
|
||||||
|
en,
|
||||||
|
);
|
||||||
|
mainGroup = BE9C6BA21A253FA100EBE08A;
|
||||||
|
productRefGroup = BE9C6BAC1A253FA100EBE08A /* Products */;
|
||||||
|
projectDirPath = "";
|
||||||
|
projectRoot = "";
|
||||||
|
targets = (
|
||||||
|
BE9C6BAA1A253FA100EBE08A /* Cpp Tests */,
|
||||||
|
);
|
||||||
|
};
|
||||||
|
/* End PBXProject section */
|
||||||
|
|
||||||
|
/* Begin PBXSourcesBuildPhase section */
|
||||||
|
BE9C6BA71A253FA100EBE08A /* Sources */ = {
|
||||||
|
isa = PBXSourcesBuildPhase;
|
||||||
|
buildActionMask = 2147483647;
|
||||||
|
files = (
|
||||||
|
BE9C6BB91A25402300EBE08A /* xplaneConnect.c in Sources */,
|
||||||
|
BE9C6BBA1A25402300EBE08A /* xplaneConnect.h in Sources */,
|
||||||
|
BE9C6BAF1A253FA100EBE08A /* main.cpp in Sources */,
|
||||||
|
);
|
||||||
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
|
};
|
||||||
|
/* End PBXSourcesBuildPhase section */
|
||||||
|
|
||||||
|
/* Begin XCBuildConfiguration section */
|
||||||
|
BE9C6BB21A253FA100EBE08A /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_DYNAMIC_NO_PIC = NO;
|
||||||
|
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||||
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
|
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||||
|
"DEBUG=1",
|
||||||
|
"$(inherited)",
|
||||||
|
);
|
||||||
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||||
|
ONLY_ACTIVE_ARCH = YES;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
BE9C6BB31A253FA100EBE08A /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||||
|
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
|
||||||
|
CLANG_CXX_LIBRARY = "libc++";
|
||||||
|
CLANG_ENABLE_OBJC_ARC = YES;
|
||||||
|
CLANG_WARN_BOOL_CONVERSION = YES;
|
||||||
|
CLANG_WARN_CONSTANT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
|
||||||
|
CLANG_WARN_EMPTY_BODY = YES;
|
||||||
|
CLANG_WARN_ENUM_CONVERSION = YES;
|
||||||
|
CLANG_WARN_INT_CONVERSION = YES;
|
||||||
|
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
|
||||||
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
|
COPY_PHASE_STRIP = YES;
|
||||||
|
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
|
||||||
|
ENABLE_NS_ASSERTIONS = NO;
|
||||||
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_ENABLE_OBJC_EXCEPTIONS = YES;
|
||||||
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
|
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
|
||||||
|
GCC_WARN_UNDECLARED_SELECTOR = YES;
|
||||||
|
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||||
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
|
MACOSX_DEPLOYMENT_TARGET = 10.9;
|
||||||
|
SDKROOT = macosx;
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
BE9C6BB51A253FA100EBE08A /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
PRODUCT_NAME = "Cpp Tests";
|
||||||
|
};
|
||||||
|
name = Debug;
|
||||||
|
};
|
||||||
|
BE9C6BB61A253FA100EBE08A /* Release */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
PRODUCT_NAME = "Cpp Tests";
|
||||||
|
};
|
||||||
|
name = Release;
|
||||||
|
};
|
||||||
|
/* End XCBuildConfiguration section */
|
||||||
|
|
||||||
|
/* Begin XCConfigurationList section */
|
||||||
|
BE9C6BA61A253FA100EBE08A /* Build configuration list for PBXProject "Cpp Tests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
BE9C6BB21A253FA100EBE08A /* Debug */,
|
||||||
|
BE9C6BB31A253FA100EBE08A /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
defaultConfigurationName = Release;
|
||||||
|
};
|
||||||
|
BE9C6BB41A253FA100EBE08A /* Build configuration list for PBXNativeTarget "Cpp Tests" */ = {
|
||||||
|
isa = XCConfigurationList;
|
||||||
|
buildConfigurations = (
|
||||||
|
BE9C6BB51A253FA100EBE08A /* Debug */,
|
||||||
|
BE9C6BB61A253FA100EBE08A /* Release */,
|
||||||
|
);
|
||||||
|
defaultConfigurationIsVisible = 0;
|
||||||
|
};
|
||||||
|
/* End XCConfigurationList section */
|
||||||
|
};
|
||||||
|
rootObject = BE9C6BA31A253FA100EBE08A /* Project object */;
|
||||||
|
}
|
||||||
7
TestScripts/XPC Tests/Cpp Tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
7
TestScripts/XPC Tests/Cpp Tests.xcodeproj/project.xcworkspace/contents.xcworkspacedata
generated
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Workspace
|
||||||
|
version = "1.0">
|
||||||
|
<FileRef
|
||||||
|
location = "self:Cpp Tests.xcodeproj">
|
||||||
|
</FileRef>
|
||||||
|
</Workspace>
|
||||||
@@ -5,41 +5,36 @@
|
|||||||
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||||
<false/>
|
<false/>
|
||||||
<key>IDESourceControlProjectIdentifier</key>
|
<key>IDESourceControlProjectIdentifier</key>
|
||||||
<string>21287B4B-5984-406D-973A-1E0A4616A1E3</string>
|
<string>416D1A24-40F3-4397-8D94-7BF209A1B094</string>
|
||||||
<key>IDESourceControlProjectName</key>
|
<key>IDESourceControlProjectName</key>
|
||||||
<string>xpcPlugin</string>
|
<string>Cpp Tests</string>
|
||||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>D7B4D224-FE26-406E-A48F-C604A5BE6975</key>
|
<key>C03F0B00-9A73-4E8C-88E5-1BC53A92AE34</key>
|
||||||
<string>https://babelfish.arc.nasa.gov/svn/pcoe/cteubert/xplaneconnect</string>
|
<string>https://github.com/nasa/XPlaneConnect.git</string>
|
||||||
</dict>
|
</dict>
|
||||||
<key>IDESourceControlProjectPath</key>
|
<key>IDESourceControlProjectPath</key>
|
||||||
<string>xpcPlugin/xpcPlugin.xcodeproj/project.xcworkspace</string>
|
<string>TestScripts/XPC Tests/Cpp Tests.xcodeproj/project.xcworkspace</string>
|
||||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||||
<dict>
|
<dict>
|
||||||
<key>D7B4D224-FE26-406E-A48F-C604A5BE6975</key>
|
<key>C03F0B00-9A73-4E8C-88E5-1BC53A92AE34</key>
|
||||||
<string>../../..</string>
|
<string>../../../..</string>
|
||||||
</dict>
|
|
||||||
<key>IDESourceControlProjectRepositoryRootDictionary</key>
|
|
||||||
<dict>
|
|
||||||
<key>D7B4D224-FE26-406E-A48F-C604A5BE6975</key>
|
|
||||||
<string>https://babelfish.arc.nasa.gov/svn/pcoe</string>
|
|
||||||
</dict>
|
</dict>
|
||||||
<key>IDESourceControlProjectURL</key>
|
<key>IDESourceControlProjectURL</key>
|
||||||
<string>https://babelfish.arc.nasa.gov/svn/pcoe/cteubert/xplaneconnect/xpcPlugin/xpcPlugin.xcodeproj</string>
|
<string>https://github.com/nasa/XPlaneConnect.git</string>
|
||||||
<key>IDESourceControlProjectVersion</key>
|
<key>IDESourceControlProjectVersion</key>
|
||||||
<integer>110</integer>
|
<integer>110</integer>
|
||||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||||
<string>D7B4D224-FE26-406E-A48F-C604A5BE6975</string>
|
<string>C03F0B00-9A73-4E8C-88E5-1BC53A92AE34</string>
|
||||||
<key>IDESourceControlProjectWCConfigurations</key>
|
<key>IDESourceControlProjectWCConfigurations</key>
|
||||||
<array>
|
<array>
|
||||||
<dict>
|
<dict>
|
||||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||||
<string>public.vcs.subversion</string>
|
<string>public.vcs.git</string>
|
||||||
<key>IDESourceControlWCCIdentifierKey</key>
|
<key>IDESourceControlWCCIdentifierKey</key>
|
||||||
<string>D7B4D224-FE26-406E-A48F-C604A5BE6975</string>
|
<string>C03F0B00-9A73-4E8C-88E5-1BC53A92AE34</string>
|
||||||
<key>IDESourceControlWCCName</key>
|
<key>IDESourceControlWCCName</key>
|
||||||
<string>xplaneconnect</string>
|
<string>XPlaneConnect</string>
|
||||||
</dict>
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
|
||||||
|
<false/>
|
||||||
|
<key>IDESourceControlProjectIdentifier</key>
|
||||||
|
<string>4A17B3D8-572A-4F80-980D-4FB2F0EF3BB4</string>
|
||||||
|
<key>IDESourceControlProjectName</key>
|
||||||
|
<string>XPC Tests</string>
|
||||||
|
<key>IDESourceControlProjectOriginsDictionary</key>
|
||||||
|
<dict>
|
||||||
|
<key>5FCAB004-C765-4A77-A8FD-03E66A1CDF6C</key>
|
||||||
|
<string>https://github.com/nasa/XPlaneConnect.git</string>
|
||||||
|
</dict>
|
||||||
|
<key>IDESourceControlProjectPath</key>
|
||||||
|
<string>TestScripts/XPC Tests/XPC Tests.xcodeproj/project.xcworkspace</string>
|
||||||
|
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
||||||
|
<dict>
|
||||||
|
<key>5FCAB004-C765-4A77-A8FD-03E66A1CDF6C</key>
|
||||||
|
<string>../../../..</string>
|
||||||
|
</dict>
|
||||||
|
<key>IDESourceControlProjectURL</key>
|
||||||
|
<string>https://github.com/nasa/XPlaneConnect.git</string>
|
||||||
|
<key>IDESourceControlProjectVersion</key>
|
||||||
|
<integer>110</integer>
|
||||||
|
<key>IDESourceControlProjectWCCIdentifier</key>
|
||||||
|
<string>5FCAB004-C765-4A77-A8FD-03E66A1CDF6C</string>
|
||||||
|
<key>IDESourceControlProjectWCConfigurations</key>
|
||||||
|
<array>
|
||||||
|
<dict>
|
||||||
|
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
||||||
|
<string>public.vcs.git</string>
|
||||||
|
<key>IDESourceControlWCCIdentifierKey</key>
|
||||||
|
<string>5FCAB004-C765-4A77-A8FD-03E66A1CDF6C</string>
|
||||||
|
<key>IDESourceControlWCCName</key>
|
||||||
|
<string>XPlaneConnect</string>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
Binary file not shown.
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key>
|
||||||
|
<true/>
|
||||||
|
<key>SnapshotAutomaticallyBeforeSignificantChanges</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Bucket
|
||||||
|
type = "1"
|
||||||
|
version = "2.0">
|
||||||
|
</Bucket>
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<Scheme
|
||||||
|
LastUpgradeVersion = "0500"
|
||||||
|
version = "1.3">
|
||||||
|
<BuildAction
|
||||||
|
parallelizeBuildables = "YES"
|
||||||
|
buildImplicitDependencies = "YES">
|
||||||
|
<BuildActionEntries>
|
||||||
|
<BuildActionEntry
|
||||||
|
buildForTesting = "YES"
|
||||||
|
buildForRunning = "YES"
|
||||||
|
buildForProfiling = "YES"
|
||||||
|
buildForArchiving = "YES"
|
||||||
|
buildForAnalyzing = "YES">
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "BE9C6BAA1A253FA100EBE08A"
|
||||||
|
BuildableName = "Cpp Tests"
|
||||||
|
BlueprintName = "Cpp Tests"
|
||||||
|
ReferencedContainer = "container:Cpp Tests.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildActionEntry>
|
||||||
|
</BuildActionEntries>
|
||||||
|
</BuildAction>
|
||||||
|
<TestAction
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
<Testables>
|
||||||
|
</Testables>
|
||||||
|
<MacroExpansion>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "BE9C6BAA1A253FA100EBE08A"
|
||||||
|
BuildableName = "Cpp Tests"
|
||||||
|
BlueprintName = "Cpp Tests"
|
||||||
|
ReferencedContainer = "container:Cpp Tests.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</MacroExpansion>
|
||||||
|
</TestAction>
|
||||||
|
<LaunchAction
|
||||||
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
|
launchStyle = "0"
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
buildConfiguration = "Debug"
|
||||||
|
ignoresPersistentStateOnLaunch = "NO"
|
||||||
|
debugDocumentVersioning = "YES"
|
||||||
|
allowLocationSimulation = "YES">
|
||||||
|
<BuildableProductRunnable>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "BE9C6BAA1A253FA100EBE08A"
|
||||||
|
BuildableName = "Cpp Tests"
|
||||||
|
BlueprintName = "Cpp Tests"
|
||||||
|
ReferencedContainer = "container:Cpp Tests.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
<AdditionalOptions>
|
||||||
|
</AdditionalOptions>
|
||||||
|
</LaunchAction>
|
||||||
|
<ProfileAction
|
||||||
|
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||||
|
savedToolIdentifier = ""
|
||||||
|
useCustomWorkingDirectory = "NO"
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
debugDocumentVersioning = "YES">
|
||||||
|
<BuildableProductRunnable>
|
||||||
|
<BuildableReference
|
||||||
|
BuildableIdentifier = "primary"
|
||||||
|
BlueprintIdentifier = "BE9C6BAA1A253FA100EBE08A"
|
||||||
|
BuildableName = "Cpp Tests"
|
||||||
|
BlueprintName = "Cpp Tests"
|
||||||
|
ReferencedContainer = "container:Cpp Tests.xcodeproj">
|
||||||
|
</BuildableReference>
|
||||||
|
</BuildableProductRunnable>
|
||||||
|
</ProfileAction>
|
||||||
|
<AnalyzeAction
|
||||||
|
buildConfiguration = "Debug">
|
||||||
|
</AnalyzeAction>
|
||||||
|
<ArchiveAction
|
||||||
|
buildConfiguration = "Release"
|
||||||
|
revealArchiveInOrganizer = "YES">
|
||||||
|
</ArchiveAction>
|
||||||
|
</Scheme>
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
|
<plist version="1.0">
|
||||||
|
<dict>
|
||||||
|
<key>SchemeUserState</key>
|
||||||
|
<dict>
|
||||||
|
<key>XPC Tests.xcscheme</key>
|
||||||
|
<dict>
|
||||||
|
<key>orderHint</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
<key>SuppressBuildableAutocreation</key>
|
||||||
|
<dict>
|
||||||
|
<key>BE9C6BAA1A253FA100EBE08A</key>
|
||||||
|
<dict>
|
||||||
|
<key>primary</key>
|
||||||
|
<true/>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</dict>
|
||||||
|
</plist>
|
||||||
79
TestScripts/XPC Tests/XPC Tests/XPC_Tests.1
Normal file
79
TestScripts/XPC Tests/XPC Tests/XPC_Tests.1
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
.\"Modified from man(1) of FreeBSD, the NetBSD mdoc.template, and mdoc.samples.
|
||||||
|
.\"See Also:
|
||||||
|
.\"man mdoc.samples for a complete listing of options
|
||||||
|
.\"man mdoc for the short list of editing options
|
||||||
|
.\"/usr/share/misc/mdoc.template
|
||||||
|
.Dd 11/25/14 \" DATE
|
||||||
|
.Dt XPC Tests 1 \" Program name and manual section number
|
||||||
|
.Os Darwin
|
||||||
|
.Sh NAME \" Section Header - required - don't modify
|
||||||
|
.Nm XPC Tests,
|
||||||
|
.\" The following lines are read in generating the apropos(man -k) database. Use only key
|
||||||
|
.\" words here as the database is built based on the words here and in the .ND line.
|
||||||
|
.Nm Other_name_for_same_program(),
|
||||||
|
.Nm Yet another name for the same program.
|
||||||
|
.\" Use .Nm macro to designate other names for the documented program.
|
||||||
|
.Nd This line parsed for whatis database.
|
||||||
|
.Sh SYNOPSIS \" Section Header - required - don't modify
|
||||||
|
.Nm
|
||||||
|
.Op Fl abcd \" [-abcd]
|
||||||
|
.Op Fl a Ar path \" [-a path]
|
||||||
|
.Op Ar file \" [file]
|
||||||
|
.Op Ar \" [file ...]
|
||||||
|
.Ar arg0 \" Underlined argument - use .Ar anywhere to underline
|
||||||
|
arg2 ... \" Arguments
|
||||||
|
.Sh DESCRIPTION \" Section Header - required - don't modify
|
||||||
|
Use the .Nm macro to refer to your program throughout the man page like such:
|
||||||
|
.Nm
|
||||||
|
Underlining is accomplished with the .Ar macro like this:
|
||||||
|
.Ar underlined text .
|
||||||
|
.Pp \" Inserts a space
|
||||||
|
A list of items with descriptions:
|
||||||
|
.Bl -tag -width -indent \" Begins a tagged list
|
||||||
|
.It item a \" Each item preceded by .It macro
|
||||||
|
Description of item a
|
||||||
|
.It item b
|
||||||
|
Description of item b
|
||||||
|
.El \" Ends the list
|
||||||
|
.Pp
|
||||||
|
A list of flags and their descriptions:
|
||||||
|
.Bl -tag -width -indent \" Differs from above in tag removed
|
||||||
|
.It Fl a \"-a flag as a list item
|
||||||
|
Description of -a flag
|
||||||
|
.It Fl b
|
||||||
|
Description of -b flag
|
||||||
|
.El \" Ends the list
|
||||||
|
.Pp
|
||||||
|
.\" .Sh ENVIRONMENT \" May not be needed
|
||||||
|
.\" .Bl -tag -width "ENV_VAR_1" -indent \" ENV_VAR_1 is width of the string ENV_VAR_1
|
||||||
|
.\" .It Ev ENV_VAR_1
|
||||||
|
.\" Description of ENV_VAR_1
|
||||||
|
.\" .It Ev ENV_VAR_2
|
||||||
|
.\" Description of ENV_VAR_2
|
||||||
|
.\" .El
|
||||||
|
.Sh FILES \" File used or created by the topic of the man page
|
||||||
|
.Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact
|
||||||
|
.It Pa /usr/share/file_name
|
||||||
|
FILE_1 description
|
||||||
|
.It Pa /Users/joeuser/Library/really_long_file_name
|
||||||
|
FILE_2 description
|
||||||
|
.El \" Ends the list
|
||||||
|
.\" .Sh DIAGNOSTICS \" May not be needed
|
||||||
|
.\" .Bl -diag
|
||||||
|
.\" .It Diagnostic Tag
|
||||||
|
.\" Diagnostic informtion here.
|
||||||
|
.\" .It Diagnostic Tag
|
||||||
|
.\" Diagnostic informtion here.
|
||||||
|
.\" .El
|
||||||
|
.Sh SEE ALSO
|
||||||
|
.\" List links in ascending order by section, alphabetically within a section.
|
||||||
|
.\" Please do not reference files that do not exist without filing a bug report
|
||||||
|
.Xr a 1 ,
|
||||||
|
.Xr b 1 ,
|
||||||
|
.Xr c 1 ,
|
||||||
|
.Xr a 2 ,
|
||||||
|
.Xr b 2 ,
|
||||||
|
.Xr a 3 ,
|
||||||
|
.Xr b 3
|
||||||
|
.\" .Sh BUGS \" Document known, unremedied bugs
|
||||||
|
.\" .Sh HISTORY \" Document history if command behaves in a unique manner
|
||||||
410
TestScripts/XPC Tests/XPC Tests/main.cpp
Normal file
410
TestScripts/XPC Tests/XPC Tests/main.cpp
Normal file
@@ -0,0 +1,410 @@
|
|||||||
|
//
|
||||||
|
// main.cpp
|
||||||
|
// XPC Tests
|
||||||
|
//
|
||||||
|
// Created by Chris Teubert on 11/25/14.
|
||||||
|
// Copyright (c) 2014 Chris Teubert. All rights reserved.
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
#include <exception>
|
||||||
|
#include "xplaneconnect.h"
|
||||||
|
|
||||||
|
int testFailed = 0;
|
||||||
|
int testPassed = 0;
|
||||||
|
|
||||||
|
void runTest(void (*f)())
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
std::cout << "Test " << testPassed+testFailed+1<<": ";
|
||||||
|
(*f)(); // Run Test
|
||||||
|
std::cout << "PASSED\n";
|
||||||
|
testPassed++;
|
||||||
|
}
|
||||||
|
catch (int i)
|
||||||
|
{
|
||||||
|
std::cerr << "FAILED\n\tError: " << i << std::endl;
|
||||||
|
testFailed++;
|
||||||
|
}
|
||||||
|
catch (char c)
|
||||||
|
{
|
||||||
|
std::cerr << "FAILED\n\tError: " << c << std::endl;
|
||||||
|
testFailed++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void test1() // openUDP Test
|
||||||
|
{
|
||||||
|
std::cout << "openUDP - ";
|
||||||
|
struct xpcSocket sendPort = openUDP( 49062, "127.0.0.1", 49009 );
|
||||||
|
}
|
||||||
|
|
||||||
|
void test2() // closeUDP test
|
||||||
|
{
|
||||||
|
std::cout << "closeUDP - ";
|
||||||
|
struct xpcSocket sendPort = openUDP( 49063, "127.0.0.1", 49009 );
|
||||||
|
closeUDP(sendPort);
|
||||||
|
}
|
||||||
|
|
||||||
|
void test3() // send/read Test
|
||||||
|
{
|
||||||
|
std::cout << "send/readUDP - ";
|
||||||
|
|
||||||
|
// Initialization
|
||||||
|
int i; // Iterator
|
||||||
|
char test[] = {0, 1, 2, 3};
|
||||||
|
char buf[5] = {0};
|
||||||
|
struct xpcSocket sendPort, recvPort;
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
sendPort = openUDP( 49064, "127.0.0.1", 49063 );
|
||||||
|
recvPort = openUDP( 49063, "127.0.0.1", 49009 );
|
||||||
|
|
||||||
|
// Execution
|
||||||
|
sendUDP( sendPort, test, sizeof(test) );
|
||||||
|
readUDP( recvPort, buf, NULL ); // Test
|
||||||
|
|
||||||
|
// Close
|
||||||
|
closeUDP(sendPort);
|
||||||
|
closeUDP(recvPort);
|
||||||
|
|
||||||
|
// Tests
|
||||||
|
for (i=0; i<4; i++)
|
||||||
|
{
|
||||||
|
if (test[i] != buf[i]) // Not received correctly
|
||||||
|
{
|
||||||
|
throw 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void test4() // Request DREF Test (Required for next tests)
|
||||||
|
{
|
||||||
|
std::cout << "requestDREF - ";
|
||||||
|
|
||||||
|
// Initialization
|
||||||
|
int i; // Iterator
|
||||||
|
char DREFArray[100][100];
|
||||||
|
float *recDATA[100];
|
||||||
|
short DREFSizes[100];
|
||||||
|
struct xpcSocket sendPort, recvPort;
|
||||||
|
short result = 0;
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
for (i = 0; i < 100; i++) {
|
||||||
|
recDATA[i] = (float *) malloc(40*sizeof(float));
|
||||||
|
memset(DREFArray[i],0,100);
|
||||||
|
}
|
||||||
|
sendPort = openUDP( 49064, "127.0.0.1", 49009 );
|
||||||
|
recvPort = openUDP( 49008, "127.0.0.1", 49009 );
|
||||||
|
strcpy(DREFArray[0],"sim/cockpit/switches/gear_handle_status");
|
||||||
|
strcpy(DREFArray[1],"cockpit2/switches/panel_brightness_ratio");
|
||||||
|
for (i=0;i<2;i++) {
|
||||||
|
DREFSizes[i] = (int) strlen(DREFArray[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execution
|
||||||
|
result = requestDREF(sendPort, recvPort, DREFArray, DREFSizes, 2, recDATA, DREFSizes);
|
||||||
|
|
||||||
|
// Close
|
||||||
|
closeUDP(sendPort);
|
||||||
|
closeUDP(recvPort);
|
||||||
|
|
||||||
|
// Tests
|
||||||
|
if ( result < 0)// Request 2 values
|
||||||
|
{
|
||||||
|
throw 1;
|
||||||
|
}
|
||||||
|
if (DREFSizes[0] != 1 || DREFSizes[1] != 4)
|
||||||
|
{
|
||||||
|
throw 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void test5() // sendDREF test
|
||||||
|
{
|
||||||
|
std::cout << "sendDREF - ";
|
||||||
|
|
||||||
|
// Initialization
|
||||||
|
int i; // Iterator
|
||||||
|
char DREFArray[100][100];
|
||||||
|
float *recDATA[100];
|
||||||
|
short DREFSizes[100];
|
||||||
|
float value = 0.0;
|
||||||
|
struct xpcSocket sendPort, recvPort;
|
||||||
|
short result = 0;
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
for (i = 0; i < 100; i++) {
|
||||||
|
recDATA[i] = (float *) malloc(40*sizeof(float));
|
||||||
|
memset(DREFArray[i],0,100);
|
||||||
|
}
|
||||||
|
sendPort = openUDP( 49066, "127.0.0.1", 49009 );
|
||||||
|
recvPort = openUDP( 49008, "127.0.0.1", 49009 );
|
||||||
|
strcpy(DREFArray[0],"sim/cockpit/switches/gear_handle_status");
|
||||||
|
for (i=0;i<1;i++) {
|
||||||
|
DREFSizes[i] = (int) strlen(DREFArray[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execution
|
||||||
|
sendDREF(sendPort, DREFArray[0], DREFSizes[0], &value, 1);
|
||||||
|
result = requestDREF(sendPort, recvPort, DREFArray, DREFSizes, 1, recDATA, DREFSizes);
|
||||||
|
|
||||||
|
// Close
|
||||||
|
closeUDP(sendPort);
|
||||||
|
closeUDP(recvPort);
|
||||||
|
|
||||||
|
// Tests
|
||||||
|
if (result < 0)// Request 1 value
|
||||||
|
{
|
||||||
|
throw 1;
|
||||||
|
}
|
||||||
|
if (DREFSizes[0] != 1)
|
||||||
|
{
|
||||||
|
throw 2;
|
||||||
|
}
|
||||||
|
if (*recDATA[0] != value)
|
||||||
|
{
|
||||||
|
throw 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void test6() // sendDATA test
|
||||||
|
{
|
||||||
|
std::cout << "sendData - ";
|
||||||
|
|
||||||
|
// Initialize
|
||||||
|
int i,j; // Iterator
|
||||||
|
char DREFArray[100][100];
|
||||||
|
float data[4][9] = {0};
|
||||||
|
float *recDATA[100];
|
||||||
|
short DREFSizes[100];
|
||||||
|
struct xpcSocket sendPort, recvPort;
|
||||||
|
short result = 0;
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
for (i = 0; i < 100; i++) {
|
||||||
|
recDATA[i] = (float *) malloc(40*sizeof(float));
|
||||||
|
memset(DREFArray[i],0,100);
|
||||||
|
}
|
||||||
|
sendPort = openUDP( 49066, "127.0.0.1", 49009 );
|
||||||
|
recvPort = openUDP( 49008, "127.0.0.1", 49009 );
|
||||||
|
strcpy(DREFArray[0],"sim/aircraft/parts/acf_gear_deploy");
|
||||||
|
for (i=0;i<1;i++) {
|
||||||
|
DREFSizes[i] = (int) strlen(DREFArray[i]);
|
||||||
|
}
|
||||||
|
for (i=0;i<4;i++) { // Set array to -999
|
||||||
|
for (j=0;j<9;j++) data[i][j] = -999;
|
||||||
|
}
|
||||||
|
data[0][0] = 14; // Gear
|
||||||
|
data[0][1] = 1;
|
||||||
|
data[0][2] = 0;
|
||||||
|
|
||||||
|
// Execution
|
||||||
|
sendDATA(sendPort, data, 1); // Gear
|
||||||
|
result = requestDREF(sendPort, recvPort, DREFArray, DREFSizes, 1, recDATA, DREFSizes); // Test
|
||||||
|
|
||||||
|
// Close
|
||||||
|
closeUDP(sendPort);
|
||||||
|
closeUDP(recvPort);
|
||||||
|
|
||||||
|
// Tests
|
||||||
|
if ( result < 0 )// Request 1 value
|
||||||
|
{
|
||||||
|
throw 1;
|
||||||
|
}
|
||||||
|
if (DREFSizes[0] != 10)
|
||||||
|
{
|
||||||
|
throw 2;
|
||||||
|
}
|
||||||
|
if (*recDATA[0] != data[0][1])
|
||||||
|
{
|
||||||
|
throw 3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void test7() // sendCTRL test
|
||||||
|
{
|
||||||
|
std::cout << "sendCTRL - ";
|
||||||
|
|
||||||
|
// Initialize
|
||||||
|
int i; // Iterator
|
||||||
|
char DREFArray[100][100];
|
||||||
|
float CTRL[5] = {0.0};
|
||||||
|
float *recDATA[100];
|
||||||
|
short DREFSizes[100];
|
||||||
|
struct xpcSocket sendPort, recvPort;
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
for (i = 0; i < 100; i++) {
|
||||||
|
recDATA[i] = (float *) malloc(40*sizeof(float));
|
||||||
|
memset(DREFArray[i],0,100);
|
||||||
|
}
|
||||||
|
sendPort = openUDP( 49067, "127.0.0.1", 49009 );
|
||||||
|
recvPort = openUDP( 49008, "127.0.0.1", 49009 );
|
||||||
|
strcpy(DREFArray[0],"sim/cockpit/switches/gear_handle_status");
|
||||||
|
for (i=0;i<1;i++) {
|
||||||
|
DREFSizes[i] = (int) strlen(DREFArray[i]);
|
||||||
|
}
|
||||||
|
CTRL[3] = 0.8; // Throttle
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
sendCTRL(sendPort, 4, CTRL);
|
||||||
|
|
||||||
|
// Close
|
||||||
|
closeUDP(sendPort);
|
||||||
|
closeUDP(recvPort);
|
||||||
|
|
||||||
|
// Test
|
||||||
|
|
||||||
|
// if (requestDREF(sendPort, recvPort, DREFArray, DREFSizes, 1, recDATA, DREFSizes) < 0)// Request 1 value
|
||||||
|
// {
|
||||||
|
// throw 1;
|
||||||
|
// }
|
||||||
|
// if (DREFSizes[0] != 1)
|
||||||
|
// {
|
||||||
|
// throw 2;
|
||||||
|
// }
|
||||||
|
// if (*recDATA[0] != value)
|
||||||
|
// {
|
||||||
|
// throw 3;
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
void test8() // sendPOSI test
|
||||||
|
{
|
||||||
|
std::cout << "sendPOSI - ";
|
||||||
|
|
||||||
|
// Initialization
|
||||||
|
int i; // Iterator
|
||||||
|
char DREFArray[100][100];
|
||||||
|
float POSI[8] = {0.0};
|
||||||
|
float *recDATA[100];
|
||||||
|
short DREFSizes[100];
|
||||||
|
struct xpcSocket sendPort, recvPort;
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
for (i = 0; i < 100; i++) {
|
||||||
|
recDATA[i] = (float *) malloc(40*sizeof(float));
|
||||||
|
memset(DREFArray[i],0,100);
|
||||||
|
}
|
||||||
|
sendPort = openUDP( 49067, "127.0.0.1", 49009 );
|
||||||
|
recvPort = openUDP( 49008, "127.0.0.1", 49009 );
|
||||||
|
strcpy(DREFArray[0],"sim/cockpit/switches/gear_handle_status");
|
||||||
|
for (i=0;i<1;i++) {
|
||||||
|
DREFSizes[i] = (int) strlen(DREFArray[i]);
|
||||||
|
}
|
||||||
|
POSI[0] = 37.524; // Lat
|
||||||
|
POSI[1] = -122.06899; // Lon
|
||||||
|
POSI[2] = 2500; // Alt
|
||||||
|
POSI[3] = 0; // Pitch
|
||||||
|
POSI[4] = 0; // Roll
|
||||||
|
POSI[5] = 0; // Heading
|
||||||
|
POSI[6] = 1; // Gear
|
||||||
|
|
||||||
|
// Execution
|
||||||
|
sendPOSI( sendPort, 0, 7, POSI );
|
||||||
|
|
||||||
|
// Close
|
||||||
|
closeUDP(sendPort);
|
||||||
|
closeUDP(recvPort);
|
||||||
|
|
||||||
|
// Test
|
||||||
|
}
|
||||||
|
|
||||||
|
void test9() // pauseSim test
|
||||||
|
{
|
||||||
|
std::cout << "pauseSim - ";
|
||||||
|
|
||||||
|
// Initialize
|
||||||
|
struct xpcSocket sendPort, recvPort;
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
sendPort = openUDP( 49067, "127.0.0.1", 49009 );
|
||||||
|
recvPort = openUDP( 49008, "127.0.0.1", 49009 );
|
||||||
|
|
||||||
|
// Execute
|
||||||
|
pauseSim(sendPort, 1);
|
||||||
|
|
||||||
|
// Close
|
||||||
|
closeUDP(sendPort);
|
||||||
|
closeUDP(recvPort);
|
||||||
|
|
||||||
|
// Test
|
||||||
|
}
|
||||||
|
|
||||||
|
void test10() // setConn test
|
||||||
|
{
|
||||||
|
std::cout << "setConn - ";
|
||||||
|
|
||||||
|
// Initialize
|
||||||
|
int i; // Iterator
|
||||||
|
char DREFArray[100][100];
|
||||||
|
float *recDATA[100];
|
||||||
|
short DREFSizes[100];
|
||||||
|
struct xpcSocket sendPort, recvPort;
|
||||||
|
short result = 0;
|
||||||
|
usleep(0);
|
||||||
|
|
||||||
|
// Setup
|
||||||
|
sendPort = openUDP( 49067, "127.0.0.1", 49009 );
|
||||||
|
recvPort = openUDP( 49055, "127.0.0.1", 49009 );
|
||||||
|
strcpy(DREFArray[0],"sim/cockpit/switches/gear_handle_status");
|
||||||
|
for (i=0;i<1;i++) {
|
||||||
|
DREFSizes[i] = (int) strlen(DREFArray[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Execution
|
||||||
|
setCONN(sendPort, 49055);
|
||||||
|
result = requestDREF(sendPort, recvPort, DREFArray, DREFSizes, 1, recDATA, DREFSizes); // Test
|
||||||
|
|
||||||
|
// Close
|
||||||
|
closeUDP(sendPort);
|
||||||
|
closeUDP(recvPort);
|
||||||
|
|
||||||
|
// Test
|
||||||
|
if ( result < 0 )// No data received
|
||||||
|
{
|
||||||
|
throw 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Set up for next test
|
||||||
|
sendPort = openUDP( 49067, "127.0.0.1", 49009 );
|
||||||
|
setCONN(sendPort, 49009);
|
||||||
|
closeUDP(sendPort);
|
||||||
|
}
|
||||||
|
|
||||||
|
int main(int argc, const char * argv[])
|
||||||
|
{
|
||||||
|
std::cout << "XPC Tests-cpp ";
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
std::cout << "(Windows)\n";
|
||||||
|
#elif (__APPLE__)
|
||||||
|
std::cout << "(Mac) \n";
|
||||||
|
#elif (__linux)
|
||||||
|
std::cout << "(Linux) \n";
|
||||||
|
#endif
|
||||||
|
|
||||||
|
runTest(test1);
|
||||||
|
runTest(test2);
|
||||||
|
runTest(test3);
|
||||||
|
runTest(test4);
|
||||||
|
runTest(test5);
|
||||||
|
runTest(test6);
|
||||||
|
runTest(test7);
|
||||||
|
runTest(test8);
|
||||||
|
runTest(test9);
|
||||||
|
runTest(test10);
|
||||||
|
|
||||||
|
std::cout << "----------------\nTest Summary\n\tFailed: " << testFailed << "\n\tPassed: " << testPassed << std::endl;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
Binary file not shown.
@@ -589,7 +589,7 @@ char setGEAR(short aircraft, float gear, char posi)
|
|||||||
|
|
||||||
if (posi)
|
if (posi)
|
||||||
{
|
{
|
||||||
XPLMSetDatavf(XPLMDataRefs[14][0], gearArray, 0, 8);
|
XPLMSetDatavf(XPLMDataRefs[14][0], gearArray, 0, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -709,7 +709,7 @@ int handlePOSI(char buf[])
|
|||||||
//Landing Gear
|
//Landing Gear
|
||||||
if (gear != -1)
|
if (gear != -1)
|
||||||
{
|
{
|
||||||
setGEAR(aircraft, gear,1);
|
setGEAR(aircraft, gear, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -752,7 +752,7 @@ int handleCTRL(char buf[])
|
|||||||
// SET Gear/Flaps
|
// SET Gear/Flaps
|
||||||
if ( gear != -1 )
|
if ( gear != -1 )
|
||||||
{
|
{
|
||||||
setGEAR(0, gear,0); // Gear
|
setGEAR(0, gear, 0); // Gear
|
||||||
}
|
}
|
||||||
if ( flaps > -999.5 && flaps < -997.5 ) // Flaps
|
if ( flaps > -999.5 && flaps < -997.5 ) // Flaps
|
||||||
{
|
{
|
||||||
@@ -1061,13 +1061,6 @@ int handleDATA(char buf[], int buflen)
|
|||||||
memcpy(floatArray,&recValues[i][1],8*sizeof(float));
|
memcpy(floatArray,&recValues[i][1],8*sizeof(float));
|
||||||
for (j=0; j<8; j++)
|
for (j=0; j<8; j++)
|
||||||
{
|
{
|
||||||
if (dataRef==14 && j==0)
|
|
||||||
{
|
|
||||||
setGEAR(0, recValues[i][j+1],1); // Landing Gear
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set DATAREF
|
|
||||||
if (debugSwitch > 0)
|
if (debugSwitch > 0)
|
||||||
{
|
{
|
||||||
char theString[100] = {0};
|
char theString[100] = {0};
|
||||||
@@ -1075,6 +1068,13 @@ int handleDATA(char buf[], int buflen)
|
|||||||
updateLog(theString, strlen(theString));
|
updateLog(theString, strlen(theString));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (dataRef==14 && j==0)
|
||||||
|
{
|
||||||
|
setGEAR(0, recValues[i][j+1], 1); // Landing Gear
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set DATAREF
|
||||||
if (setDREF(XPLMDataRefs[dataRef][j],floatArray,j,8) == -1)
|
if (setDREF(XPLMDataRefs[dataRef][j],floatArray,j,8) == -1)
|
||||||
sendBUF(buf,buflen);
|
sendBUF(buf,buflen);
|
||||||
} //End for j=1:8
|
} //End for j=1:8
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@@ -1,13 +1,13 @@
|
|||||||
3cf9e0e2c3d7330be62f82980f61a614 af5f4e247ee72a2fd8605a86129cde95 ffffffffffffffffffffffffffffffff 42268 /Users/cteubert/Documents/xplaneconnect/xpcPlugin/xpcPlugin.xpl
|
3cf9e0e2c3d7330be62f82980f61a614 af5f4e247ee72a2fd8605a86129cde95 ffffffffffffffffffffffffffffffff 42268 /Users/cteubert/Documents/xplaneconnect/xpcPlugin/xpcPlugin.xpl
|
||||||
3cf9e0e2c3d7330be62f82980f61a614 276eb2237c95a27242c61e05f0ff8fe0 ffffffffffffffffffffffffffffffff 42268 /Applications/X-Plane 10/Resources/plugins/xpcPlugin.xpl
|
3cf9e0e2c3d7330be62f82980f61a614 276eb2237c95a27242c61e05f0ff8fe0 ffffffffffffffffffffffffffffffff 42268 /Applications/X-Plane 10/Resources/plugins/xpcPlugin.xpl
|
||||||
3cf9e0e2c3d7330be62f82980f61a614 ecd54abeb6f6cd3905769ac71bfbe480 ffffffffffffffffffffffffffffffff 42268 /Users/cteubert/Documents/FDzProject/flightdeckz/connections/src/xplaneconnect/xpcPlugin.xpl
|
3cf9e0e2c3d7330be62f82980f61a614 ecd54abeb6f6cd3905769ac71bfbe480 ffffffffffffffffffffffffffffffff 42268 /Users/cteubert/Documents/FDzProject/flightdeckz/connections/src/xplaneconnect/xpcPlugin.xpl
|
||||||
00000000546fbb1800000000000048db cfce26aca1b989e457eb5cf2b59c3bd8 ffffffffffffffffffffffffffffffff 18651 /Users/cteubert/Documents/FDzProject/flightdeckz/connections/src/xplaneconnect/xplaneConnect.c
|
000000005478ae2400000000000048d0 cfce26aca1b989e457eb5cf2b59c3bd8 ffffffffffffffffffffffffffffffff 18640 /Users/cteubert/Documents/FDzProject/flightdeckz/connections/src/xplaneconnect/xplaneConnect.c
|
||||||
00000000546fbb190000000000000c62 539e31d610b4d465fec71d36139c86a2 ffffffffffffffffffffffffffffffff 3170 /Users/cteubert/Documents/FDzProject/flightdeckz/connections/src/xplaneconnect/xplaneConnect.h
|
0000000054762cff0000000000000c64 539e31d610b4d465fec71d36139c86a2 ffffffffffffffffffffffffffffffff 3172 /Users/cteubert/Documents/FDzProject/flightdeckz/connections/src/xplaneconnect/xplaneConnect.h
|
||||||
00000000002e7bb100000000000edaee 3cf9e0e2c3f948bae62f82980f6f7cfa ffffffffffffffffffffffffffffffff 48748 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/Mac/xpcPlugin.xpl
|
00000000002e7bb100000000000edaee 3cf9e0e2c3f948bae62f82980f6f7cfa ffffffffffffffffffffffffffffffff 48748 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/Mac/xpcPlugin.xpl
|
||||||
ffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffff 2768 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xpcPlugin_vers.o
|
ffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffff ffffffffffffffffffffffffffffffff 2768 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xpcPlugin_vers.o
|
||||||
000000000611f1150000000000004746 8374b21db9901f2d5dac9c15376e9125 ffffffffffffffffffffffffffffffff 29532 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xpcPluginTools.o
|
00000000520ca76a0000000000004618 8374b21db9901f2d5dac9c15376e9125 ffffffffffffffffffffffffffffffff 29532 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xpcPluginTools.o
|
||||||
000000005215308c0000000000002679 a62798d4eca3e9394feb35c4591b436a ffffffffffffffffffffffffffffffff 45876 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/XPCPlugin.o
|
00000000520ca76a000000000000267f a62798d4eca3e9394feb35c4591b436a ffffffffffffffffffffffffffffffff 45912 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/XPCPlugin.o
|
||||||
0000000006367b2c000000000000477f 9f15938943d0aea354fb2acfa5f38eb5 ffffffffffffffffffffffffffffffff 29288 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xplaneConnect.o
|
00000000062feccb00000000000003c0 9f15938943d0aea354fb2acfa5f38eb5 ffffffffffffffffffffffffffffffff 29200 /Users/cteubert/Documents/XPC Project/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xplaneConnect.o
|
||||||
e7479fe596e29344f39bbebeb9c0282d 050f967bda4409efca7b278d62ceaa09 ffffffffffffffffffffffffffffffff 48676 /Users/cteubert/Documents/XPlaneConnect/xpcPlugin/Mac/xpcPlugin.xpl
|
e7479fe596e29344f39bbebeb9c0282d 050f967bda4409efca7b278d62ceaa09 ffffffffffffffffffffffffffffffff 48676 /Users/cteubert/Documents/XPlaneConnect/xpcPlugin/Mac/xpcPlugin.xpl
|
||||||
000000000611f0d40000000000000f6a f229aeb77cc342b388dcfe8c1c35f733 ffffffffffffffffffffffffffffffff 2768 /Users/cteubert/Documents/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xpcPlugin_vers.o
|
000000000611f0d40000000000000f6a f229aeb77cc342b388dcfe8c1c35f733 ffffffffffffffffffffffffffffffff 2768 /Users/cteubert/Documents/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xpcPlugin_vers.o
|
||||||
000000000672cad60000000000004746 844d4d17e49cda80fc37de6e01f9deaa ffffffffffffffffffffffffffffffff 29484 /Users/cteubert/Documents/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xpcPluginTools.o
|
000000000672cad60000000000004746 844d4d17e49cda80fc37de6e01f9deaa ffffffffffffffffffffffffffffffff 29484 /Users/cteubert/Documents/XPlaneConnect/xpcPlugin/build/xpcPlugin.build/Debug/xpcPlugin.build/Objects-normal/x86_64/xpcPluginTools.o
|
||||||
|
|||||||
Binary file not shown.
@@ -2,34 +2,4 @@
|
|||||||
<Bucket
|
<Bucket
|
||||||
type = "1"
|
type = "1"
|
||||||
version = "2.0">
|
version = "2.0">
|
||||||
<Breakpoints>
|
|
||||||
<BreakpointProxy
|
|
||||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
||||||
<BreakpointContent
|
|
||||||
shouldBeEnabled = "No"
|
|
||||||
ignoreCount = "0"
|
|
||||||
continueAfterRunningActions = "No"
|
|
||||||
filePath = "xpcPluginTools.cpp"
|
|
||||||
timestampString = "428875765.671297"
|
|
||||||
startingColumnNumber = "9223372036854775807"
|
|
||||||
endingColumnNumber = "9223372036854775807"
|
|
||||||
startingLineNumber = "12"
|
|
||||||
endingLineNumber = "12">
|
|
||||||
</BreakpointContent>
|
|
||||||
</BreakpointProxy>
|
|
||||||
<BreakpointProxy
|
|
||||||
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
|
|
||||||
<BreakpointContent
|
|
||||||
shouldBeEnabled = "No"
|
|
||||||
ignoreCount = "0"
|
|
||||||
continueAfterRunningActions = "No"
|
|
||||||
filePath = "XPCPlugin.cpp"
|
|
||||||
timestampString = "438549105.218957"
|
|
||||||
startingColumnNumber = "9223372036854775807"
|
|
||||||
endingColumnNumber = "9223372036854775807"
|
|
||||||
startingLineNumber = "890"
|
|
||||||
endingLineNumber = "890">
|
|
||||||
</BreakpointContent>
|
|
||||||
</BreakpointProxy>
|
|
||||||
</Breakpoints>
|
|
||||||
</Bucket>
|
</Bucket>
|
||||||
|
|||||||
Reference in New Issue
Block a user