1#ifndef VRPN_YEI_3SPACE_H
2#define VRPN_YEI_3SPACE_H
27 double frames_per_second = 50,
28 const char *reset_commands[] = NULL);
41 void init(
bool calibrate_gyros_on_setup
43 ,
double red_LED_color
44 ,
double green_LED_color
45 ,
double blue_LED_color
59 virtual int reset(
void);
61 virtual void handle_report(
unsigned char *report);
65 vrpn_float32 d_LED_color[3];
86 unsigned char d_buffer[128];
90 struct timeval timestamp;
127 bool calibrate_gyros_on_setup =
false,
128 bool tare_on_setup =
false,
129 double frames_per_second = 50,
130 double red_LED_color = 0,
131 double green_LED_color = 0,
132 double blue_LED_color = 0,
134 const char *reset_commands[] = NULL);
143 virtual void flush_input(
void);
145 virtual bool get_report(
void);
149 bool send_binary_command(
const unsigned char *cmd,
int len);
154 bool send_ascii_command(
const char *cmd);
159 bool receive_LED_mode_response(
struct timeval *timeout = NULL);
164 bool receive_LED_values_response(
struct timeval *timeout = NULL);
200 bool calibrate_gyros_on_setup =
false,
201 bool tare_on_setup =
false,
202 double frames_per_second = 50,
203 double red_LED_color = 0,
204 double green_LED_color = 0,
205 double blue_LED_color = 0,
207 const char *reset_commands[] = NULL);
231 int serial_file_descriptor,
232 bool calibrate_gyros_on_setup =
false,
233 bool tare_on_setup =
false,
234 double frames_per_second = 50,
235 double red_LED_color = 0,
236 double green_LED_color = 0,
237 double blue_LED_color = 0,
239 const char *reset_commands[] = NULL);
254 virtual bool configure_dongle(
void);
257 virtual bool set_logical_id(vrpn_uint8 logical_id, vrpn_int32 serial_number);
260 virtual void flush_input(
void);
264 virtual bool get_report(
void);
269 bool send_binary_command_to_dongle(
const unsigned char *cmd,
int len);
273 bool send_binary_command(
const unsigned char *cmd,
int len);
278 bool send_ascii_command(
const char *cmd);
283 bool receive_LED_mode_response(
struct timeval *timeout = NULL);
288 bool receive_LED_values_response(
struct timeval *timeout = NULL);
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Send a report whether something has changed or not (for servers) Optionally, tell what time to stamp ...
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Send a report only if something has changed (for servers) Optionally, tell what time to stamp the val...
virtual int init(void)
Initialize things that the constructor can't. Returns 0 on success, -1 on failure.
Generic connection class not specific to the transport mechanism.
virtual void mainloop()
This function should be called each time through app mainloop.
Class to support reading data from a wireless YEI 3Space unit.
int get_serial_file_descriptor(void) const
Reports the serial_fd that was opened, so that additional sensors that use the same wireless dongle c...
Class to support reading data from a wired YEI 3Space unit.
Base class with routines for YEI 3Space units.
virtual bool receive_LED_values_response(struct timeval *timeout=NULL)=0
Read and parse the response to an LED-values request command. NULL timeout pointer means wait forever...
double d_frames_per_second
virtual bool receive_LED_mode_response(struct timeval *timeout=NULL)=0
Read and parse the response to an LED-state request command. NULL timeout pointer means wait forever....
virtual bool get_report(void)=0
virtual bool send_ascii_command(const char *cmd)=0
Put a ':' character at the front and ' ' at the end and then send the resulting command as an ASCII c...
unsigned d_expected_characters
int d_reset_command_count
unsigned d_characters_read
virtual void flush_input(void)=0
Flush any incoming characters in the communications channel.
virtual bool send_binary_command(const unsigned char *cmd, int len)=0
Compute the CRC for the message, append it, and send message. Returns true on success,...
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY