X-Plane Remote Access Plugin and Client Library
|
#include <stdlib.h>
#include <inttypes.h>
Go to the source code of this file.
Macros | |
#define | ERROR_NONE 0 |
#define | ERROR_IO 1 |
#define | ERROR_PROTOCOL 2 |
#define | ERROR_PROTOCOL_INVALID_COMMAND = 1 |
#define | ERROR_PROTOCOL_UNKNOWN_DATAREF = 2 |
#define | ERROR_PROTOCOL_INVALID_TYPE = 3 |
#define | ERROR_PROTOCOL_INVALID_LENGTH = 4 |
#define | ERROR_PROTOCOL_INVALID_OFFSET = 5 |
#define | ERROR_PROTOCOL_INVALID_COUNT = 6 |
#define | ERROR_PROTOCOL_INVALID_ID = 7 |
#define | ERROR_PROTOCOL_INVALID_DURATION = 8 |
#define | ERROR_PROTOCOL_OTHER = 255 |
#define | ERROR_NOT_CONNECTED 3 |
#define | ERROR_TYPE_MISMATCH 4 |
#define | ERROR_INVALID_ID 5 |
#define | ERROR_OTHER 255 |
#define | HOTKEY_MODIFIER_SHIFT 0x01 |
#define | HOTKEY_MODIFIER_CONTROL 0x02 |
#define | INVALID_DATAREF_ID ((size_t)-1) |
Functions | |
int | xplra_get_last_error (int connectionID, unsigned long *subCode) |
const char * | xplra_get_last_error_string (int connectionID) |
void | xplra_clear_last_error (int connectionID) |
int | xplra_connect () |
int | xplra_connect_tcp (const char *address) |
int | xplra_connect_tcp_port (const char *address, unsigned short port) |
int | xplra_get_versions (int connectionID, int *xplaneVersion, int *xplmVersion, int *xplraVersion) |
int | xplra_reload_plugins (int connectionID) |
int | xplra_save_situation (int connectionID, const char *path) |
int | xplra_get_int (int *value, int connectionID, const char *name) |
int | xplra_get_float (float *value, int connectionID, const char *name) |
int | xplra_get_double (double *value, int connectionID, const char *name) |
ssize_t | xplra_get_float_array (float *dest, size_t length, size_t offset, int connectionID, const char *name) |
float * | xplra_get_float_array_new (size_t *length, size_t offset, int connectionID, const char *name) |
ssize_t | xplra_get_int_array (int32_t *dest, size_t length, size_t offset, int connectionID, const char *name) |
int32_t * | xplra_get_int_array_new (size_t *length, size_t offset, int connectionID, const char *name) |
ssize_t | xplra_get_byte_array (void *dest, size_t length, size_t offset, int connectionID, const char *name) |
uint8_t * | xplra_get_byte_array_new (size_t *length, size_t offset, int connectionID, const char *name) |
int | xplra_set_int (int connectionID, const char *name, int value) |
int | xplra_set_float (int connectionID, const char *name, float value) |
int | xplra_set_double (int connectionID, const char *name, double value) |
int | xplra_set_float_array (int connectionID, const char *name, const float *values, size_t length, size_t offset) |
int | xplra_set_int_array (int connectionID, const char *name, const int32_t *values, size_t length, size_t offset) |
int | xplra_set_byte_array (int connectionID, const char *name, const void *values, size_t length, size_t offset) |
int | xplra_set_string (int connectionID, const char *name, const char *value, size_t length, size_t offset) |
int | xplra_multi_create_getter (int connectionID) |
int | xplra_multi_create_setter (int connectionID) |
size_t | xplra_multi_add_int (int bufferID, const char *name) |
size_t | xplra_multi_add_float (int bufferID, const char *name) |
size_t | xplra_multi_add_double (int bufferID, const char *name) |
size_t | xplra_multi_add_float_array (int bufferID, const char *name, size_t length, size_t offset) |
size_t | xplra_multi_add_int_array (int bufferID, const char *name, size_t length, size_t offset) |
size_t | xplra_multi_add_byte_array (int bufferID, const char *name, size_t length, size_t offset) |
int | xplra_multi_finalize (int bufferID) |
int | xplra_multi_register (int bufferID) |
int | xplra_multi_unregister (int bufferID) |
int | xplra_multi_unregister_safely (int bufferID) |
int | xplra_multi_execute (int bufferID) |
int | xplra_multi_set_int (int bufferID, size_t datarefID, int value) |
int | xplra_multi_get_int (int *dest, int bufferID, size_t datarefID) |
const int32_t * | xplra_multi_get_int_const_ptr (int bufferID, size_t datarefID) |
int32_t * | xplra_multi_get_int_ptr (int bufferID, size_t datarefID) |
int | xplra_multi_set_float (int bufferID, size_t datarefID, float value) |
int | xplra_multi_get_float (float *dest, int bufferID, size_t datarefID) |
const float * | xplra_multi_get_float_const_ptr (int bufferID, size_t datarefID) |
float * | xplra_multi_get_float_ptr (int bufferID, size_t datarefID) |
int | xplra_multi_set_double (int bufferID, size_t datarefID, double value) |
int | xplra_multi_get_double (double *dest, int bufferID, size_t datarefID) |
const double * | xplra_multi_get_double_const_ptr (int bufferID, size_t datarefID) |
double * | xplra_multi_get_double_ptr (int bufferID, size_t datarefID) |
ssize_t | xplra_multi_set_float_array (int bufferID, size_t datarefID, const float *value, size_t length, size_t offset) |
ssize_t | xplra_multi_get_float_array (float *value, size_t length, size_t offset, int bufferID, size_t datarefID) |
const float * | xplra_multi_get_float_array_ptr (int bufferID, size_t datarefID, size_t offset) |
ssize_t | xplra_multi_set_int_array (int bufferID, size_t datarefID, const int32_t *value, size_t length, size_t offset) |
ssize_t | xplra_multi_get_int_array (int32_t *value, size_t length, size_t offset, int bufferID, size_t datarefID) |
const int32_t * | xplra_multi_get_int_array_ptr (int bufferID, size_t datarefID, size_t offset) |
ssize_t | xplra_multi_set_byte_array (int bufferID, size_t datarefID, const void *value, size_t length, size_t offset) |
ssize_t | xplra_multi_get_byte_array (void *value, size_t length, size_t offset, int bufferID, size_t datarefID) |
const uint8_t * | xplra_multi_get_byte_array_ptr (int bufferID, size_t datarefID, size_t offset) |
ssize_t | xplra_multi_set_string (int bufferID, size_t datarefID, const char *value, size_t offset) |
const char * | xplra_multi_get_string_ptr (int bufferID, size_t datarefID, size_t offset) |
int | xplra_multi_destroy_buffer (int connectionID, int bufferID) |
int | xplra_show_message (int connectionID, const char *message, float duration) |
int | xplra_register_hotkeys (int connectionID, const uint16_t *codes, size_t length) |
int | xplra_query_hotkeys (int connectionID, uint8_t *states, size_t length) |
int | xplra_unregister_hotkeys (int connectionID) |
int | xplra_disconnect (int connectionID) |
int | xplra_reconnect (int connectionID) |
int | xplra_destroy (int connectionID) |
#define ERROR_INVALID_ID 5 |
#define ERROR_IO 1 |
#define ERROR_NOT_CONNECTED 3 |
#define ERROR_PROTOCOL 2 |
#define ERROR_PROTOCOL_INVALID_COMMAND = 1 |
#define ERROR_PROTOCOL_INVALID_COUNT = 6 |
#define ERROR_PROTOCOL_INVALID_DURATION = 8 |
#define ERROR_PROTOCOL_INVALID_ID = 7 |
#define ERROR_PROTOCOL_INVALID_LENGTH = 4 |
#define ERROR_PROTOCOL_INVALID_OFFSET = 5 |
#define ERROR_PROTOCOL_INVALID_TYPE = 3 |
#define ERROR_PROTOCOL_UNKNOWN_DATAREF = 2 |
#define ERROR_TYPE_MISMATCH 4 |
#define HOTKEY_MODIFIER_CONTROL 0x02 |
#define INVALID_DATAREF_ID ((size_t)-1) |
void xplra_clear_last_error | ( | int | connectionID | ) |
int xplra_connect | ( | ) |
int xplra_connect_tcp | ( | const char * | address | ) |
int xplra_connect_tcp_port | ( | const char * | address, |
unsigned short | port | ||
) |
int xplra_destroy | ( | int | connectionID | ) |
int xplra_disconnect | ( | int | connectionID | ) |
ssize_t xplra_get_byte_array | ( | void * | dest, |
size_t | length, | ||
size_t | offset, | ||
int | connectionID, | ||
const char * | name | ||
) |
Get an array of bytes into a buffer.
dest | the array into which to get the data |
length | the length of the destination buffer |
offset | the offset from which to query the array |
connectionID | the ID of the connection to use |
name | the name of the dataref |
uint8_t* xplra_get_byte_array_new | ( | size_t * | length, |
size_t | offset, | ||
int | connectionID, | ||
const char * | name | ||
) |
Get an array of bytes into a newly allocated buffer.
length | pointer to a variable containing the length to query. On return it will be set to the actual length, which can be less than or equal to the input value. |
offset | the offset from which to query the array |
connectionID | the ID of the connection to use |
name | the name of the dataref |
int xplra_get_double | ( | double * | value, |
int | connectionID, | ||
const char * | name | ||
) |
int xplra_get_float | ( | float * | value, |
int | connectionID, | ||
const char * | name | ||
) |
ssize_t xplra_get_float_array | ( | float * | dest, |
size_t | length, | ||
size_t | offset, | ||
int | connectionID, | ||
const char * | name | ||
) |
Get an array of floats into a buffer.
dest | the array into which to get the data |
length | the length of the destination buffer |
offset | the offset from which to query the array |
connectionID | the ID of the connection to use |
name | the name of the dataref |
float* xplra_get_float_array_new | ( | size_t * | length, |
size_t | offset, | ||
int | connectionID, | ||
const char * | name | ||
) |
Get an array of floats into a newly allocated buffer.
length | pointer to a variable containing the length to query. On return it will be set to the actual length, which can be less than or equal to the input value. |
offset | the offset from which to query the array |
connectionID | the ID of the connection to use |
name | the name of the dataref |
int xplra_get_int | ( | int * | value, |
int | connectionID, | ||
const char * | name | ||
) |
ssize_t xplra_get_int_array | ( | int32_t * | dest, |
size_t | length, | ||
size_t | offset, | ||
int | connectionID, | ||
const char * | name | ||
) |
Get an array of integers into a buffer.
dest | the array into which to get the data |
length | the length of the destination buffer |
offset | the offset from which to query the array |
connectionID | the ID of the connection to use |
name | the name of the dataref |
int32_t* xplra_get_int_array_new | ( | size_t * | length, |
size_t | offset, | ||
int | connectionID, | ||
const char * | name | ||
) |
Get an array of integers into a newly allocated buffer.
length | pointer to a variable containing the length to query. On return it will be set to the actual length, which can be less than or equal to the input value. |
offset | the offset from which to query the array |
connectionID | the ID of the connection to use |
name | the name of the dataref |
int xplra_get_last_error | ( | int | connectionID, |
unsigned long * | subCode | ||
) |
const char* xplra_get_last_error_string | ( | int | connectionID | ) |
int xplra_get_versions | ( | int | connectionID, |
int * | xplaneVersion, | ||
int * | xplmVersion, | ||
int * | xplraVersion | ||
) |
size_t xplra_multi_add_byte_array | ( | int | bufferID, |
const char * | name, | ||
size_t | length, | ||
size_t | offset | ||
) |
size_t xplra_multi_add_double | ( | int | bufferID, |
const char * | name | ||
) |
size_t xplra_multi_add_float | ( | int | bufferID, |
const char * | name | ||
) |
size_t xplra_multi_add_float_array | ( | int | bufferID, |
const char * | name, | ||
size_t | length, | ||
size_t | offset | ||
) |
size_t xplra_multi_add_int | ( | int | bufferID, |
const char * | name | ||
) |
size_t xplra_multi_add_int_array | ( | int | bufferID, |
const char * | name, | ||
size_t | length, | ||
size_t | offset | ||
) |
int xplra_multi_create_getter | ( | int | connectionID | ) |
int xplra_multi_create_setter | ( | int | connectionID | ) |
int xplra_multi_destroy_buffer | ( | int | connectionID, |
int | bufferID | ||
) |
int xplra_multi_execute | ( | int | bufferID | ) |
int xplra_multi_finalize | ( | int | bufferID | ) |
ssize_t xplra_multi_get_byte_array | ( | void * | value, |
size_t | length, | ||
size_t | offset, | ||
int | bufferID, | ||
size_t | datarefID | ||
) |
Get the contents of the byte array with the given ID.
value | the destination buffer |
length | the amount of data. If 0, it is assumed to be the length of the data in the buffer minus the offset. |
offset | the offset within the buffer to get the data from |
bufferID | the ID of the buffer to use |
datarefID | the ID of the dataref whose value is to be retrieved |
const uint8_t* xplra_multi_get_byte_array_ptr | ( | int | bufferID, |
size_t | datarefID, | ||
size_t | offset | ||
) |
int xplra_multi_get_double | ( | double * | dest, |
int | bufferID, | ||
size_t | datarefID | ||
) |
const double* xplra_multi_get_double_const_ptr | ( | int | bufferID, |
size_t | datarefID | ||
) |
double* xplra_multi_get_double_ptr | ( | int | bufferID, |
size_t | datarefID | ||
) |
int xplra_multi_get_float | ( | float * | dest, |
int | bufferID, | ||
size_t | datarefID | ||
) |
ssize_t xplra_multi_get_float_array | ( | float * | value, |
size_t | length, | ||
size_t | offset, | ||
int | bufferID, | ||
size_t | datarefID | ||
) |
Get the contents of the float array with the given ID.
value | the destination buffer |
length | the amount of data. If 0, it is assumed to be the length of the data in the buffer minus the offset. |
offset | the offset within the buffer to get the data from |
bufferID | the ID of the buffer to use |
datarefID | the ID of the dataref whose value is to be retrieved |
const float* xplra_multi_get_float_array_ptr | ( | int | bufferID, |
size_t | datarefID, | ||
size_t | offset | ||
) |
const float* xplra_multi_get_float_const_ptr | ( | int | bufferID, |
size_t | datarefID | ||
) |
float* xplra_multi_get_float_ptr | ( | int | bufferID, |
size_t | datarefID | ||
) |
int xplra_multi_get_int | ( | int * | dest, |
int | bufferID, | ||
size_t | datarefID | ||
) |
ssize_t xplra_multi_get_int_array | ( | int32_t * | value, |
size_t | length, | ||
size_t | offset, | ||
int | bufferID, | ||
size_t | datarefID | ||
) |
Get the contents of the integer array with the given ID.
value | the destination buffer |
length | the amount of data. If 0, it is assumed to be the length of the data in the buffer minus the offset. |
offset | the offset within the buffer to get the data from |
bufferID | the ID of the buffer to use |
datarefID | the ID of the dataref whose value is to be retrieved |
const int32_t* xplra_multi_get_int_array_ptr | ( | int | bufferID, |
size_t | datarefID, | ||
size_t | offset | ||
) |
const int32_t* xplra_multi_get_int_const_ptr | ( | int | bufferID, |
size_t | datarefID | ||
) |
int32_t* xplra_multi_get_int_ptr | ( | int | bufferID, |
size_t | datarefID | ||
) |
const char* xplra_multi_get_string_ptr | ( | int | bufferID, |
size_t | datarefID, | ||
size_t | offset | ||
) |
int xplra_multi_register | ( | int | bufferID | ) |
ssize_t xplra_multi_set_byte_array | ( | int | bufferID, |
size_t | datarefID, | ||
const void * | value, | ||
size_t | length, | ||
size_t | offset | ||
) |
Set the contents of the byte array dataref with the given ID.
bufferID | the ID of the buffer to use |
datarefID | the ID of the dataref whose value is to be set |
value | the array to set |
length | the amount of data. If 0, it is assumed to be the length of the data in the buffer minus the offset. |
offset | the offset within the buffer to set the data from |
int xplra_multi_set_double | ( | int | bufferID, |
size_t | datarefID, | ||
double | value | ||
) |
int xplra_multi_set_float | ( | int | bufferID, |
size_t | datarefID, | ||
float | value | ||
) |
ssize_t xplra_multi_set_float_array | ( | int | bufferID, |
size_t | datarefID, | ||
const float * | value, | ||
size_t | length, | ||
size_t | offset | ||
) |
Set the contents of the float array dataref with the given ID.
bufferID | the ID of the buffer to use |
datarefID | the ID of the dataref whose value is to be set |
value | the array to set |
length | the amount of data. If 0, it is assumed to be the length of the data in the buffer minus the offset. |
offset | the offset within the buffer to set the data from |
int xplra_multi_set_int | ( | int | bufferID, |
size_t | datarefID, | ||
int | value | ||
) |
ssize_t xplra_multi_set_int_array | ( | int | bufferID, |
size_t | datarefID, | ||
const int32_t * | value, | ||
size_t | length, | ||
size_t | offset | ||
) |
Set the contents of the integer array dataref with the given ID.
bufferID | the ID of the buffer to use |
datarefID | the ID of the dataref whose value is to be set |
value | the array to set |
length | the amount of data. If 0, it is assumed to be the length of the data in the buffer minus the offset. |
offset | the offset within the buffer to set the data from |
ssize_t xplra_multi_set_string | ( | int | bufferID, |
size_t | datarefID, | ||
const char * | value, | ||
size_t | offset | ||
) |
int xplra_multi_unregister | ( | int | bufferID | ) |
int xplra_multi_unregister_safely | ( | int | bufferID | ) |
int xplra_query_hotkeys | ( | int | connectionID, |
uint8_t * | states, | ||
size_t | length | ||
) |
int xplra_reconnect | ( | int | connectionID | ) |
int xplra_register_hotkeys | ( | int | connectionID, |
const uint16_t * | codes, | ||
size_t | length | ||
) |
int xplra_reload_plugins | ( | int | connectionID | ) |
int xplra_save_situation | ( | int | connectionID, |
const char * | path | ||
) |
int xplra_set_byte_array | ( | int | connectionID, |
const char * | name, | ||
const void * | values, | ||
size_t | length, | ||
size_t | offset | ||
) |
int xplra_set_double | ( | int | connectionID, |
const char * | name, | ||
double | value | ||
) |
int xplra_set_float | ( | int | connectionID, |
const char * | name, | ||
float | value | ||
) |
int xplra_set_float_array | ( | int | connectionID, |
const char * | name, | ||
const float * | values, | ||
size_t | length, | ||
size_t | offset | ||
) |
int xplra_set_int | ( | int | connectionID, |
const char * | name, | ||
int | value | ||
) |
int xplra_set_int_array | ( | int | connectionID, |
const char * | name, | ||
const int32_t * | values, | ||
size_t | length, | ||
size_t | offset | ||
) |
int xplra_set_string | ( | int | connectionID, |
const char * | name, | ||
const char * | value, | ||
size_t | length, | ||
size_t | offset | ||
) |
int xplra_show_message | ( | int | connectionID, |
const char * | message, | ||
float | duration | ||
) |