Skip to content

getCTRL

Jason Watkins edited this page Jun 2, 2015 · 1 revision

Get control surface information for an aircraft.

Syntax

Language Signature
C int getCTRL(XPCSocket sock, float values[7], char ac);
MATLAB ctrl = getCTRL(ac, socket)
Java float[] getCTRL(int ac)
Python getCTRL(self, ac = 0)
Parameters

sock (C): The socket used to send the command.

values (C): The array in which the resulting values should be stored.

socket (MATLAB): An optional reference to a socket opened with openUDP that should be used to send the command.

Return value

C: A negative value if an error occurs, otherwise 0.

All others: An array that matches the format of the array passed into sendCTRL.

Exceptions

C Error Code Java Exception Python Error Description
-1 -- OSError The request could not be sent
-2 IOException OSError No response was received
-3 IOException ValueError A response was received, but the length was incorrect
-- -- ValueError The response header was incorrect

Examples

C
#include "xplaneConnect.h"
XPCSocket sock = openUDP(IP);

// Get the current control surface info for the player aircraft
float ctrl[7];
getCTRL(sock, ctrl, 0);

closeUDP(sock);
MATLAB
import XPlaneConnect.*;

% Get the current control surface info for the player aircraft
ctrl = getCTRL(0);
Java
import gov.nasa.xpc.XPlaneConnect;

try(XPlaneConnect xpc = new XPlaneConnect())
{
    // Get the current control surface info for the player aircraft
    float[] ctrl = xpc.getCTRL(0);
}
Python
import xpc

with xpc.XPlaneConnect() as client:
    # Get the current control surface info for the player aircraft
    ctrl = client.getCTRL(0);