Index: src/client/c/hu/varadiistvan/xplra/xplra.cc
===================================================================
--- src/client/c/hu/varadiistvan/xplra/xplra.cc	(revision 24)
+++ src/client/c/hu/varadiistvan/xplra/xplra.cc	(revision 25)
@@ -505,4 +505,119 @@
 //------------------------------------------------------------------------------
 
+extern "C" int xplra_set_int(int connectionID, const char* name, int value)
+{
+    Connection* connection = Slot::getConnection(connectionID);
+    if (connection==0) return 0;
+    try {
+        connection->setInt(name, value);
+        return 0;
+    } catch (...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+extern "C" int xplra_set_float(int connectionID, const char* name, float value)
+{
+    Connection* connection = Slot::getConnection(connectionID);
+    if (connection==0) return 0;
+    try {
+        connection->setFloat(name, value);
+        return 0;
+    } catch (...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
+extern "C" int xplra_set_double(int connectionID, const char* name,
+                                double value)
+{
+    Connection* connection = Slot::getConnection(connectionID);
+    if (connection==0) return 0;
+    try {
+        connection->setDouble(name, value);
+        return 0;
+    } catch (...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+/*----------------------------------------------------------------------------*/
+
+extern "C" int xplra_set_float_array(int connectionID, const char* name,
+                                     const float* values,
+                                     size_t length, size_t offset)
+{
+    Connection* connection = Slot::getConnection(connectionID);
+    if (connection==0) return 0;
+    try {
+        connection->setFloatArray(name, values, length, offset);
+        return 0;
+    } catch (...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+/*----------------------------------------------------------------------------*/
+
+extern "C" int xplra_set_int_array(int connectionID, const char* name,
+                                   const int32_t* values,
+                                   size_t length, size_t offset)
+{
+    Connection* connection = Slot::getConnection(connectionID);
+    if (connection==0) return 0;
+    try {
+        connection->setIntArray(name, values, length, offset);
+        return 0;
+    } catch (...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+/*----------------------------------------------------------------------------*/
+
+extern "C" int xplra_set_byte_array(int connectionID, const char* name,
+                                    const void* values,
+                                    size_t length, size_t offset)
+{
+    Connection* connection = Slot::getConnection(connectionID);
+    if (connection==0) return 0;
+    try {
+        connection->setByteArray(name, reinterpret_cast<const uint8_t*>(values),
+                                 length, offset);
+        return 0;
+    } catch (...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+/*----------------------------------------------------------------------------*/
+
+extern "C" int xplra_set_string(int connectionID, const char* name,
+                                const char* value,
+                                size_t length, size_t offset)
+{
+    Connection* connection = Slot::getConnection(connectionID);
+    if (connection==0) return 0;
+    try {
+        connection->setString(name, value, length, offset);
+        return 0;
+    } catch (...) {
+        connection->handleException();
+        return -1;
+    }
+}
+
+//------------------------------------------------------------------------------
+
 extern "C" int xplra_disconnect(int connectionID)
 {
Index: src/client/c/hu/varadiistvan/xplra/xplra.h
===================================================================
--- src/client/c/hu/varadiistvan/xplra/xplra.h	(revision 24)
+++ src/client/c/hu/varadiistvan/xplra/xplra.h	(revision 25)
@@ -245,4 +245,76 @@
 
 /**
+ * Set the integer dataref with the given name to the given value.
+ *
+ * @return 0 on success, -1 on error.
+ */
+int xplra_set_int(int connectionID, const char* name, int value);
+
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Set the float dataref with the given name to the given value.
+ *
+ * @return 0 on success, -1 on error.
+ */
+int xplra_set_float(int connectionID, const char* name, float value);
+
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Set the double dataref with the given name to the given value.
+ *
+ * @return 0 on success, -1 on error.
+ */
+int xplra_set_double(int connectionID, const char* name, double value);
+
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Set the array of float values with the given name from the given
+ * buffer.
+ *
+ * @return 0 on success, -1 on error.
+ */
+int xplra_set_float_array(int connectionID, const char* name,
+                          const float* values, size_t length, size_t offset);
+
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Set the array of integer values with the given name from the given
+ * buffer.
+ *
+ * @return 0 on success, -1 on error.
+ */
+int xplra_set_int_array(int connectionID, const char* name,
+                        const int32_t* values, size_t length, size_t offset);
+
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Set the array of byte values with the given name from the given
+ * buffer.
+ *
+ * @return 0 on success, -1 on error.
+ */
+int xplra_set_byte_array(int connectionID, const char* name,
+                         const void* values, size_t length, size_t offset);
+
+/*----------------------------------------------------------------------------*/
+
+/**
+ * Set the array of byte values with the given name from the given
+ * string. The string will be padded with 0 if it has a length less
+ * than the given length.
+ *
+ * @return 0 on success, -1 on error.
+ */
+int xplra_set_string(int connectionID, const char* name,
+                     const char* value, size_t length, size_t offset);
+
+/*----------------------------------------------------------------------------*/
+
+/**
  * Destroy the connection with the given ID.
  *
Index: test/basicctest.c
===================================================================
--- test/basicctest.c	(revision 24)
+++ test/basicctest.c	(revision 25)
@@ -32,4 +32,5 @@
 
 #include <stdio.h>
+#include <string.h>
 
 //------------------------------------------------------------------------------
@@ -37,4 +38,6 @@
 int main()
 {
+    static const char* tailNum1 = "VAI";
+
     int retval = 0;
     const char* errorString = 0;
@@ -50,4 +53,9 @@
     float result5[8];
     float* result6 = 0;
+    float acfElevUp;
+    double localX;
+    float numBlades[8];
+    int32_t batteryArrayOn[8];
+    uint8_t tailNum[40];
 
     printf("Connection to X-Plane...\n");
@@ -167,4 +175,159 @@
     printf("\n\n");
 
+    printf("Setting the number of the engines to %d...\n", numEngines + 1);
+    if (xplra_set_int(connectionID, "sim/aircraft/engine/acf_num_engines",
+                      numEngines + 1)<0)
+    {
+        goto error;
+    }
+    if (xplra_get_int(&numEngines, connectionID,
+                      "sim/aircraft/engine/acf_num_engines")<0)
+    {
+        goto error;
+    }
+    printf("The new number of engines: %d\n\n", numEngines);
+
+
+    if (xplra_get_float(&acfElevUp, connectionID,
+                        "sim/aircraft/controls/acf_elev_up")<0)
+    {
+        goto error;
+    }
+    printf("Setting the aircraft elevator up control from %f to %f...\n",
+           acfElevUp, acfElevUp + 15.0);
+    if (xplra_set_float(connectionID,
+                        "sim/aircraft/controls/acf_elev_up",
+                        acfElevUp + 15.0) < 0)
+    {
+        goto error;
+    }
+    if (xplra_get_float(&acfElevUp, connectionID,
+                        "sim/aircraft/controls/acf_elev_up")<0)
+    {
+        goto error;
+    }
+    printf("The aircraft elevator up control set to %f\n\n", acfElevUp);
+
+    if (xplra_get_double(&localX, connectionID,
+                         "sim/flightmodel/position/local_x")<0)
+    {
+        goto error;
+    }
+    printf("Setting the aircraft's local X-coordinate from %f to %f...\n",
+           localX, localX + 15.0);
+    if (xplra_set_double(connectionID, "sim/flightmodel/position/local_x",
+                         localX + 15.0)<0)
+    {
+        goto error;
+    }
+    if (xplra_get_double(&localX, connectionID,
+                         "sim/flightmodel/position/local_x")<0)
+    {
+        goto error;
+    }
+    printf("The aircraft's local X-coordinate set to %f\n\n", localX);
+
+    length = xplra_get_float_array(numBlades,
+                                   sizeof(numBlades)/sizeof(numBlades[0]), 0,
+                                   connectionID,
+                                   "sim/aircraft/prop/acf_num_blades");
+    if (length<0) goto error;
+
+    printf("Setting the number of blades\n    from:");
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %f", numBlades[i]);
+    }
+    printf("\n    to:");
+    for(i = 0; i<length; ++i) {
+        numBlades[i] += 2.5;
+        if (i>0) printf(",");
+        printf(" %f", numBlades[i]);
+    }
+    printf("\n");
+    if (xplra_set_float_array(connectionID,
+                              "sim/aircraft/prop/acf_num_blades",
+                              numBlades, length, 0)<0)
+    {
+        goto error;
+    }
+    length = xplra_get_float_array(numBlades,
+                                   sizeof(numBlades)/sizeof(numBlades[0]), 0,
+                                   connectionID,
+                                   "sim/aircraft/prop/acf_num_blades");
+    if (length<0) goto error;
+    printf("The result:");
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %f", numBlades[i]);
+    }
+    printf("\n\n");
+
+    length = xplra_get_int_array(batteryArrayOn,
+                                 sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]),
+                                 0, connectionID,
+                                 "sim/cockpit/electrical/battery_array_on");
+    if (length<0) goto error;
+    printf("Setting the batteries\n    from:");
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %d", batteryArrayOn[i]);
+    }
+    printf("\n    to:");
+    for(i = 0; i<length; ++i) {
+        batteryArrayOn[i] = !batteryArrayOn[i];
+        numBlades[i] += 2.5;
+        if (i>0) printf(",");
+        printf(" %d", batteryArrayOn[i]);
+    }
+    printf("\n");
+    if (xplra_set_int_array(connectionID,
+                            "sim/cockpit/electrical/battery_array_on",
+                            batteryArrayOn, length, 0)<0)
+    {
+        goto error;
+    }
+    length = xplra_get_int_array(batteryArrayOn,
+                                 sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]),
+                                 0, connectionID,
+                                 "sim/cockpit/electrical/battery_array_on");
+    if (length<0) goto error;
+    printf("The result:");
+    for(i = 0; i<length; ++i) {
+        if (i>0) printf(",");
+        printf(" %d", batteryArrayOn[i]);
+    }
+    printf("\n\n");
+
+    memset(tailNum, 0, sizeof(tailNum));
+    strcpy((char*)tailNum, "HA-VAI");
+    printf("Setting the tail number to %s as a byte array...\n", tailNum);
+    if (xplra_set_byte_array(connectionID,
+                             "sim/aircraft/view/acf_tailnum",
+                             tailNum, sizeof(tailNum), 0)<0)
+    {
+        goto error;
+    }
+
+    memset(tailNum, 0, sizeof(tailNum));
+    length = xplra_get_byte_array(tailNum, sizeof(tailNum), 0,
+                                  connectionID,
+                                  "sim/aircraft/view/acf_tailnum");
+    if (length<0) goto error;
+    printf("The tail number is: '%s'\n\n", (char*)tailNum);
+
+    printf("Setting the tail number to %s as a string...\n", tailNum1);
+    if (xplra_set_string(connectionID, "sim/aircraft/view/acf_tailnum",
+                         tailNum1, 40, 0)<0)
+    {
+        goto error;
+    }
+    memset(tailNum, 0, sizeof(tailNum));
+    length = xplra_get_byte_array(tailNum, sizeof(tailNum), 0,
+                                  connectionID,
+                                  "sim/aircraft/view/acf_tailnum");
+    if (length<0) goto error;
+    printf("The tail number is: '%s'\n\n", (char*)tailNum);
+
     goto cleanup;
 error:
@@ -180,114 +343,4 @@
     if (connectionID>=0) xplra_disconnect(connectionID);
     return retval;
-
-    // try {
-
-
-    //     printf("Setting the number of the engines to %d...\n", numEngines + 1);
-    //     xplane.setInt("sim/aircraft/engine/acf_num_engines", numEngines + 1);
-    //     numEngines = xplane.getInt("sim/aircraft/engine/acf_num_engines");
-    //     printf("The new number of engines: %d\n\n", numEngines);
-
-    //     float acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up");
-    //     printf("Setting the aircraft elevator up control from %f to %f...\n",
-    //            acfElevUp, acfElevUp + 15.0);
-    //     xplane.setFloat("sim/aircraft/controls/acf_elev_up", acfElevUp);
-    //     acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up");
-    //     printf("The aircraft elevator up control set to %f\n\n", acfElevUp);
-
-    //     double localX = xplane.getDouble("sim/flightmodel/position/local_x");
-    //     printf("Setting the aircraft's local X-coordinate from %f to %f...\n",
-    //            localX, localX + 15.0);
-    //     xplane.setDouble("sim/flightmodel/position/local_x", localX + 15.0);
-    //     localX = xplane.getDouble("sim/flightmodel/position/local_x");
-    //     printf("The aircraft's local X-coordinate set to %f\n\n", localX);
-
-    //     float numBlades[8];
-    //     length = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades",
-    //                                   numBlades, sizeof(numBlades)/sizeof(numBlades[0]));
-
-    //     printf("Setting the number of blades\n    from:");
-    //     for(size_t i = 0; i<length; ++i) {
-    //         if (i>0) printf(",");
-    //         printf(" %f", numBlades[i]);
-    //     }
-    //     printf("\n    to:");
-    //     for(size_t i = 0; i<length; ++i) {
-    //         numBlades[i] += 2.5;
-    //         if (i>0) printf(",");
-    //         printf(" %f", numBlades[i]);
-    //     }
-    //     printf("\n");
-    //     xplane.setFloatArray("sim/aircraft/prop/acf_num_blades",
-    //                          numBlades, length);
-    //     length = xplane.getFloatArray("sim/aircraft/prop/acf_num_blades",
-    //                                   numBlades, sizeof(numBlades)/sizeof(numBlades[0]));
-    //     printf("The result:");
-    //     for(size_t i = 0; i<length; ++i) {
-    //         if (i>0) printf(",");
-    //         printf(" %f", numBlades[i]);
-    //     }
-    //     printf("\n\n");
-
-    //     int32_t batteryArrayOn[8];
-    //     length = xplane.getIntArray("sim/cockpit/electrical/battery_array_on",
-    //                                 batteryArrayOn,
-    //                                 sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]));
-
-    //     printf("Setting the batteries\n    from:");
-    //     for(size_t i = 0; i<length; ++i) {
-    //         if (i>0) printf(",");
-    //         printf(" %d", batteryArrayOn[i]);
-    //     }
-    //     printf("\n    to:");
-    //     for(size_t i = 0; i<length; ++i) {
-    //         batteryArrayOn[i] = !batteryArrayOn[i];
-    //         numBlades[i] += 2.5;
-    //         if (i>0) printf(",");
-    //         printf(" %d", batteryArrayOn[i]);
-    //     }
-    //     printf("\n");
-    //     xplane.setIntArray("sim/cockpit/electrical/battery_array_on",
-    //                        batteryArrayOn, length);
-    //     length = xplane.getIntArray("sim/cockpit/electrical/battery_array_on",
-    //                                 batteryArrayOn,
-    //                                 sizeof(batteryArrayOn)/sizeof(batteryArrayOn[0]));
-    //     printf("The result:");
-    //     for(size_t i = 0; i<length; ++i) {
-    //         if (i>0) printf(",");
-    //         printf(" %d", batteryArrayOn[i]);
-    //     }
-    //     printf("\n\n");
-
-    //     uint8_t tailNum[40];
-    //     memset(tailNum, 0, sizeof(tailNum));
-    //     strcpy(reinterpret_cast<char*>(tailNum), "HA-VAI");
-    //     printf("Setting the tail number to %s as a byte array...\n", tailNum);
-    //     xplane.setByteArray("sim/aircraft/view/acf_tailnum",
-    //                         tailNum, sizeof(tailNum));
-    //     printf("The tail number is: '%s'\n\n",
-    //            xplane.getString("sim/aircraft/view/acf_tailnum").c_str());
-
-    //     static const char* tailNum1 = "VAI";
-    //     printf("Setting the tail number to %s as a string...\n", tailNum1);
-    //     xplane.setString("sim/aircraft/view/acf_tailnum", tailNum1, 40);
-    //     printf("The tail number is: '%s'\n\n",
-    //            xplane.getString("sim/aircraft/view/acf_tailnum").c_str());
-
-    //     try {
-    //         printf("Querying an invalid dataref...\n");
-    //         xplane.getInt("sim/aircraft/engine/num_engines");
-    //         printf("\n>>>>>>>>>>>> Succeeded!!!!!!!!!!!!!!!!!!!!!!\n\n");
-    //     } catch(const ProtocolException& exception) {
-    //         printf("Exception caugth: %s\n\n", exception.what());
-    //     }
-
-
-    //     return 0;
-    // } catch(const Exception& exception) {
-    //     printf("\n>>>>>>>>>>>>>>>>> Exception caugth: %s\n", exception.what());
-
-    //     return 1;
-    // }
 }
 
Index: test/basictest.cc
===================================================================
--- test/basictest.cc	(revision 18)
+++ test/basictest.cc	(revision 25)
@@ -142,5 +142,5 @@
         printf("Setting the aircraft elevator up control from %f to %f...\n",
                acfElevUp, acfElevUp + 15.0);
-        xplane.setFloat("sim/aircraft/controls/acf_elev_up", acfElevUp);
+        xplane.setFloat("sim/aircraft/controls/acf_elev_up", acfElevUp + 15.0);
         acfElevUp = xplane.getFloat("sim/aircraft/controls/acf_elev_up");
         printf("The aircraft elevator up control set to %f\n\n", acfElevUp);
