add a function to check if a block is initialized
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
#include <aman/types/Communication.h>
|
#include <aman/types/Communication.h>
|
||||||
|
|
||||||
|
#include "protobuf/AircraftReport.pb.h"
|
||||||
|
|
||||||
namespace aman {
|
namespace aman {
|
||||||
/**
|
/**
|
||||||
* @brief Defines the aircraft reporter class which sends aircraft information to the backend
|
* @brief Defines the aircraft reporter class which sends aircraft information to the backend
|
||||||
@@ -50,6 +52,11 @@ namespace aman {
|
|||||||
* @brief Terminates the reporter connection
|
* @brief Terminates the reporter connection
|
||||||
*/
|
*/
|
||||||
bool deinitialize();
|
bool deinitialize();
|
||||||
|
/**
|
||||||
|
* @brief Checks if the reporter is initialized
|
||||||
|
* @return True if it is initialized, else false
|
||||||
|
*/
|
||||||
|
bool initialized() const noexcept;
|
||||||
/**
|
/**
|
||||||
* @brief Sends a new message to the backend
|
* @brief Sends a new message to the backend
|
||||||
* @param[in] report The new aircraft report
|
* @param[in] report The new aircraft report
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ bool AircraftReporter::deinitialize() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AircraftReporter::initialized() const noexcept {
|
||||||
|
return nullptr != this->m_socket;
|
||||||
|
}
|
||||||
|
|
||||||
bool AircraftReporter::send(const aman::AircraftReport& report) {
|
bool AircraftReporter::send(const aman::AircraftReport& report) {
|
||||||
bool retval = false;
|
bool retval = false;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user