vrpn  07.33
Virtual Reality Peripheral Network
vrpn_nikon_controls.h
Go to the documentation of this file.
1 #ifndef VRPN_NIKON_CONTROLS_H
2 #define VRPN_NIKON_CONTROLS_H
3 
4 #include <stddef.h> // for NULL
5 
6 #include "vrpn_Analog.h" // for vrpn_Serial_Analog
7 #include "vrpn_Analog_Output.h" // for vrpn_Analog_Output
8 #include "vrpn_Configure.h" // for VRPN_CALLBACK, VRPN_API
9 #include "vrpn_Connection.h" // for vrpn_CONNECTION_LOW_LATENCY, etc
10 #include "vrpn_Shared.h" // for timeval
11 #include "vrpn_Types.h" // for vrpn_uint32, vrpn_float64
12 
14 public:
15  vrpn_Nikon_Controls(const char *device_name, vrpn_Connection *con = NULL, const char *port_name = "COM1");
17 
18  virtual void mainloop ();
19 
20 protected:
21  int _status;
22 
23  unsigned char _buffer[512]; //< Buffer of characters in report
24  unsigned _bufcount; //< How many characters we have so far
25 
26  double _requested_focus; //< Where we asked the focus to be set to
27 
28  struct timeval timestamp; //< Time of the last report from the device
29  struct timeval last_poll; //< Last time we polled the device
30 
31  virtual int reset(void); //< Set device back to starting config
32  virtual int get_report(void); //< Try to read a report from the device
33  virtual int set_channel(unsigned chan_num, vrpn_float64 value); //< Try to set the focus to this
34 
36  virtual void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
37 
39  virtual void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
40 
42  static int VRPN_CALLBACK handle_connect_message(void *userdata, vrpn_HANDLERPARAM p);
43 
46  static int VRPN_CALLBACK handle_request_message(void *userdata, vrpn_HANDLERPARAM p);
47 
49  static int VRPN_CALLBACK handle_request_channels_message(void *userdata, vrpn_HANDLERPARAM p);
50 };
51 
52 #endif
vrpn_Nikon_Controls::_bufcount
unsigned _bufcount
Definition: vrpn_nikon_controls.h:24
vrpn_Nikon_Controls::~vrpn_Nikon_Controls
~vrpn_Nikon_Controls(void)
Definition: vrpn_nikon_controls.h:16
vrpn_Serial_Analog
Definition: vrpn_Analog.h:63
vrpn_Types.h
vrpn_Nikon_Controls::_requested_focus
double _requested_focus
Definition: vrpn_nikon_controls.h:26
vrpn_Analog_Output.h
vrpn_Analog::report
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 ...
Definition: vrpn_Analog.C:94
vrpn_Nikon_Controls
Definition: vrpn_nikon_controls.h:13
vrpn_Analog_Output
Definition: vrpn_Analog_Output.h:26
vrpn_CONNECTION_LOW_LATENCY
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
Definition: vrpn_Connection.h:122
vrpn_HANDLERPARAM
This structure is what is passed to a vrpn_Connection message callback.
Definition: vrpn_Connection.h:44
vrpn_Shared.h
vrpn_BaseClass::mainloop
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition: vrpn_Connection.h:510
vrpn_Connection.h
vrpn_Analog.h
VRPN_CALLBACK
#define VRPN_CALLBACK
Definition: vrpn_Configure.h:647
vrpn_Configure.h
vrpn_Analog::report_changes
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...
Definition: vrpn_Analog.C:71
vrpn_Nikon_Controls::_status
int _status
Definition: vrpn_nikon_controls.h:21
VRPN_API
#define VRPN_API
Definition: vrpn_Configure.h:646