Prerequisites:

  • HeexSDK

    ℹ️ Info:

    If you don’t already have HeexSDK, follow this page to install HeexSDK.

We will use the samples provided in the Get-started folder of HeexSDK and customize them.

In this documentation, we will focus on the C++ version available in the /cpp subfolder, but a Python version is also available in the /python subfolder

Customize the sample monitor

  1. Navigate to the sample

    cd ~/Heex_SDK_<version>/get-started/cpp
    
  2. Edit your getStartedMonitor.cpp file

    1. Retrieve monitorUuid value by the UUID of your Monitor in the Web platform
    2. Replace the monitorUuid value on this line by the UUID of your monitor you have copied in your clipboard:
    const std::string recorderUuid = "R-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
    

Overriding of Agent Interfaces

generateRequestedValues()

The generateRequestedValues method should add the recorded value to contextualize your metadata. First navigate to the generateRequestedValues method and notice the two commented parameters.

  1. Uncomment both query and contextValues parameters by removing the /* and */

  2. Replace the return true; statement with the following lines to provide position and custom contextual values to your metadata:

    // Paste your position below
    double latitude = 37.795739190321555;
    double longitude = -122.42351359240077;
    this->addGNSSContextValue(contextValues, "position", latitude, longitude);
    
    // Paste your custom key and value pair below
    this->addContextValue(contextValues, "myCustomKey", "myCustomValue");
    
    return true;
    

You can personnalize the GPS location by choosing the ones of a place you like. You can use google maps to help you find the coordinates. Just right click where you like and click on the coordinates and the location is in your clipboard.

generateRequestedFilePaths()

The generateRequestedFilePaths method must return the path of the file your recorder generates. We can simulate it like so:

  1. Create a event recording by creating a file like so:

    echo "This is Smart Data!" > file.txt
    
  2. Uncomment the parameters query and filepath by removing the /* and */

  3. Change the return line in your generateRequestedFilePaths method with the absolute path of your file.txt file:

// Please enter here the absolute path of your file.txt file
filepath = "/path/get-started/cpp/file.txt";
return true;

💡 Tip: 🎉 CONGRATULATIONS!

You have completed the Recorder phase!

For python agents, directly go to step 4.

Compile your monitor & recorder

  1. Make sure you are still located in the right folder

    cd ~/Heex_SDK_<version>
    
  2. Compile

    ./heex sdk build --build-examples
    

For faster builds, specify the —jobs flag for multiple parrallel jobs. By default, it uses 1 job.

💡 Tip:

./heex sdk build —build-examples —jobs n



**To build your agents outside of sdk folder using cmakelists, you may use these commands!**

  > 💡 **Tip:** 
  >
  > ```bash
    cmake -DCMAKE_BUILD_TYPE=Release -S . -B build -DHEEX_SDK_DIR=~/Heex_SDK_<version>
    cmake --build build --config Release -j2
  1. Check if you see your Monitor and Recorder executables

    ls GetStartedMonitor GetStartedRecorder
    
  2. If yes, you can change the status of your monitor and recorder to Deployed in the web platform:

  3. The status of your System is now Ready (after reloading the page)