Quick Start

Note

You will need a valid license to access and use the library. For more information on how to obtain a license, visit https://steinwurf.com/license.

If you already installed a C++14 compiler, git and python on your system, then you can clone this repository to a suitable folder:

git clone git@gitlab.com:steinwurf/otacast.git

After cloning the repository you will have the latest development snapshot. Unless you need to work on the latest and greatest we recommend that you switch to a released version of the library.

cd otacast
git checkout 

Using the Waf buildsystem

Waf is the primary buildsystem used at Steinwurf use this to build the library along with the tests, examples, and application.

Configure and build the project:

python waf configure
python waf build
python waf install --destdir=otacast_install

The final install step will create a folder containing all the necessary files needed to use the library (e.g. static library, headers etc.). You can change the output folder by passing a different path to --destdir. You can also copy/move this install folder anywhere you like.

Build using CMake

As an alternative to waf, we provide a minimal CMake build file. This is mainly to allow integration with external tools and codebase.

Note

The provided CMake build file will not build unit-tests, nor examples.

To build and install the library using CMake, use the following commands:

mkdir cmake_build
cd cmake_build/
cmake ..
make
make install DESTDIR=./otacast_install

Feel free to change the folder names as needed.

Use as Dependency in CMake

To depend on this project when using the CMake build system, add the following in your CMake build script:

add_subdirectory("/path/to/otacast" otacast)
target_link_libraries(<my_target> steinwurf::otacast)

Where <my_target> is replaced by your target.

Build example

To create your first “hello world” program using OTAcast you can try the following:

// with the Software (see accompanying file LICENSE.rst or
// https://www.steinwurf.com/license), unless otherwise different
// terms and conditions are agreed in writing between Licensee and
// Steinwurf ApS in which case the license will be regulated by that
// separate written agreement.
//
// License for Non-Commercial Usage
// Distributed under the "OTACAST RESEARCH LICENSE 1.2"
//
// Licensees holding a valid research license may use this project
// in accordance with the license agreement terms provided with the
// Software
//
// See accompanying file LICENSE.rst or https://www.steinwurf.com/license

#include <iostream>

#include <otacast/encoder.hpp>
#include <otacast/version.hpp>

int main()
{
    // Print the version of the library used
    std::cout << "version:      " << otacast::version() << "\n";

    // Create the encoder object with a specific finite field
    otacast::encoder encoder;

    auto width = otacast::codec_width::_32;
    std::size_t block_bytes = 1024 * 1000; // 1 MB
    std::size_t symbol_bytes = 1500;

    encoder.configure(width, block_bytes, symbol_bytes);

    std::cout << "block_bytes:  " << encoder.block_bytes() << "\n";
    std::cout << "symbol_bytes: " << encoder.symbol_bytes() << "\n";
    std::cout << "width:        " << encoder.width() << "\n";
    std::cout << "symbols       " << encoder.symbols() << "\n";
    return 0;
}

To compile with g++ (if you installed to the otacast_install local folder):

g++ main.cpp -std=c++14 -I otacast_install/include -L otacast_install/lib -lotacast

See the full API provided by the class encoder and class decoder objects to see all available operations.