Skip to content
This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
Jimmy Wang edited this page Jun 7, 2022 · 2 revisions

ZenAPI is a C++ API for controlling the radar system and receiving streaming radar data from the ZPU.

The API is largely divided into the following parts

Connect and Disconnect

static void
Init(int* p_argc, char** p_argv[]);

//
// telemetry data, such as logs and heart beats, comes from TelemPort
// the connect and disconnect method is used to connect to the telemetry port
//
struct TelemPortOptions
{
std::uint16_t device_command_port = DEVICE_COMMAND_PORT;
std::uint16_t device_telem_port   = DEVICE_TELEM_PORT;
};

static void
Connect(const std::string& device_addr, const TelemPortOptions& ports);

static void
Disconnect();


//
// radar data comes from this port DataPort
// the bind and release method is used to connect to the data port
//
struct DataPortOptions
{
std::uint16_t host_stream_port = HOST_STREAM_PORT;
};

static void
Bind(const DataPortOptions& ports);

static void
Release();

Operating Modes

using Mode = std::string;

static std::vector<Mode>
ListModes();

Start and Stop Radar

static void
Start(
    const std::string& mode,
    const InstallOptions& installation,
    const std::string& streaming_address
);

static void
Stop();

Subscribe to Topics

using TrackerState = zpb::tracker::message::TrackerState;

static void
SubscribeTrackerStates();

static void
UnsubscribeTrackerStates();

static std::unique_ptr<TrackerState>
NextTrackerState();


using HousekeepingReport = zpb::telem::HousekeepingReport;

static void
SubscribeHousekeepingReports();

static void
UnsubscribeHousekeepingReports();

static std::unique_ptr<HousekeepingReport>
NextHousekeepingReport();


using LogMessage = zpb::telem::LogMessage;

static void
SubscribeLogMessages();

static void
UnsubscribeLogMessages();

static std::unique_ptr<LogMessage>
NextLogMessage();
Clone this wiki locally