12#ifndef VRPN_CLIENT_ONLY
16#define vrpn_CHANNEL_MAX 128
62#ifndef VRPN_CLIENT_ONLY
66 const char *port,
int baud = 9600,
int bits = 8,
68 bool rts_flow =
false);
122 vrpn_int32 setNumChannels(vrpn_int32 sizeRequested);
168typedef struct _vrpn_ANALOGCB {
vrpn_Callback_List< vrpn_ANALOGCB > d_callback_list
virtual int unregister_change_handler(void *userdata, vrpn_ANALOGCHANGEHANDLER handler)
static int VRPN_CALLBACK handle_change_message(void *userdata, vrpn_HANDLERPARAM p)
vrpn_Analog_Remote(const char *name, vrpn_Connection *c=NULL)
virtual int register_change_handler(void *userdata, vrpn_ANALOGCHANGEHANDLER handler)
vrpn_float64 * channels(void)
Exposes an array of values for the user to write into.
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Makes public the protected base class function.
vrpn_Analog_Server(const char *name, vrpn_Connection *c, vrpn_int32 numChannels=vrpn_CHANNEL_MAX)
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Makes public the protected base class function.
virtual void mainloop()
For this server, the user must normally call report() or report_changes() directly....
vrpn_int32 getNumChannels(void) const
vrpn_float64 last[vrpn_CHANNEL_MAX]
vrpn_float64 channel[vrpn_CHANNEL_MAX]
virtual vrpn_int32 encode_to(char *buf)
vrpn_Analog(const char *name, vrpn_Connection *c=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...
vrpn_MESSAGEHANDLER handler
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
virtual int register_types(void)=0
Register the types of messages this device sends/receives. Return 0 on success, -1 on fail.
vrpn_BaseClass(const char *name, vrpn_Connection *c=NULL)
Names the device and assigns or opens connection, calls registration methods.
clipvals_struct clipvals[vrpn_CHANNEL_MAX]
int setChannelValue(int channel, double value)
This method should be used to set the value of a channel. It will be scaled and clipped as described ...
int setClipValues(int channel, double min, double lowzero, double highzero, double max)
Set the clipping values for the specified channel. min maps to -1, values between lowzero and highzer...
vrpn_Clipping_Analog_Server(const char *name, vrpn_Connection *c, vrpn_int32 numChannels=vrpn_CHANNEL_MAX)
Generic connection class not specific to the transport mechanism.
unsigned char buffer[1024]
vrpn_Serial_Analog(const char *name, vrpn_Connection *connection, const char *port, int baud=9600, int bits=8, vrpn_SER_PARITY parity=vrpn_SER_PARITY_NONE, bool rts_flow=false)
int read_available_characters(char *buffer, int bytes)
vrpn_float64 channel[vrpn_CHANNEL_MAX]
This structure is what is passed to a vrpn_Connection message callback.
const int vrpn_ANALOG_FAIL
const struct timeval vrpn_ANALOG_NOW
const int vrpn_ANALOG_REPORT_READY
void(VRPN_CALLBACK * vrpn_ANALOGCHANGEHANDLER)(void *userdata, const vrpn_ANALOGCB info)
const int vrpn_ANALOG_RESETTING
const int vrpn_ANALOG_PARTIAL
const int vrpn_ANALOG_SYNCING
All types of client/server/peer objects in VRPN should be derived from the vrpn_BaseClass type descri...
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
vrpn_Serial: Pulls all the serial port routines into one file to make porting to new operating system...
class VRPN_API vrpn_Clipping_Analog_Server