Commit Graph

67 Commits

Author SHA1 Message Date
Jason Watkins
579cad0655 Added support for VIEW command to the C client. 2015-05-08 14:38:31 -07:00
Jason Watkins
f2e64a30f2 Added support for sending multiple datarefs to the C client. 2015-05-07 15:24:57 -07:00
Jason Watkins
c6f9669e36 Added support for setting speed brakes to C client. 2015-05-05 13:04:08 -07:00
Jason Watkins
aeceb87f1d Merge latest changes from release-1.0.1
Removing all C++11 features touches many parts of many files, so better merge the changes into develop ASAP to prevent future conflicts.
2015-05-05 08:33:54 -07:00
Jason Watkins
8ed6b39779 Increased the timeout for select in the C client on Windows. 2015-05-04 14:58:55 -07:00
Chris Teubert
c44f521842 pauseSim should be returning int on error 2015-05-04 10:30:10 -07:00
Jason Watkins
0b984c3d49 Updated C client to support "switch" argument in SIMU command. 2015-05-01 14:55:36 -07:00
Jason Watkins
472ed4feac Added check to beginning of C example to ensure that the client is connected to X-Plane. 2015-05-01 14:20:44 -07:00
Jason Watkins
902aa006e8 Updated C client socket timeout.
The C client previously set a very short read timeout because it was required
 by the plugin. To compensate for this on the client side, we would try to
read several times in a loop. Since the plugin no longer uses the C client for
networking, we can do away with the loops and set a proper timeout.
2015-04-30 09:04:32 -07:00
Chris Teubert
761ee793ba Updates to use new function names 2015-04-29 13:57:50 -07:00
Jason Watkins
54368bb65a C client API tweaks
- Swaped names of openUDP and aopenUDP.
 - openUDP is now the "automatic" version, requiring only the X-Plane IP address.
 - aopenUDP is now the "advanced" version, requiring both the X-Plane port and a client port.
 - Added support for passing NULL to sendTEXT.
2015-04-29 12:44:19 -07:00
Jason Watkins
3b2e697158 Removed 'p' variants of the sendCTRL and sendPOSI functions from the C client. 2015-04-29 08:14:55 -07:00
Jason Watkins
8932edbd67 Renamed "setDREF" function back to "sendDREF". 2015-04-28 12:10:53 -07:00
Chris Teubert
3c43517e44 Fix Bug in getDREF Response
Fix Bug- readUDP loop in getDREF Response only ran once no matter what.
This wasn’t enough time for the plugin to send a response.

Note: You can try increasing the timeout, but the plugin has to have a
socket with a timeout of 1ms or less. If the timeout is higher than
that a lag is introduced.
2015-04-28 12:10:33 -07:00
Jason Watkins
d1df7f7b89 Deleted out of date user guides. The GitHub wiki now provides the information previously contained in these guides. 2015-04-28 12:04:42 -07:00
Chris Teubert
c2ab55e2d0 Fix sendTEXT bug
sendText using the number 40 instead of message length in sendUDP call.
Messages would be cut off if longer than this
2015-04-24 11:00:53 -07:00
Jason Watkins
1d766dbb09 Updated C example program to conform to the new client API. 2015-04-24 10:30:29 -07:00
Jason Watkins
fe5689aaa2 Removed internal C client functions from the C client header. 2015-04-23 16:20:42 -07:00
Jason Watkins
7da82f40dc Several variable name tweaks and error checking changes.
- Minimal functional changes. The primary purpose of these tweaks is to make the clients more consistent across languages.
2015-04-23 11:12:42 -07:00
Jason Watkins
02f4c92fce Tweaked param name on setDREF in C client. 2015-04-23 11:12:41 -07:00
Chris Teubert
368c3bed20 fix- aopenUDP not returning socket 2015-04-23 10:08:05 -07:00
Chris Teubert
795e284ab2 A few mac fixes 2015-04-23 10:07:47 -07:00
Jason Watkins
55feee68ed Tweaked XPCSocket in C client.
- Re-added xpcSocket name in the struct namespace
 - Removed unused open field.
