24 #ifndef __INTERFACES_JOYSTICKINTERFACE_H_ 25 #define __INTERFACES_JOYSTICKINTERFACE_H_ 27 #include <interface/interface.h> 28 #include <interface/message.h> 29 #include <interface/field_iterator.h> 92 typedef struct __attribute__((packed)) {
93 int64_t timestamp_sec;
94 int64_t timestamp_usec;
114 } JoystickInterface_data_t;
116 JoystickInterface_data_t *data;
125 typedef struct __attribute__((packed)) {
126 int64_t timestamp_sec;
127 int64_t timestamp_usec;
133 uint16_t strong_magnitude;
134 uint16_t weak_magnitude;
135 } StartRumbleMessage_data_t;
137 StartRumbleMessage_data_t *data;
141 StartRumbleMessage(
const uint16_t ini_length,
const uint16_t ini_delay,
const Direction ini_direction,
const uint16_t ini_strong_magnitude,
const uint16_t ini_weak_magnitude);
147 uint16_t length()
const;
148 void set_length(
const uint16_t new_length);
149 size_t maxlenof_length()
const;
150 uint16_t delay()
const;
151 void set_delay(
const uint16_t new_delay);
152 size_t maxlenof_delay()
const;
154 void set_direction(
const Direction new_direction);
155 size_t maxlenof_direction()
const;
156 uint16_t strong_magnitude()
const;
157 void set_strong_magnitude(
const uint16_t new_strong_magnitude);
158 size_t maxlenof_strong_magnitude()
const;
159 uint16_t weak_magnitude()
const;
160 void set_weak_magnitude(
const uint16_t new_weak_magnitude);
161 size_t maxlenof_weak_magnitude()
const;
162 virtual Message * clone()
const;
169 typedef struct __attribute__((packed)) {
170 int64_t timestamp_sec;
171 int64_t timestamp_usec;
172 } StopRumbleMessage_data_t;
174 StopRumbleMessage_data_t *data;
183 virtual Message * clone()
const;
190 typedef struct __attribute__((packed)) {
191 int64_t timestamp_sec;
192 int64_t timestamp_usec;
193 } StopAllMessage_data_t;
195 StopAllMessage_data_t *data;
204 virtual Message * clone()
const;
226 float *
axis()
const;
227 float axis(
unsigned int index)
const;
228 void set_axis(
unsigned int index,
const float new_axis);
229 void set_axis(
const float * new_axis);
237 virtual const char *
enum_tostring(
const char *enumtype,
int val)
const;
static const uint32_t BUTTON_14
BUTTON_14 constant.
static const uint32_t BUTTON_4
BUTTON_4 constant.
static const uint32_t BUTTON_15
BUTTON_15 constant.
static const uint32_t BUTTON_23
BUTTON_23 constant.
size_t maxlenof_ff_effects() const
Get maximum length of ff_effects value.
static const uint32_t BUTTON_28
BUTTON_28 constant.
Base class for all messages passed through interfaces in Fawkes BlackBoard.
virtual void copy_values(const Interface *other)
Copy values from other interface.
static const uint32_t BUTTON_1
BUTTON_1 constant.
StopAllMessage Fawkes BlackBoard Interface Message.
JoystickInterface Fawkes BlackBoard Interface.
static const uint8_t JFF_SPRING
JFF_SPRING constant.
static const uint32_t BUTTON_7
BUTTON_7 constant.
static const uint32_t BUTTON_32
BUTTON_32 constant.
static const uint8_t JFF_RAMP
JFF_RAMP constant.
Fawkes library namespace.
Direction
Effect direction.
void set_pressed_buttons(const uint32_t new_pressed_buttons)
Set pressed_buttons value.
static const uint32_t BUTTON_22
BUTTON_22 constant.
static const uint32_t BUTTON_27
BUTTON_27 constant.
static const uint32_t BUTTON_8
BUTTON_8 constant.
Base class for all Fawkes BlackBoard interfaces.
static const uint32_t BUTTON_20
BUTTON_20 constant.
virtual const char * enum_tostring(const char *enumtype, int val) const
Convert arbitrary enum value to string.
float * axis() const
Get axis value.
StopRumbleMessage Fawkes BlackBoard Interface Message.
void set_num_axes(const uint8_t new_num_axes)
Set num_axes value.
size_t maxlenof_num_buttons() const
Get maximum length of num_buttons value.
static const uint32_t BUTTON_11
BUTTON_11 constant.
static const uint8_t JFF_FRICTION
JFF_FRICTION constant.
static const uint8_t JFF_PERIODIC
JFF_PERIODIC constant.
static const uint32_t BUTTON_18
BUTTON_18 constant.
static const uint32_t BUTTON_12
BUTTON_12 constant.
const char * type() const
Get type of interface.
static const uint32_t BUTTON_21
BUTTON_21 constant.
static const uint32_t BUTTON_19
BUTTON_19 constant.
uint8_t supported_ff_effects() const
Get supported_ff_effects value.
uint32_t pressed_buttons() const
Get pressed_buttons value.
static const uint32_t BUTTON_6
BUTTON_6 constant.
static const uint32_t BUTTON_17
BUTTON_17 constant.
static const uint32_t BUTTON_16
BUTTON_16 constant.
static const uint32_t BUTTON_24
BUTTON_24 constant.
static const uint8_t JFF_DAMPER
JFF_DAMPER constant.
static const uint32_t BUTTON_13
BUTTON_13 constant.
uint8_t ff_effects() const
Get ff_effects value.
virtual bool message_valid(const Message *message) const
Check if message is valid and can be enqueued.
StartRumbleMessage Fawkes BlackBoard Interface Message.
static const uint8_t JFF_RUMBLE
JFF_RUMBLE constant.
static const uint32_t BUTTON_10
BUTTON_10 constant.
void set_supported_ff_effects(const uint8_t new_supported_ff_effects)
Set supported_ff_effects value.
static const uint32_t BUTTON_30
BUTTON_30 constant.
void set_axis(unsigned int index, const float new_axis)
Set axis value at given index.
static const uint32_t BUTTON_2
BUTTON_2 constant.
static const uint32_t BUTTON_29
BUTTON_29 constant.
static const uint32_t BUTTON_9
BUTTON_9 constant.
uint8_t num_axes() const
Get num_axes value.
static const uint8_t JFF_INERTIA
JFF_INERTIA constant.
size_t maxlenof_pressed_buttons() const
Get maximum length of pressed_buttons value.
const char * tostring_Direction(Direction value) const
Convert Direction constant to string.
void set_ff_effects(const uint8_t new_ff_effects)
Set ff_effects value.
static const uint32_t BUTTON_3
BUTTON_3 constant.
uint8_t num_buttons() const
Get num_buttons value.
static const uint32_t BUTTON_5
BUTTON_5 constant.
size_t maxlenof_axis() const
Get maximum length of axis value.
size_t maxlenof_num_axes() const
Get maximum length of num_axes value.
virtual Message * create_message(const char *type) const
Create message based on type name.
std::map< int, std::string > interface_enum_map_t
Map of enum integer to string values.
static const uint8_t JFF_CONSTANT
JFF_CONSTANT constant.
void set_num_buttons(const uint8_t new_num_buttons)
Set num_buttons value.
static const uint32_t BUTTON_26
BUTTON_26 constant.
static const uint32_t BUTTON_31
BUTTON_31 constant.
static const uint32_t BUTTON_25
BUTTON_25 constant.
size_t maxlenof_supported_ff_effects() const
Get maximum length of supported_ff_effects value.