31 #ifndef LIBSTRATCOM_INCLUDE_GUARD_STRATCOM_H_
32 #define LIBSTRATCOM_INCLUDE_GUARD_STRATCOM_H_
35 # ifdef LIBSTRATCOM_EXPORT
36 # define LIBSTRATCOM_API __declspec(dllexport)
38 # define LIBSTRATCOM_API __declspec(dllimport)
41 # define LIBSTRATCOM_API
50 struct stratcom_device_;
68 typedef enum stratcom_button_ {
89 typedef enum stratcom_button_led_ {
105 typedef enum stratcom_axis_ {
122 typedef enum stratcom_led_state_ {
132 typedef enum stratcom_slider_state_ {
159 typedef struct stratcom_input_state_ {
181 typedef struct stratcom_input_event_button_ {
189 typedef struct stratcom_input_event_slider_ {
196 typedef struct stratcom_input_event_axis_ {
203 typedef enum stratcom_input_event_type_ {
213 typedef struct stratcom_input_event_ {
223 struct stratcom_input_event_*
next;
232 typedef enum stratcom_return_ {
374 uint8_t* out_on_time, uint8_t* out_off_time);
386 uint8_t on_time, uint8_t off_time);
LIBSTRATCOM_API stratcom_button_led stratcom_get_led_for_button(stratcom_button button)
Obtain the matching LED for a given button.
The button labeled '+'.
Definition: stratcom.h:75
Slider set to the position marked with three circles.
Definition: stratcom.h:136
The LED of the button labeled '4'.
Definition: stratcom.h:93
Rotational Z-axis.
Definition: stratcom.h:108
LIBSTRATCOM_API stratcom_return stratcom_read_led_blink_intervals(stratcom_device *device)
Read the led blink intervals from the physical device.
The LED of the button labeled 'REC'.
Definition: stratcom.h:96
LIBSTRATCOM_API stratcom_device * stratcom_open_device_on_path(char const *device_path)
Open a Strategic Commander device on a certain HID device path.
LIBSTRATCOM_API stratcom_input_event * stratcom_create_input_events_from_states(stratcom_input_state *old_state, stratcom_input_state *new_state)
Generate a linked list of input events, describing the changes between two input states.
A read operation returned without reading any new data.
Definition: stratcom.h:235
The LED of the button labeled '5'.
Definition: stratcom.h:94
The button labeled '1'.
Definition: stratcom.h:69
The top shift button.
Definition: stratcom.h:77
Addresses all LEDs at once.
Definition: stratcom.h:97
The button labeled '3'.
Definition: stratcom.h:71
The LED of the button labeled '1'.
Definition: stratcom.h:90
Vertical Y-axis.
Definition: stratcom.h:107
The button labeled 'REC'.
Definition: stratcom.h:80
Slider set to the position marked with two circles.
Definition: stratcom.h:135
stratcom_input_event_type
Different input types that can form a stratcom_input_event.
Definition: stratcom.h:203
LIBSTRATCOM_API void stratcom_shutdown()
Finalize the libstratcom library.
LIBSTRATCOM_API int stratcom_is_button_pressed(stratcom_device *device, stratcom_button button)
Check the state of a single button in the internal input state.
stratcom_led_state
LED State.
Definition: stratcom.h:122
An error occured while executing.
Definition: stratcom.h:234
Slider event.
Definition: stratcom.h:205
LIBSTRATCOM_API stratcom_button stratcom_iterate_buttons_range_end()
The end of the button range.
The function completed successfully.
Definition: stratcom.h:233
Axis event.
Definition: stratcom.h:206
LIBSTRATCOM_API stratcom_return stratcom_init()
Initialize the libstratcom library.
Slider position is unknown.
Definition: stratcom.h:133
LED is constantly lit.
Definition: stratcom.h:123
LED is constantly dark.
Definition: stratcom.h:124
LIBSTRATCOM_API stratcom_return stratcom_set_led_blink_interval(stratcom_device *device, uint8_t on_time, uint8_t off_time)
Set the blink intervals for blinking LEDs.
LIBSTRATCOM_API stratcom_button stratcom_iterate_buttons_range_begin()
The beginning of the button range.
LED is blinking.
Definition: stratcom.h:125
Refers to no button.
Definition: stratcom.h:81
LIBSTRATCOM_API stratcom_input_state stratcom_get_input_state(stratcom_device *device)
Retrieve a copy of the internal input state.
stratcom_slider_state
Slider State.
Definition: stratcom.h:132
The button labeled '6'.
Definition: stratcom.h:74
struct stratcom_device_ stratcom_device
Opaque device structure.
Definition: stratcom.h:54
LIBSTRATCOM_API stratcom_slider_state stratcom_get_slider_state(stratcom_device *device)
Get the position of the slider in the internal input state.
The button labeled '5'.
Definition: stratcom.h:73
The middle shift button.
Definition: stratcom.h:78
LIBSTRATCOM_API stratcom_return stratcom_read_input_with_timeout(stratcom_device *device, int timeout_milliseconds)
Wait for a new input report and read it from the physical device to update the internal input state...
Button event.
Definition: stratcom.h:204
LIBSTRATCOM_API stratcom_button stratcom_iterate_buttons_range_increment(stratcom_button button)
Increment a button range iterator.
LIBSTRATCOM_API stratcom_input_event * stratcom_append_input_events_from_states(stratcom_input_event *events, stratcom_input_state *old_state, stratcom_input_state *new_state)
Append input events created from two input states to an existing list.
The button labeled '2'.
Definition: stratcom.h:70
LIBSTRATCOM_API stratcom_return stratcom_read_button_led_state(stratcom_device *device)
Read the button led state from the physical device.
LIBSTRATCOM_API void stratcom_close_device(stratcom_device *device)
Close a device.
LIBSTRATCOM_API stratcom_return stratcom_set_button_led_state(stratcom_device *device, stratcom_button_led led, stratcom_led_state state)
Set the state of a specific LED.
stratcom_button
Button Identifiers.
Definition: stratcom.h:68
The button labeled '-'.
Definition: stratcom.h:76
LIBSTRATCOM_API void stratcom_get_led_blink_interval(stratcom_device *device, uint8_t *out_on_time, uint8_t *out_off_time)
Retrieve the current blink intervals from the internal state.
uint16_t stratcom_button_word
Button Word.
Definition: stratcom.h:144
stratcom_button_led
Button LED Identifiers.
Definition: stratcom.h:89
LIBSTRATCOM_API stratcom_led_state stratcom_get_button_led_state(stratcom_device *device, stratcom_button_led led)
Retrieve the current state of a specific LED.
LIBSTRATCOM_API void stratcom_set_button_led_state_without_flushing(stratcom_device *device, stratcom_button_led led, stratcom_led_state state)
Set the state of a specific LED in the internal state.
The button labeled '4'.
Definition: stratcom.h:72
Horizontal X-axis.
Definition: stratcom.h:106
LIBSTRATCOM_API stratcom_return stratcom_read_input_non_blocking(stratcom_device *device)
Read a new input report from the physical device to update the internal input state, if available.
The LED of the button labeled '2'.
Definition: stratcom.h:91
Slider set to the position marked with one circle.
Definition: stratcom.h:134
LIBSTRATCOM_API stratcom_return stratcom_read_input(stratcom_device *device)
Wait for a new input report and read it from the physical device to update the internal input state...
int16_t stratcom_axis_word
Axis Word.
Definition: stratcom.h:149
The LED of the button labeled '6'.
Definition: stratcom.h:95
The LED of the button labeled '3'.
Definition: stratcom.h:92
LIBSTRATCOM_API void stratcom_free_input_events(stratcom_input_event *events)
Free a list of input events.
stratcom_return
Return type.
Definition: stratcom.h:232
stratcom_axis
Axis Identifier.
Definition: stratcom.h:105
LIBSTRATCOM_API stratcom_device * stratcom_open_device()
Open a Strategic Commander device for use with the library.
LIBSTRATCOM_API stratcom_return stratcom_flush_button_led_state(stratcom_device *device)
Flush the current internal LED state to the physical device.
LIBSTRATCOM_API int stratcom_led_state_has_unflushed_changes(stratcom_device *device)
Check whether the internal LED state contains unflushed changes.
The lower shift button.
Definition: stratcom.h:79
Addresses nothing.
Definition: stratcom.h:98
LIBSTRATCOM_API stratcom_axis_word stratcom_get_axis_value(stratcom_device *device, stratcom_axis axis)
Get the value of a particular axis in the internal input state.