Utility

The Utility module, abbreviated util is used for general purpose functions and actions that are commonly used throughout the flyMS system

YAML::Node flyMS::get_config(const std::string &uri)

Get the flight configuration from the flyMS webserver and return it in the YAML::Node format.

Parameters:

uri – The URI of the flyMS webserver

Returns:

YAML::Node The flight configuration in the YAML::Node format

bool flyMS::wait_for_start_signal()

,

Returns:

0 on success, -1 if the EXITING status was set Blocks execution until either: 1. the start signal is received from the dsm controller, or 2. something calls “rc_set_state(EXITING)” The start signal is three toggles of the kill switch, then left to the ON position

Returns:

true if the start signal was received

Returns:

false if the EXITING status was set or an error occurred

static constexpr bool flyMS::kDEBUG_MODE = false

Defines the global constexpr variable kDEBUG_MODE that enables/disables debugging features. If used in an if constexpr statement, the compiler will optimize out the code block if kDEBUG_MODE is false leaving no runtime overhead in the production binary.