-
Notifications
You must be signed in to change notification settings - Fork 299
sendDATA
Jason Watkins edited this page May 8, 2015
·
3 revisions
Sends X-Plane data.
| Language | Signature |
|---|---|
| C | int sendDATA(XPCSocket sock, float data[][9], int rows) |
| MATLAB | sendDATA(data, socket) |
| Java | void sendDATA(float[][] data) |
| Python | sendData(self, data) |
sock (C): The socket used to send the command.
data: An array of values representing data rows to be set. Each array in data
should have 9 elements, the first of which is a row number in the range (0-134),
and the rest of which are the values to set for that data row.
rows (C): The number of rows in sendData.
socket (MATLAB): An optional reference to a socket opened with openUDP that
should be used to send the command.
C: A negative value if an error occurs, otherwise 0.
This command is compatible with the built in X-Plane data format.
| C Error Code | Java Exception | Python Error | Description |
|---|---|---|---|
| -1 | IllegalArgumentException | ValueError | The number of rows is not in the range (1-134) |
-
|IllegalArgumentException|ValueError |The size of a row in `data` is not 9
-2 |IOException |OSError |The client is unable to send the command
#include "xplaneConnect.h"
XPCSocket sock = aopenUDP("127.0.0.1", 49007);
// Set gear
const int rows = 1;
float data[rows][9] = { 0 };
data[0][0] = 14; // Row # for landing gear
data[0][1] = 1; // Set gear down.
sendDATA(sock, data, rows);
closeUDP(sock);import XPlaneConnect.*
% Set gear
data = [[14, 1, 0, 0, 0, 0, 0, 0, 0]];
sendDATA(data);import gov.nasa.xpc.XPlaneConnect;
try(XPlaneConnect xpc = new XPlaneConnect())
{
// Set gear
float[][] data = new float[1][9];
data[0][0] = 14; // Row # for landing gear
data[0][1] = 1; // Set gear down.
xpc.sendDATA(data);
}import xpc
with xpc.XPlaneConnect() as client:
# Set gear
data = [14, 1, -998, -998, -998, -998, -998, -998, -998]
client.sendDATA(data)