Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The IDL library itself You can create a custom driver for the SmartServer to provide support for additional protocols not built into the standard SmartServer software.  To develop a custom driver you implement your driver-specific code in C++ using the GNU C++ compiler (g++) and link your driver with the IAP Driver Library (IDL) that is included with the SmartServer.  IDL is implemented as a shared object (.SO) written in C++, as is the associated header file, libidl.hIt is designed to be compiled with a custom driver application also written in C++ using the GNU compiler (g++).  The SmartServer IoT includes an installed instance of GCC (GNU Compiler Collections) and the g++ compiler.  Using a console application like PuTTY to access the SmartServer IoT, you can verify the installation of g++ by checking the version using the ‘g++ --version’ command from the console. 



The provided example IDL custom driver includes a simple makefile.  Using the makefile is the easiest way to compile this example driver.  Using a console application, navigate to the /var/apollo/data/example/ directory and simply type enter make’ to compile the example.

...

The make file specifies the –g option with g++ in order to include the debugging information in the resulting object / executable file.  For You can exclude this option for a final driver build, you might exclude this option.  Several library files must also be specified in the compilation process including:

...

After compiling the application, the resulting executable ( /.example ) can be found is in the /var/apollo/data/example/ directory.

While this documentation section is focused on the basics associated with compiling up the provided example IDL custom driver , developers are likely aware that there are options for developing & compiling IDL driver source code on a PC, on a SmartServer, you can also develop and compile on a different computer such as a Windows-based PCcomputer.  Running an IDL custom driver on a non-Linux target other than that SmartServer IoT may not be practical, given the close connection between an IDL a custom driver and the underlying hardware and the SmartServer IoT’s CMS, but development environments like Visual Studio Code can facilitate code development.  While there is plenty of information online dedicated to cross-compiling C++ code using GCC (g++), here Following are a few tools that you might find usefuluseful tools for developing a custom driver on a Windows host.

The Microsoft C/C++ extension for Visual Studio Code enables cross-platform C and C++ development on Windows and Linux.  This extension can be easily downloaded & installed from within Visual Studio Code.

...

Within Visual Studio Code you can ‘Configure Default Build Task’ from the Terminal and choose g++.exe as the active build file which will create an associated tasks.json file in the .vscode folder.  This ultimately provides a means to build IDL custom driver code via the ‘Run Build Task’ from the Terminal in Visual Studio Code.

...