2015-04-22 14:35:46 -07:00
Jason Watkins
8e6819b80b Added doc comments to C client. 2015-04-18 09:16:15 -07:00
Jason Watkins
55f3953955 Fixed errors and removed unused code in the C client.
- Fixed a buffer overflow in sendCTRL.
 - Fixed incorrect inderection in readUDP.
 - Removed unused usleep function.
 - Removed redundant include of WS2tcpip.h
 - Fixed widespread error where sendUDP's return value was not being checked correctly.
 - Updated signature of openUDP to place optional parameters at the end
 - Fixed bug in CTRL command where the buffer length was not correctly set.
 - Fixed setCONN to correctlly reset the client's socket.
2015-04-17 10:56:03 -07:00
Jason Watkins
b7ace82649 Cleaned up drawing functions. 2015-04-17 10:56:02 -07:00
Jason Watkins
6ac20f0998 Cleaned up CTRL functions.
- Removed parseCTRL and readCTRL.
 - Tweaked variable type, order and naming.
 - Improved validation and error reporting.
 - Updated Interface Control Document to reflect adition of aircraft number to CTRL command.
2015-04-17 10:56:01 -07:00
Jason Watkins
0e6195c063 Cleaned up POSI functions.
- Removed readPOSI and parsePOSI functions. These were only used by the plugin, which no longer uses them.
 - Tweaked types, argument order, and names to improve concision and consistency with other functions.
 - Improved validation and error reporting.
2015-04-17 10:56:01 -07:00
Jason Watkins
80a1a2dcd2 Cleaned up DREF functions and tweaked printError.
- printError is now a varags function, and will print format strings for the message.
 - Removed several internal DREF functions from the header file.
 - Significantly improved error reporting in DREF functions.
 - Removed dynamic allocation for responses. Clients are now expected to provide fully allocated storage for getDREFs. An error message will be printed if the provided structure is too small.
 - Fixes nasa/XPlaneConnect#30
2015-04-17 10:56:00 -07:00
Jason Watkins
4e7e816da1 Cleaned up DATA related functions.
- Tweaked signatures to improve consistency and safety.
 - Improved error logging.
 - Removed parseDATA. When merged into readDATA, the meat of parseDATA is only a few lines of code.
2015-04-17 10:56:00 -07:00
Jason Watkins
9f670954cc Cleaned up setCONN and pauseSim functions.
- Tweaked function signatures to more accurately reflect internal behavior.
 - Changed behavior of setCONN to use the inbound port of the socket passed to it.
 - Greatly enhanced error reporting for setCONN and pauseSim.
2015-04-17 10:55:59 -07:00
Jason Watkins
1a8078af87 Various changes to improve consistency and readability of low level UDP functions.
- Tweaked variable names to be more concise.
 - Moved variable declarations from top of function to point of use.
 - Replaced memcpy with strncpy where appropriate.
 - Removed socket reuse options on *nix builds.
 - Improved error reporting.
 - Most failures when opening and closing sockets now cause the client to die.
 - sendUDP now ignores the length byte.
2015-04-17 10:55:59 -07:00
Jason Watkins
a6196dece9 C client style tweaks.
- Standardized C client to use tabs.
 - Improved consistency of indentation.
 - Updated copyright and description headers.
