12 #ifndef VRPN_CLIENT_ONLY 16 #define vrpn_CHANNEL_MAX 128 35 vrpn_int32 getNumChannels(
void)
const;
41 struct timeval timestamp;
49 virtual vrpn_int32 encode_to(
char *buf);
62 #ifndef VRPN_CLIENT_ONLY 66 const char *port,
int baud = 9600,
int bits = 8,
68 bool rts_flow =
false);
75 unsigned char buffer[1024];
78 int read_available_characters(
char *buffer,
int bytes);
122 vrpn_int32 setNumChannels(vrpn_int32 sizeRequested);
142 int setClipValues(
int channel,
double min,
double lowzero,
double highzero,
148 int setChannelValue(
int channel,
double value);
168 typedef struct _vrpn_ANALOGCB {
169 struct timeval msg_time;
195 return d_callback_list.register_handler(userdata, handler);
200 return d_callback_list.unregister_handler(userdata, handler);
const struct timeval vrpn_ANALOG_NOW
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
const int vrpn_ANALOG_PARTIAL
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...
class VRPN_API vrpn_Clipping_Analog_Server
vrpn_float64 * channels(void)
Exposes an array of values for the user to write into.
vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating system...
vrpn_float64 channel[vrpn_CHANNEL_MAX]
Generic connection class not specific to the transport mechanism.
virtual void mainloop()
For this server, the user must normally call report() or report_changes() directly. This mainloop() only takes care of the things any server object should do.
virtual int register_types(void)=0
Register the types of messages this device sends/receives. Return 0 on success, -1 on fail...
Analog server that can scale and clip its range to -1..1.
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 ...
All types of client/server/peer objects in VRPN should be derived from the vrpn_BaseClass type descri...
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Callback_List< vrpn_ANALOGCB > d_callback_list
This structure is what is passed to a vrpn_Connection message callback.
virtual int register_change_handler(void *userdata, vrpn_ANALOGCHANGEHANDLER handler)
const int vrpn_ANALOG_SYNCING
virtual int unregister_change_handler(void *userdata, vrpn_ANALOGCHANGEHANDLER handler)
Class from which all user-level (and other) classes that communicate with vrpn_Connections should der...
const int vrpn_ANALOG_FAIL
const int vrpn_ANALOG_RESETTING
void(VRPN_CALLBACK * vrpn_ANALOGCHANGEHANDLER)(void *userdata, const vrpn_ANALOGCB info)
const int vrpn_ANALOG_REPORT_READY