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.
If you don't want to build this sample by yourself then, use the pre-built versions:
- Windows: runtimeKey.exe under binaries/windows/x86_64
- Linux: runtimeKey under binaries/linux/x86_64. Built on Ubuntu 18.
- Raspberry Pi: runtimeKey under binaries/raspbian/armv7l
- Android: check android folder
- iOS: check ios folder
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. You can edit this files to use your own configuration options.
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/mrz/docs/cpp-api.html.
You'll need Visual Studio and the project is at runtimeKey.vcxproj.
Next command is a generic GCC command:
cd ultimateMRZ-SDK/samples/c++/runtimeKey
g++ main.cxx -O3 -I../../../c++ -L../../../binaries/<yourOS>/<yourArch> -lultimate_mrz-sdk -o runtimeKey
- You've to change
yourOS
andyourArch
with the correct values. For example, on Linux x86_64 they would be equal tolinux
andx86_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 toaarch64-linux-android-g++
.
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 ultimateALPR-SDK/samples/c++/runtimeKey
arm-linux-gnueabihf-g++ main.cxx -O3 -I../../../c++ -L../../../binaries/raspbian/armv7l -lultimate_mrz-sdk -o runtimeKey
- On Windows: replace
arm-linux-gnueabihf-g++
witharm-linux-gnueabihf-g++.exe
- If you're building on the device itself: replace
arm-linux-gnueabihf-g++
withg++
to use the default GCC
After building the application you can test it on your local machine.
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.
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 true \
--assets ../../../assets
On Linux x86_64 you may use the next command:
LD_LIBRARY_PATH=../../../binaries/linux/x86_64:$LD_LIBRARY_PATH ./runtimeKey \
--json true \
--assets ../../../assets
On Windows x86_64 you may use the next command:
runtimeKey.exe ^
--json true ^
--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.
Please read this if you're planning to run the SDK on Amazon AWS or Microsoft Azure.