2015-04-17 10:54:55 -07:00
Jason Watkins
6417822a75 Added C test for WYPT command and fixed bugs in parseWYPT and sendWYPT. 2015-04-09 12:17:52 -07:00
Jason Watkins
1a83517bee Implemented plugin support for handling WYPT commands. 2015-04-09 12:17:41 -07:00
Jason Watkins
001d5fd2d4 Quick fix to installation instructions in User Guide (C).txt 2015-04-08 09:37:19 -07:00
Chris Teubert
335570f34f Updated C User Guide 2015-04-08 09:26:56 -07:00
Chris Teubert
efc591ead4 Added missing return 2015-04-08 09:12:56 -07:00
Chris Teubert
b7dfb8ec3e Bug fix
Fixed function prototype in header (didn’t match source file)
2015-04-08 09:12:56 -07:00
Jason Watkins
46913596c5 Added support for the TEXT command to the C client. 2015-04-07 15:33:46 -07:00
Jason Watkins
abf2a426d2 Added C client support for multiplayer sendCTRL commands. 2015-04-07 10:43:39 -07:00
Jason Watkins
a05ddb42be Modified parseCTRL and readCTRL to return a struct.
- Defined a new struct that contains the information sent by the CTRL command
 - Added some additional validation to parseCTRL.
 - Changed the return type of parseCTRL and removed now redundant pointer parameters.
 - Propagated return type change throughout the plugin code base.
2015-04-07 10:38:57 -07:00
Chris Teubert
0c2e786890 Removed "sim/" auto add feature
Removed “sim/“ auto add feature. There are some drefs (custom/art) that
do not start with “sim/“
2015-04-03 10:47:55 -07:00
Chris Teubert
5d50d970bd sendCTRL Bug
Fixed bug where sendCTRL is sending gear as float. Changed to char as
specified in ICD.
2015-04-01 15:58:01 -07:00
Jason Watkins
85fdcbe3dc Several small fixes
- Added Visual Studio solution for C client example.
 - Fixed inconsistent indentation in C client example.
 - Changed default behavior in MATLAB client's sendCTRL function to leave unchanged instead of setting default values.
 - Fixed sendPOSI and sendDATA sections of the MATLAB example.
 - Fixed port number in the C and C++ setCONN tests.
2015-03-30 13:38:51 -07:00
Jason Watkins
b91776e687 Removed files that were previously in version control that should be ignored. 2015-03-25 11:32:40 -07:00
Jason Watkins
66b074d89b Tweaks to fix setCONNTest on Windows 8
- Temporarily disabled the sending of a CONF message from the plugin in response to setCONN. The CONF message causes crashes on Windows 8 when setCONN is called multiple times.
 -  Removed code that attempted to free result slots in parseRequest before overwritting them with new allocations. The CTests suite currently calls parseRequest with a multidimensional array allocated on the stack, resulting in an attempt to free stack memory. A better solution may be to simply check whether the existing result slots are long enough.
 - As of this commit, all tests in the CTests suite are passing on Windows 8 for X-Plane 9, X-Plane 10 23bit and X-Plane 10 64bit.
2015-03-24 16:11:37 -07:00
Jason Watkins
fbeb297717 Fixed CTests bugs, minor plugin enhancements, and removed old files
- Fixed incorrect message buffer size in sendCTRL function.
 - Fixed a bug in sendCTRLTest where not all DREF sizes were being set.
 - Increased message buffer size in sendReadTest to account for assumptions made by sendUDP.
 - Fixed a bug in updateLog where the log message would sometimes start with several null characters, causing the log message to be effectively ignored by fprintf.

 - The xpcPlugin Visual Studio solution now supports 32 bit and 64 bit builds.
 - Logging performed by the plugin now works correctly on Windows.
 - Long log messages are now truncated to 500 characters. Previously, messages over 500 characters would be omitted, and an error message logged in their place.

 - Several files which were incorrectly added to source control have been deleted.
2015-03-24 14:29:39 -07:00
Elvis Dowson
5853062402 C/xpcExample: Update XCode project to reference new source file location.
This commit:
- updates the XCode project to 6.1.1
- updates the reference to the xpcExample source file
- modifies the project so that some of the files that are copied across during the build phase are
  only done during deployment.

Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
2015-01-02 14:45:36 +04:00
Elvis Dowson
b3fada3c64 C/xpcExample: Add CMake support for building xpcExample that uses the xplaneconnect library.
Signed-off-by: Elvis Dowson <elvis.dowson@gmail.com>
2015-01-02 14:24:34 +04:00