General Information (macOS version)

Development Kit is a library for creating clients’ applications.

The Development Kit library provides wide functionality: one can get the info about the user’s account, as well as about the nodes and available USB devices, manage local USB devices and connect to shared USB devices remotely.

With the Development Kit library one can also add a computer to the existing account, or disconnect any computer from the account.

The Development Kit library consists of the dynamic library and the set of header files.

The Development Kit library communicates with the Daemon installed on the computer for which it uses the same channel as used by the GUI application ( to communicate with the Daemon.

The Daemon can interact with only one client at a time.

So in case FlexiHub’s GUI is launched, the Development Kit library cannot get access to the Daemon, and vice versa.
In this case the application will get the corresponding message.

The info about the system status (connection to the server, availability of the drivers, etc.), as well as the info about the local and all other nodes in the users’ accounts, is sent to the Development Kit library by the Daemon.

The system status and the list of devices are changed asynchronously, so to get the current info, the callback functions are used.

The application gets signals about the changes via events.

However, the application can get the current state of all computers and the devices in the account from the Development Kit library even without using callback & events system.

The application can send various commands via the Development Kit library to manage computers and devices. Since certain time is required to execute the command, the command result is received via callback & events system as well.

The Development Kit Files

Having unpacked the DevKit archive, you will find the DevKit catalog, which contains the following files and catalogs:

 FlexiHub Devkit\
   ¦   fhcli - command-line utility example
   ¦   flexihubdk.dylib - DevKit dynamic library
      ¦   flexihub_devkit.h - header file for DevKit dynamic library
      ¦   flexihub_devkit_consts.h - additional header for DevKit events and constants
      +---cli - C++ source code for command-line utility example
      +---examples - set of simple C++ examples of DevKit dll usage;
      |              look at code to get the idea how different things work.
      +---jsoncpp - C++ library to manipulate JSON data
                    (required to compile examples and cli)

Link: C++ library to manipulate JSON data


Samples for Work with the DevKit Library

The “FlexiHub DevKit\C++examples\cli” catalog contains the source files for the command-line utility which works as the simple frontend for the DevKit library.

The files (constants and auxiliary functions) from theJsonCpp library code for work with JSON data from “FlexiHub DevKit\C++examples\jsoncpp” are used in “FlexiHub DevKit\C++examples\cli”, as well.

Additionally, you can find some simple samples of API DevKit dll usage in“FlexiHub DevKit\C++examples\examples”.

Command-Line Utility Description

The DevKit catalog contains the console command-line utilityfhcli, which allows executing the above mentioned commands via the DevKit dynamic library.

See detailed description of all subcommands in the “CLI Help” chapter.