Kinova API Documentation
KINOVAAPIUSBCOMMANDLAYER_API int GetAPIVersion ( std::vector< int > &  Response)

This function returns the API's version(major.minor.version). Basically, it returns COMMAND_LAYER_VERSION. The vector contains 3 values. The first one is the version, the second one is the major and the last one is the minor.

Parameters:
ResponseA vector that contains the version number of this library.
#include <iostream>
#include <dlfcn.h> //Ubuntu
#include <vector>
//Note that under windows, you may/will have to perform other #include

using namespace std;

int main()
{
        int result;
        std::vector<int> data;

        cout << "GetAPIVersion function example" << endl;

        //Handle for the library's command layer.
        void * commandLayer_handle;

        //Function pointers to the functions we need
        int (*MyInitAPI)();
        int (*MyCloseAPI)();
        int (*MyGetAPIVersion)(std::vector<int> &);

        //We load the library (Under Windows, use the function LoadLibrary)
        commandLayer_handle = dlopen("Kinova.API.USBCommandLayerUbuntu.so",RTLD_NOW|RTLD_GLOBAL);

        //We load the functions from the library (Under Windows, use GetProcAddress)
        MyInitAPI = (int (*)()) dlsym(commandLayer_handle,"InitAPI");
        MyCloseAPI = (int (*)()) dlsym(commandLayer_handle,"CloseAPI");
        MyGetAPIVersion = (int (*)(std::vector<int> &)) dlsym(commandLayer_handle,"GetAPIVersion");

        //If the was loaded correctly
        if((MyInitAPI == NULL) || (MyCloseAPI == NULL) || (MyGetAPIVersion == NULL))
        {
                cout << "Unable to initialize the command layer." << endl;
        }
        else
        {
                cout << "The command has been initialized correctly." << endl;

                result = (*MyGetAPIVersion)(data);

                cout << "API's version is : " << data[0] << "." << data[1] << "." << data[2] << endl;
        }

        return 0;
}
 All Classes Files Functions Variables Enumerations Enumerator Defines