You can download the C++ version of the Squidstat API from the Admiral Instruments GitHub page or clone the repository using Git on your machine.
Cloning the Repository
- To clone the repository, you will need to install Git. Depending on your platform, you can download the Git tool from this link.
- To verify if Git is properly installed, you can follow these steps:
- Open the command prompt.
- Type
git -v
and press Enter.
- If Git is installed correctly, you should see the version information displayed in the terminal. ex:
git version 2.41.0.windows.1
- Open a command prompt and navigate to the directory where you want the API to be. Note: A new folder will be created automatically after the next step.
- Clone the API from the Git repository by typing the following command in the command prompt and pressing Enter.
git clone https://github.com/Admiral-Instruments/AdmiralSquidstatAPI
The result in the command prompt should look like this:
Cloning into 'AdmiralSquidstatAPI'...
remote: Enumerating objects: 1846, done.
remote: Counting objects: 100% (508/508), done.
remote: Compressing objects: 100% (159/159), done.
remote: Total 1846 (delta 440), reused 360 (delta 349), pack-reused 1338
Receiving objects: 100% (1846/1846), 79.18 MiB | 10.10 MiB/s, done.
Resolving deltas: 100% (1044/1044), done.
The AdmiralSquidstatAPI
folder will now be created, and it contains all the files required to get started with the API using a compatible compiler. We will refer to this folder as the "Root Directory" of the API.
Mac ARM64 (Apple Silicon)
If you are using a newer Mac with an ARM64 processor (M1, M2, etc.), you must perform additional steps to set up the Squidstat API.
- Open the cloned repository in a Finder window and navigate down a level to
./SquidstatLibrary
.
- In this folder you should see
Linux
, mac
, windows
, and mac.tar.gz
.
- Delete the
mac
directory. It contains the library for Intel-based Mac processors.
- Extract the tar file by double clicking
mac.tar.gz
in the Finder window.
- You should see a new
mac/
directory get automatically created.
- At this point, your build environment is set up, and you can proceed normally.
Linux
If you are on a device running Linux, before using the API, run sudo ./SquidstatLibrary/Linux/install_dependencies.sh
from the root directory of the SquidstatAPI. This will install all dependencies and configuration files needed to run the API.
Note: This will run apt-get update && sudo apt-get upgrade -y
which will update all packages currently installed on your device.
CMake Installation
The API uses CMake natively to build the project. Provided is a CMakeLists.txt file which you can include in your project to build the API.
- To utilize the CMakeLists.txt file, you need to install CMake. You can download CMake from here.
Note: When installing, be sure to add the CMake executable to your environment variables.
- To verify if CMake is installed correctly, type
cmake
in the command prompt and press Enter.
Building the project
- To use the API on Windows you must install MSVC64 through Visual Studio. For Mac and Linux install Clang.
- Open a command prompt or terminal in the root directory of the API.
Run the following command to generate the build files for the compiler installed in your environment.
cmake -B ./build -S ./SquidstatLibrary/
Note: If you want to use a different build generator, use the -G
option.
- Build the project using the following command. This will compile all examples present in the
SquidstatLibrary
directory.
- You can now run any of the examples through their compiled executable. ex:
./build/examples/FirmwareUpdateDemo/Debug/FirmwareUpdateDemo.exe