Fawkes API  Fawkes Development Version
JoystickRemoteBlackBoardPoster Class Reference

Glue to post new data to a RemoteBlackBoard. More...

#include "remote_bb_poster.h"

Inheritance diagram for JoystickRemoteBlackBoardPoster:

Public Member Functions

 JoystickRemoteBlackBoardPoster (const char *host, unsigned short int port, fawkes::Logger *logger)
 Constructor. More...
 
 ~JoystickRemoteBlackBoardPoster ()
 Destructor. More...
 
fawkes::BlackBoardblackboard ()
 Get blackboard. More...
 
fawkes::JoystickInterfacejoystick_if ()
 Get joystick interface. More...
 
virtual void joystick_changed (unsigned int pressed_buttons, float *axis_values)
 Joystick data changed. More...
 
virtual void joystick_plugged (char num_axes, char num_buttons)
 A (new) joystick has been plugged in. More...
 
virtual void joystick_unplugged ()
 The joystick has been unplugged and is no longer available. More...
 
- Public Member Functions inherited from JoystickBlackBoardHandler
virtual ~JoystickBlackBoardHandler ()
 Virtual empty destructor. More...
 

Detailed Description

Glue to post new data to a RemoteBlackBoard.

Author
Tim Niemueller

Definition at line 35 of file remote_bb_poster.h.

Constructor & Destructor Documentation

◆ JoystickRemoteBlackBoardPoster()

JoystickRemoteBlackBoardPoster::JoystickRemoteBlackBoardPoster ( const char *  host,
unsigned short int  port,
fawkes::Logger logger 
)

Constructor.

Parameters
hostremote bb host to connect to
portremote bb port to connect to
loggerlogger

Definition at line 41 of file remote_bb_poster.cpp.

References fawkes::BlackBoard::open_for_writing().

◆ ~JoystickRemoteBlackBoardPoster()

JoystickRemoteBlackBoardPoster::~JoystickRemoteBlackBoardPoster ( )

Destructor.

Definition at line 53 of file remote_bb_poster.cpp.

References fawkes::BlackBoard::close().

Member Function Documentation

◆ blackboard()

fawkes::BlackBoard* JoystickRemoteBlackBoardPoster::blackboard ( )
inline

Get blackboard.

Returns
blackboard instance

Definition at line 45 of file remote_bb_poster.h.

Referenced by JoystickBlackBoardActListener::bb_interface_message_received().

◆ joystick_changed()

void JoystickRemoteBlackBoardPoster::joystick_changed ( unsigned int  pressed_buttons,
float *  axis_values 
)
virtual

Joystick data changed.

Parameters
pressed_buttonsthe new pressed_buttons array
axis_valuesarray of axis values, the length is at least num_axes()

Implements JoystickBlackBoardHandler.

Definition at line 60 of file remote_bb_poster.cpp.

References fawkes::BlackBoard::is_alive(), fawkes::Logger::log_info(), fawkes::Logger::log_warn(), fawkes::Exception::print_trace(), fawkes::JoystickInterface::set_axis(), fawkes::JoystickInterface::set_pressed_buttons(), fawkes::BlackBoard::try_aliveness_restore(), and fawkes::Interface::write().

◆ joystick_if()

fawkes::JoystickInterface* JoystickRemoteBlackBoardPoster::joystick_if ( )
inline

Get joystick interface.

Returns
joystick interface

Definition at line 50 of file remote_bb_poster.h.

Referenced by JoystickBlackBoardActListener::bb_interface_message_received().

◆ joystick_plugged()

void JoystickRemoteBlackBoardPoster::joystick_plugged ( char  num_axes,
char  num_buttons 
)
virtual

A (new) joystick has been plugged in.

Parameters
num_axesnumber of axes
num_buttonsnumber of buttons

Implements JoystickBlackBoardHandler.

Definition at line 85 of file remote_bb_poster.cpp.

References fawkes::JoystickInterface::set_num_axes(), fawkes::JoystickInterface::set_num_buttons(), and fawkes::Interface::write().

◆ joystick_unplugged()

void JoystickRemoteBlackBoardPoster::joystick_unplugged ( )
virtual

The joystick has been unplugged and is no longer available.

Implements JoystickBlackBoardHandler.

Definition at line 93 of file remote_bb_poster.cpp.

References fawkes::JoystickInterface::set_num_axes(), fawkes::JoystickInterface::set_num_buttons(), and fawkes::Interface::write().


The documentation for this class was generated from the following files: