23 #include "remote_bb_poster.h"
25 #include <blackboard/remote.h>
26 #include <interfaces/JoystickInterface.h>
27 #include <logging/logger.h>
42 unsigned short int port,
49 warning_printed_ =
false;
55 bb_->
close(joystick_if_);
64 logger_->
log_info(
"Joystick",
"Connection re-established, writing data");
65 warning_printed_ =
false;
72 joystick_if_->
write();
74 if (!warning_printed_) {
77 "Lost connection to BlackBoard, "
78 "will try to re-establish");
79 warning_printed_ =
true;
89 joystick_if_->
write();
97 joystick_if_->
write();
JoystickRemoteBlackBoardPoster(const char *host, unsigned short int port, fawkes::Logger *logger)
Constructor.
~JoystickRemoteBlackBoardPoster()
Destructor.
virtual void joystick_plugged(char num_axes, char num_buttons)
A (new) joystick has been plugged in.
virtual void joystick_unplugged()
The joystick has been unplugged and is no longer available.
virtual void joystick_changed(unsigned int pressed_buttons, float *axis_values)
Joystick data changed.
virtual bool try_aliveness_restore()=0
Try to restore the aliveness of the BlackBoard instance.
virtual bool is_alive() const =0
Check if the BlackBoard is still alive.
virtual Interface * open_for_writing(const char *interface_type, const char *identifier, const char *owner=NULL)=0
Open interface for writing.
virtual void close(Interface *interface)=0
Close interface.
Base class for exceptions in Fawkes.
void print_trace()
Prints trace to stderr.
void write()
Write from local copy into BlackBoard memory.
JoystickInterface Fawkes BlackBoard Interface.
void set_pressed_buttons(const uint32_t new_pressed_buttons)
Set pressed_buttons value.
void set_num_axes(const uint8_t new_num_axes)
Set num_axes value.
void set_num_buttons(const uint8_t new_num_buttons)
Set num_buttons value.
void set_axis(unsigned int index, const float new_axis)
Set axis value at given index.
virtual void log_warn(const char *component, const char *format,...)=0
Log warning message.
virtual void log_info(const char *component, const char *format,...)=0
Log informational message.
Fawkes library namespace.