22 #include "openprs_agent_thread.h" 24 #include <logging/logger.h> 25 #include <plugins/openprs/utils/openprs_comm.h> 26 #include <utils/time/time.h> 43 :
Thread(
"OpenPRSAgentThread",
Thread::OPMODE_WAITFORWAKEUP),
65 .connect(boost::bind(&OpenPRSAgentThread::handle_message,
this, _1, _2));
94 OpenPRSAgentThread::handle_message(std::string sender, std::string message)
97 message.erase(std::remove(message.begin(), message.end(),
'\n'), message.end());
109 agent_alive_ =
false;
Mode
OPRS kernel operation mode.
virtual ~OpenPRSAgentThread()
Destructor.
void get_time(struct timeval *tv) const
Returns the time of the selected time source.
Fawkes library namespace.
void get_systime(struct timeval *tv) const
Returns the system time.
const std::string openprs_kernel_name
The name of the kernel created for this thread.
A class for handling time.
Thread class encapsulation of pthreads.
Logger * logger
This is the Logger member used to access the logger.
OpenPRS kernel creation and communication aspect.
void set_openprs_gdb_delay(const bool enable_gdb_delay)
Enable/disable GDB delay.
Clock * clock
By means of this member access to the clock is given.
Thread aspect to use blocked timing.
virtual void finalize()
Finalize the thread.
virtual void loop()
Code to execute in the thread.
void add_openprs_data_path(const std::string &path)
Add an OpenPRS data path.
const char * name() const
Get name of thread.
virtual void log_error(const char *component, const char *format,...)=0
Log error message.
OpenPRSAgentThread(OpenPRSAspect::Mode oprs_mode, bool gdb_delay)
Constructor.
LockPtr< OpenPRSComm > openprs
OpenPRS kernel communication wrapper.
long get_sec() const
Get seconds.
long get_usec() const
Get microseconds.
virtual void log_debug(const char *component, const char *format,...)=0
Log debug message.
virtual void init()
Initialize the thread.
Configuration * config
This is the Configuration member used to access the configuration.
virtual std::string get_string(const char *path)=0
Get value from configuration which is of type string.