Skip to content

Migrating to 1.0 MATLAB

Jason Watkins edited this page Apr 24, 2015 · 2 revisions

Several changes have been made to the MATLAB client to improve compatability with clients written in other languages.

The MATLAB client now utilizes the Java client internally. The client is located int the XPlaneConnect.jar file now stored in the +XPlaneConnect directory. With the exception of item number 1 on the list below, this change should be transparent to you, the user.

The following list enumerates breaking changes and provides specific instructions on how to fix your code to work with version 1.0 of the X-Plane Connect Toolbox.

  1. For all functions, the IP and PORT parameters have been replaced with a single socket parameter.
  • The socket is an object returned by the openUDP function.
  • Fix: Instead of passing an IP and port directly to each function, first optain an open socket by calling openUDP, then pass that socket to each command function.
  • Ex: pauseSim(1, "127.0.0.1", 49009); becomes socket = openUDP("127.0.0.1", 49009); pauseSim(1, socket);
  1. The readUDP and sendUDP functions have been removed.
  • These functions are now handled internally by the Java client
  • Fix: Use The pulic client functions to send and receive data. If no existing function meets your needs, submit an issue to GitHub.
  1. The clearUDPBuffer function has been removed.
  • This function is a hack that should not be necessary. If applying the fixed below causes problems, please openn an issue on GitHub or email us (christopher.a.teubert@nasa.gov or jason.w.watkins@nasa.gov) and we will work with you to resolve the issue.
  • Fix: Remove all calls to clearUDPBuffer from your code.
  1. The sendSTRU function has been removed.
  • This function is no longer used internally and is not directly related to the XPC toolbox.
  • If you desperately need this functionality, please email us and we will assist you in setting up an equivelent function that does not rely on XPC.
  • Fix: Remove all calls to sendSTRU from your code.
  1. Removed largely unused return values from several functions.
  • If an error occurs, and exception will be thrown. Send only commands that return normally are successful to the best of the clients ability to determine.
  • Fix: Call send only commands without assigning the result.
  • Ex: status = pauseSim(1); becomes pauseSim(1);
  1. Renamed requestDREF and sendDREF to getDREFs and setDREF respectively.
  • Fix: Replace all instances of requestDREf with getDREFs and replace all instances of sendDREF with setDREF.