# Client API Samples

This repo contains some sample code to showcase how to initialize and run a few
API calls. It currently conists of one c file (src/main.c).

## Prerequisites

### Linux

To build on Linux you'll need:
- cmake
- gcc
- g++

Which on Debian based distros can be installed with:
```
sudo apt update && sudo apt install build-essential cmake
```

### Windows

On Windows you'll need:
- VisualStudio 2022 (BuildTools will work, no need for the full 
IDE)
- cmake (can be installed as a component when installing Visual Studio)

## To build the samples

0. Since you're reading this README, one might expect you already extracted the released archive (*.zip on Windows, *.tar.gz on Linux). If not, do so now.

1. Inside the extracted archive you'll want to navigate to \<extracted_release\>/samples.

2. Start a terminal/command prompt

3. Run `cmake -B build .`

4. Run `cmake --build build`

5. Run the built applications with:

```
# Linux:
./build/c_test_static
./build/c_test_shared

# Windows
./build/Debug/c_test_static.exe
./build/Debug/c_test_shared.exe
```

## License

The sample source code is licensed under MIT No Attribution license:

    Copyright (c) 2026 Kvaser AB

    Permission is hereby granted, free of charge, to any person obtaining a
    copy of this software and associated documentation files (the "Software"),
    to deal in the Software without restriction, including without limitation
    the rights to use, copy, modify, merge, publish, distribute, sublicense,
    and/or sell copies of the Software, and to permit persons to whom the
    Software is furnished to do so.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
    DEALINGS IN THE SOFTWARE.
