-
Notifications
You must be signed in to change notification settings - Fork 283
readDATA
Jason Watkins edited this page May 8, 2015
·
3 revisions
Reads X-Plane data.
Language | Signature |
---|---|
C | int readDATA(XPCSocket sock, float data[][9], int rows) |
MATLAB | result = readDATA( socket ) |
Java | float[][] readData() |
Python | readDATA() |
sock
(C): The socket used to send the command.
data
(C): An array in which the resulting data will be stored
rows
(C): The number of rows in readDATA.
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.
All others: A 2 dimensional array containing 0 or more rows of data. Each array in the result will have 9 elements, the first of which is the row number which that array represents data for, and the rest of which are the data elements in that row.
This command is compatible with the built in X-Plane data format.
C Error Code | Java Exception | Python Error | Description |
---|---|---|---|
-1 | IOException | OSError | The client is unable to read data. |
#include "xplaneConnect.h"
XPCSocket sock = aopenUDP("127.0.0.1", 49007);
// Read 2 rows of data
const int rows = 2;
float data[rows][9];
readDATA(sock, data, rows);
closeUDP(sock);
import XPlaneConnect.*
result = readDATA();
import gov.nasa.xpc.XPlaneConnect;
try(XPlaneConnect xpc = new XPlaneConnect())
{
float[][] result = xpc.readDATA();
}
import xpc
with xpc.XPlaneConnect() as client:
result = client.readDATA();