Changeset 36:29e3b676c0c2 in xplra for src/client/c/hu


Ignore:
Timestamp:
02/10/13 08:21:47 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
Phase:
public
Message:

Added a new command to query the versions

Location:
src/client/c/hu/varadiistvan/xplra
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/client/c/hu/varadiistvan/xplra/XPlane.cc

    r30 r36  
    193193//------------------------------------------------------------------------------
    194194
     195void XPlane::getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion)
     196    throw(Exception)
     197{
     198    stream->writeU8(Protocol::COMMAND_GET_VERSIONS);
     199    stream->flush();
     200    checkResult();
     201
     202    xplaneVersion = stream->readS32();
     203    xplmVersion = stream->readS32();
     204    xplraVersion = stream->readS32();
     205
     206    checkStream();
     207}
     208
     209//------------------------------------------------------------------------------
     210
    195211void XPlane::getScalar(const char* name, uint8_t type) throw(Exception)
    196212{
  • src/client/c/hu/varadiistvan/xplra/XPlane.h

    r30 r36  
    145145
    146146    /**
     147     * Get the versions of X-Plane, XPLM and the XPLRA plugin.
     148     */
     149    void getVersions(int& xplaneVersion, int& xplmVersion, int& xplraVersion) throw(Exception);
     150
     151    /**
    147152     * Get the integer value of the dataref with the given name.
    148153     */
  • src/client/c/hu/varadiistvan/xplra/xplra.cc

    r29 r36  
    498498//------------------------------------------------------------------------------
    499499
     500extern "C"int xplra_get_versions(int connectionID,
     501                                 int* xplaneVersion, int* xplmVersion,
     502                                 int* xplraVersion)
     503{
     504    Connection* connection = ConnectionSlot::getValue(connectionID);
     505    if (connection==0) return -1;
     506    try {
     507        connection->getVersions(*xplaneVersion, *xplmVersion, *xplraVersion);
     508        return 0;
     509    } catch (...) {
     510        connection->handleException();
     511        return -1;
     512    }
     513}
     514
     515//------------------------------------------------------------------------------
     516
    500517extern "C" int xplra_get_int(int* value, int connectionID, const char* name)
    501518{
  • src/client/c/hu/varadiistvan/xplra/xplra.h

    r29 r36  
    130130
    131131/*----------------------------------------------------------------------------*/
     132
     133/**
     134 * Get the versions of X-Plane, the XPLM library and XPLRA
     135 */
     136int xplra_get_versions(int connectionID,
     137                       int* xplaneVersion, int* xplmVersion,
     138                       int* xplraVersion);
     139
     140/*----------------------------------------------------------------------------*/
    132141/* Single dataref support                                                     */
    133142/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.