Skip to content

Latest commit

 

History

History
118 lines (92 loc) · 5.92 KB

README.md

File metadata and controls

118 lines (92 loc) · 5.92 KB

This application is used as reference code for developers to show how to use the C++ API to generate a runtime key. Once a runtime key is generated it must be activated to produce a token.

GPU acceleration

By default GPU acceleration is disabled. Check here for more information on how to enable.

Pre-built binaries

If you don't want to build this sample by yourself then, use the pre-built versions:

On Windows, the easiest way to try this sample is to navigate to binaries/windows/x86_64 and run binaries/windows/x86_64/runtimeKey.bat.

Building

This sample contains a single C++ source file and is easy to build. The documentation about the C++ API is at https://www.doubango.org/SDKs/micr/docs/cpp-api.html.

Windows

You'll need Visual Studio to build the code. The VS project is at runtimeKey.vcxproj. Open it.

  1. You will need to change the "Command Arguments" like the below image. Default value: --assets $(ProjectDir)..\..\..\assets
  2. You will need to change the "Environment" variable like the below image. Default value: PATH=$(VCRedistPaths)%PATH%;$(ProjectDir)..\..\..\binaries\windows\x86_64

VC++ config

You're now ready to build and run the sample.

Generic GCC

Next command is a generic GCC command:

cd ultimateMICR-SDK/samples/c++/runtimeKey

g++ runtimeKey.cxx -O3 -I../../../c++ -L../../../binaries/<yourOS>/<yourArch> -lultimate_micr-sdk -o runtimeKey
  • You've to change yourOS and yourArch with the correct values. For example, on Linux x86_64 they would be equal to linux and x86_64 respectively.
  • If you're cross compiling then, you'll have to change g++ with the correct triplet. For example, on Android ARM64 the triplet would be equal to aarch64-linux-android-g++.

Raspberry Pi (Raspbian OS)

To build the sample for Raspberry Pi you can either do it on the device itself or cross compile it on Windows, Linux or OSX machines. For more information on how to install the toolchain for cross compilation please check here.

cd ultimateMICR-SDK/samples/c++/runtimeKey

arm-linux-gnueabihf-g++ runtimeKey.cxx -O3 -I../../../c++ -L../../../binaries/raspbian/armv7l -lultimate_micr-sdk -o runtimeKey
  • On Windows: replace arm-linux-gnueabihf-g++ with arm-linux-gnueabihf-g++.exe
  • If you're building on the device itself: replace arm-linux-gnueabihf-g++ with g++ to use the default GCC

Testing

After building the application you can test it on your local machine.

Usage

runtimeKey is a command line application with the following usage:

runtimeKey \
      [--json <json-output:bool>] \
      [--assets <path-to-assets-folder>] \
      [--type <host-type>]

Options surrounded with [] are optional.

  • --json Whether to output the runtime license key as JSON string intead of raw string. Default: true.
  • --assets Path to the assets folder containing the configuration files and models. Default value is the current folder.
  • --type Defines how the license is attached to the machine/host. Possible values are aws-instance, aws-byol, azure-instance or azure-byol. Default: null. More info here.

Examples

For example, on Raspberry Pi you may call the runtimeKey application using the following command:

LD_LIBRARY_PATH=../../../binaries/raspbian/armv7l:$LD_LIBRARY_PATH ./runtimeKey \
    --json false \
    --assets ../../../assets

On Linux x86_64 you may use the next command:

LD_LIBRARY_PATH=../../../binaries/linux/x86_64:$LD_LIBRARY_PATH ./runtimeKey \
    --json false \
    --assets ../../../assets

On Windows x86_64, you may use the next command:

runtimeKey.exe ^
    --json false ^
    --assets ../../../assets

Please note that if you're cross compiling the application then you've to make sure to copy the application and both the assets and binaries folders to the target device.

Amazon Web Services (AWS) and Microsoft Azure

Please read this if you're planning to run the SDK on Amazon AWS or Microsoft Azure.