Minor fix for requestDREF
Fix for requestDREF
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
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
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
<?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>21287B4B-5984-406D-973A-1E0A4616A1E3</string>
|
|
||||||
<key>IDESourceControlProjectName</key>
|
|
||||||
<string>xpcPlugin</string>
|
|
||||||
<key>IDESourceControlProjectOriginsDictionary</key>
|
|
||||||
<dict>
|
|
||||||
<key>D7B4D224-FE26-406E-A48F-C604A5BE6975</key>
|
|
||||||
<string>https://babelfish.arc.nasa.gov/svn/pcoe/cteubert/xplaneconnect</string>
|
|
||||||
</dict>
|
|
||||||
<key>IDESourceControlProjectPath</key>
|
|
||||||
<string>xpcPlugin/xpcPlugin.xcodeproj/project.xcworkspace</string>
|
|
||||||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
|
|
||||||
<dict>
|
|
||||||
<key>D7B4D224-FE26-406E-A48F-C604A5BE6975</key>
|
|
||||||
<string>../../..</string>
|
|
||||||
</dict>
|
|
||||||
<key>IDESourceControlProjectRepositoryRootDictionary</key>
|
|
||||||
<dict>
|
|
||||||
<key>D7B4D224-FE26-406E-A48F-C604A5BE6975</key>
|
|
||||||
<string>https://babelfish.arc.nasa.gov/svn/pcoe</string>
|
|
||||||
</dict>
|
|
||||||
<key>IDESourceControlProjectURL</key>
|
|
||||||
<string>https://babelfish.arc.nasa.gov/svn/pcoe/cteubert/xplaneconnect/xpcPlugin/xpcPlugin.xcodeproj</string>
|
|
||||||
<key>IDESourceControlProjectVersion</key>
|
|
||||||
<integer>110</integer>
|
|
||||||
<key>IDESourceControlProjectWCCIdentifier</key>
|
|
||||||
<string>D7B4D224-FE26-406E-A48F-C604A5BE6975</string>
|
|
||||||
<key>IDESourceControlProjectWCConfigurations</key>
|
|
||||||
<array>
|
|
||||||
<dict>
|
|
||||||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
|
|
||||||
<string>public.vcs.subversion</string>
|
|
||||||
<key>IDESourceControlWCCIdentifierKey</key>
|
|
||||||
<string>D7B4D224-FE26-406E-A48F-C604A5BE6975</string>
|
|
||||||
<key>IDESourceControlWCCName</key>
|
|
||||||
<string>xplaneconnect</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
||||||
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