vrpn  07.33
Virtual Reality Peripheral Network
vrpn_Analog Class Reference

#include <vrpn_Analog.h>

Inheritance diagram for vrpn_Analog:
Collaboration diagram for vrpn_Analog:

Public Member Functions

 vrpn_Analog (const char *name, vrpn_Connection *c=NULL)
 
void print (void)
 
vrpn_int32 getNumChannels (void) const
 
- Public Member Functions inherited from vrpn_BaseClass
 vrpn_BaseClass (const char *name, vrpn_Connection *c=NULL)
 Names the device and assigns or opens connection, calls registration methods. More...
 
virtual ~vrpn_BaseClass ()
 
virtual void mainloop ()=0
 Called once through each main loop iteration to handle updates. Remote object mainloop() should call client_mainloop() and then call d_connection->mainloop(). Server object mainloop() should service the device and then call server_mainloop(), but should not normally call d_connection->mainloop(). More...
 
- Public Member Functions inherited from vrpn_BaseClassUnique
 vrpn_BaseClassUnique ()
 
virtual ~vrpn_BaseClassUnique ()
 Unregister all of the message handlers that were to be autodeleted. More...
 
vrpn_ConnectionconnectionPtr ()
 Returns a pointer to the connection this object is using. More...
 

Protected Member Functions

virtual int register_types (void)
 Register the types of messages this device sends/receives. Return 0 on success, -1 on fail. More...
 
virtual vrpn_int32 encode_to (char *buf)
 
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 value with. More...
 
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 the value with. More...
 
- Protected Member Functions inherited from vrpn_BaseClass
virtual int init (void)
 Initialize things that the constructor can't. Returns 0 on success, -1 on failure. More...
 
virtual int register_senders (void)
 Register the sender for this device (by default, the name of the device). Return 0 on success, -1 on fail. More...
 
- Protected Member Functions inherited from vrpn_BaseClassUnique
int register_autodeleted_handler (vrpn_int32 type, vrpn_MESSAGEHANDLER handler, void *userdata, vrpn_int32 sender=vrpn_ANY_SENDER)
 Registers a handler with the connection, and remembers to delete at destruction. More...
 
int send_text_message (const char *msg, struct timeval timestamp, vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL, vrpn_uint32 level=0)
 Sends a NULL-terminated text message from the device d_sender_id. More...
 
SendTextMessageBoundCall send_text_message (vrpn_TEXT_SEVERITY type=vrpn_TEXT_NORMAL)
 Returns an object you can stream into to send a text message from the device like send_text_message(vrpn_TEXT_WARNING) << "Value of i is: " << i; This use requires including vrpn_SendTextMessageStreamProxy.h. More...
 
void server_mainloop (void)
 Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should be called by all servers in their mainloop() More...
 
void client_mainloop (void)
 Handles functions that all clients should provide in their mainloop() (warning of no server, for example) Should be called by all clients in their mainloop() More...
 

Protected Attributes

vrpn_float64 channel [vrpn_CHANNEL_MAX]
 
vrpn_float64 last [vrpn_CHANNEL_MAX]
 
vrpn_int32 num_channel
 
struct timeval timestamp
 
vrpn_int32 channel_m_id
 
int status
 
- Protected Attributes inherited from vrpn_BaseClassUnique
vrpn_Connectiond_connection
 Connection that this object talks to. More...
 
char * d_servicename
 Name of this device, not including the connection part. More...
 
vrpn_int32 d_sender_id
 Sender ID registered with the connection. More...
 
vrpn_int32 d_text_message_id
 ID for text messages. More...
 
vrpn_int32 d_ping_message_id
 Ask the server if they are there. More...
 
vrpn_int32 d_pong_message_id
 Server telling that it is there. More...
 

Additional Inherited Members

- Public Attributes inherited from vrpn_BaseClassUnique
bool shutup
 
vrpn_MESSAGEHANDLER handler
 
vrpn_int32 sender
 
vrpn_int32 type
 
void * userdata
 
- Static Protected Member Functions inherited from vrpn_BaseClassUnique
static int encode_text_message_to_buffer (char *buf, vrpn_TEXT_SEVERITY severity, vrpn_uint32 level, const char *msg)
 Encodes the body of the text message into a buffer, preparing for sending. More...
 
static int decode_text_message_from_buffer (char *msg, vrpn_TEXT_SEVERITY *severity, vrpn_uint32 *level, const char *buf)
 Decodes the body of the text message from a buffer from the connection. More...
 

Detailed Description

Definition at line 28 of file vrpn_Analog.h.

Constructor & Destructor Documentation

◆ vrpn_Analog()

vrpn_Analog::vrpn_Analog ( const char *  name,
vrpn_Connection c = NULL 
)

Definition at line 14 of file vrpn_Analog.C.

References channel, vrpn_BaseClass::init(), last, timestamp, and vrpn_CHANNEL_MAX.

Here is the call graph for this function:

Member Function Documentation

◆ encode_to()

vrpn_int32 vrpn_Analog::encode_to ( char *  buf)
protectedvirtual

Definition at line 54 of file vrpn_Analog.C.

References channel, last, num_channel, vrpn_buffer(), and vrpn_CHANNEL_MAX.

Referenced by vrpn_Joystick::report(), report(), and vrpn_Wanda::report_new_valuator_info().

Here is the call graph for this function:

◆ getNumChannels()

vrpn_int32 vrpn_Analog::getNumChannels ( void  ) const

Definition at line 52 of file vrpn_Analog.C.

References num_channel.

Referenced by vrpn_YEI_3Space::handle_report().

◆ print()

void vrpn_Analog::print ( void  )

Definition at line 42 of file vrpn_Analog.C.

References channel, and num_channel.

Referenced by report(), and vrpn_Wanda::report_new_valuator_info().

◆ register_types()

int vrpn_Analog::register_types ( void  )
protectedvirtual

Register the types of messages this device sends/receives. Return 0 on success, -1 on fail.

Implements vrpn_BaseClass.

Reimplemented in vrpn_LUDL_USBMAC6000.

Definition at line 31 of file vrpn_Analog.C.

References channel_m_id, vrpn_BaseClassUnique::d_connection, and vrpn_Connection::register_message_type().

Here is the call graph for this function:

◆ report()

void vrpn_Analog::report ( vrpn_uint32  class_of_service = vrpn_CONNECTION_LOW_LATENCY,
const struct timeval  time = vrpn_ANALOG_NOW 
)
protectedvirtual

Send a report whether something has changed or not (for servers) Optionally, tell what time to stamp the value with.

Reimplemented in vrpn_Analog_Server.

Definition at line 94 of file vrpn_Analog.C.

References channel_m_id, vrpn_BaseClassUnique::d_connection, vrpn_BaseClassUnique::d_sender_id, encode_to(), vrpn_Connection::pack_message(), print(), timestamp, vrpn_ANALOG_NOW, vrpn_CHANNEL_MAX, and vrpn_gettimeofday.

Referenced by vrpn_National_Instruments_Server::mainloop(), vrpn_Analog_USDigital_A2::mainloop(), vrpn_Atmel::mainloop(), vrpn_Nikon_Controls::report(), vrpn_Zaber::report(), vrpn_3DConnexion::report(), vrpn_5dt16::report(), vrpn_CerealBox::report(), vrpn_GlobalHapticsOrb::report(), vrpn_Magellan::report(), vrpn_Tng3::report(), vrpn_Spaceball::report(), vrpn_ImmersionBox::report(), vrpn_Griffin_PowerMate::report(), vrpn_Contour_ShuttleXpress::report(), vrpn_Futaba_InterLink_Elite::report(), vrpn_5dt::report(), vrpn_Radamec_SPI::report(), vrpn_LUDL_USBMAC6000::report(), vrpn_Retrolink_GameCube::report(), vrpn_BiosciencesTools::report(), vrpn_Mouse::report(), vrpn_Analog_5dtUSB::report(), vrpn_Xkeys_Joystick::report(), vrpn_Analog_Server::report(), vrpn_YEI_3Space::report(), vrpn_IDEA::report(), vrpn_Xkeys_Jog_And_Shuttle::report(), vrpn_inertiamouse::report(), report_changes(), vrpn_Saitek_ST290_Pro::report_changes(), vrpn_CHProducts_Fighterstick_USB::report_changes(), vrpn_Logitech_Extreme_3D_Pro::report_changes(), vrpn_Griffin_PowerMate::report_changes(), vrpn_Futaba_InterLink_Elite::report_changes(), vrpn_Contour_ShuttleXpress::report_changes(), vrpn_Microsoft_SideWinder_Precision_2::report_changes(), vrpn_Retrolink_GameCube::report_changes(), vrpn_Microsoft_SideWinder::report_changes(), and vrpn_Microsoft_Controller_Raw_Xbox_360::report_changes().

Here is the call graph for this function:

◆ report_changes()

void vrpn_Analog::report_changes ( vrpn_uint32  class_of_service = vrpn_CONNECTION_LOW_LATENCY,
const struct timeval  time = vrpn_ANALOG_NOW 
)
protectedvirtual

Send a report only if something has changed (for servers) Optionally, tell what time to stamp the value with.

Reimplemented in vrpn_Analog_Server.

Definition at line 71 of file vrpn_Analog.C.

References channel, vrpn_BaseClassUnique::d_connection, last, num_channel, and report().

Referenced by vrpn_ADBox::mainloop(), vrpn_Event_Mouse::mainloop(), vrpn_Analog_USDigital_A2::mainloop(), vrpn_Logitech_Extreme_3D_Pro::report(), vrpn_CHProducts_Fighterstick_USB::report(), vrpn_Saitek_ST290_Pro::report(), vrpn_Microsoft_SideWinder_Precision_2::report(), vrpn_Microsoft_SideWinder::report(), vrpn_Microsoft_Controller_Raw_Xbox_S::report(), vrpn_Microsoft_Controller_Raw_Xbox_360::report(), vrpn_Nikon_Controls::report_changes(), vrpn_Zaber::report_changes(), vrpn_CerealBox::report_changes(), vrpn_5dt16::report_changes(), vrpn_3DConnexion::report_changes(), vrpn_Magellan::report_changes(), vrpn_GlobalHapticsOrb::report_changes(), vrpn_Spaceball::report_changes(), vrpn_Tng3::report_changes(), vrpn_ImmersionBox::report_changes(), vrpn_5dt::report_changes(), vrpn_Radamec_SPI::report_changes(), vrpn_LUDL_USBMAC6000::report_changes(), vrpn_BiosciencesTools::report_changes(), vrpn_Mouse::report_changes(), vrpn_Analog_5dtUSB::report_changes(), vrpn_Xkeys_Joystick::report_changes(), vrpn_Microsoft_Controller_Raw_Xbox_S::report_changes(), vrpn_Analog_Server::report_changes(), vrpn_YEI_3Space::report_changes(), vrpn_IDEA::report_changes(), vrpn_Xkeys_Jog_And_Shuttle::report_changes(), and vrpn_inertiamouse::report_changes().

Here is the call graph for this function:

Member Data Documentation

◆ channel

vrpn_float64 vrpn_Analog::channel[vrpn_CHANNEL_MAX]
protected

Definition at line 38 of file vrpn_Analog.h.

Referenced by vrpn_Analog_Server::channels(), vrpn_Radamec_SPI::clear_values(), vrpn_Magellan::clear_values(), vrpn_CerealBox::clear_values(), vrpn_Spaceball::clear_values(), vrpn_GlobalHapticsOrb::clear_values(), vrpn_5dt16::clear_values(), vrpn_Tng3::clear_values(), vrpn_ImmersionBox::clear_values(), vrpn_5dt::clear_values(), vrpn_inertiamouse::clear_values(), vrpn_IDEA::convert_report_to_position(), vrpn_3DConnexion::decodePacket(), vrpn_Retrolink_GameCube::decodePacket(), vrpn_Xkeys_Joystick::decodePacket(), vrpn_Xkeys_Jog_And_Shuttle::decodePacket(), encode_to(), vrpn_Zaber::get_report(), vrpn_Radamec_SPI::get_report(), vrpn_5dt16::get_report(), vrpn_Magellan::get_report(), vrpn_Spaceball::get_report(), vrpn_Tng3::get_report(), vrpn_ImmersionBox::get_report(), vrpn_BiosciencesTools::get_report(), vrpn_5dt::get_report(), vrpn_Mouse::get_report(), vrpn_inertiamouse::get_report(), vrpn_YEI_3Space::handle_report(), vrpn_Zaber::handle_request_message(), vrpn_Wanda::mainloop(), vrpn_ADBox::mainloop(), vrpn_3DConnexion::mainloop(), vrpn_LUDL_USBMAC6000::mainloop(), vrpn_National_Instruments_Server::mainloop(), vrpn_Analog_USDigital_A2::mainloop(), vrpn_Analog_5dtUSB::on_data_received(), vrpn_Joystick::parse(), print(), report_changes(), vrpn_Wanda::report_new_valuator_info(), vrpn_BiosciencesTools::request_temperature(), vrpn_Zaber::reset(), vrpn_IDEA::reset(), vrpn_IDEA::send_move_request(), vrpn_BiosciencesTools::set_reference_temperature(), vrpn_BiosciencesTools::set_specified_channel(), vrpn_Clipping_Analog_Server::setChannelValue(), vrpn_3DConnexion::vrpn_3DConnexion(), vrpn_Analog(), vrpn_Analog_5dtUSB::vrpn_Analog_5dtUSB(), vrpn_Analog_Remote::vrpn_Analog_Remote(), vrpn_IDEA::vrpn_IDEA(), vrpn_Microsoft_Controller_Raw_Xbox_360::vrpn_Microsoft_Controller_Raw_Xbox_360(), vrpn_Mouse::vrpn_Mouse(), vrpn_Tracker_RazerHydra::vrpn_Tracker_RazerHydra(), vrpn_Wanda::vrpn_Wanda(), and vrpn_WiiMote::vrpn_WiiMote().

◆ channel_m_id

vrpn_int32 vrpn_Analog::channel_m_id
protected

◆ last

◆ num_channel

vrpn_int32 vrpn_Analog::num_channel
protected

Definition at line 40 of file vrpn_Analog.h.

Referenced by vrpn_GlobalHapticsOrb::clear_values(), encode_to(), vrpn_Zaber::get_report(), getNumChannels(), vrpn_Analog_Remote::handle_change_message(), vrpn_Zaber::handle_request_message(), vrpn_BiosciencesTools::handle_request_message(), vrpn_IDEA::handle_request_message(), vrpn_ADBox::mainloop(), vrpn_National_Instruments_Server::mainloop(), vrpn_Analog_USDigital_A2::mainloop(), vrpn_Atmel::mainloop(), vrpn_Tracker_DTrack::mainloop(), vrpn_Analog_5dtUSB::on_data_received(), print(), vrpn_Contour_ShuttleXpress::report(), vrpn_Griffin_PowerMate::report(), vrpn_Retrolink_GameCube::report(), report_changes(), vrpn_Contour_ShuttleXpress::report_changes(), vrpn_Griffin_PowerMate::report_changes(), vrpn_Retrolink_GameCube::report_changes(), vrpn_Joystick::reset(), vrpn_Zaber::reset(), vrpn_Analog_Server::setNumChannels(), vrpn_National_Instruments_Server::setNumInChannels(), vrpn_3DConnexion::vrpn_3DConnexion(), vrpn_5dt::vrpn_5dt(), vrpn_5dt16::vrpn_5dt16(), vrpn_Analog_5dtUSB::vrpn_Analog_5dtUSB(), vrpn_Analog_Remote::vrpn_Analog_Remote(), vrpn_BiosciencesTools::vrpn_BiosciencesTools(), vrpn_CerealBox::vrpn_CerealBox(), vrpn_Event_Mouse::vrpn_Event_Mouse(), vrpn_GlobalHapticsOrb::vrpn_GlobalHapticsOrb(), vrpn_IDEA::vrpn_IDEA(), vrpn_ImmersionBox::vrpn_ImmersionBox(), vrpn_inertiamouse::vrpn_inertiamouse(), vrpn_Joystick::vrpn_Joystick(), vrpn_Magellan::vrpn_Magellan(), vrpn_Microsoft_Controller_Raw_Xbox_360::vrpn_Microsoft_Controller_Raw_Xbox_360(), vrpn_Mouse::vrpn_Mouse(), vrpn_National_Instruments_Server::vrpn_National_Instruments_Server(), vrpn_Nikon_Controls::vrpn_Nikon_Controls(), vrpn_Radamec_SPI::vrpn_Radamec_SPI(), vrpn_raw_SGIBox::vrpn_raw_SGIBox(), vrpn_Spaceball::vrpn_Spaceball(), vrpn_Tng3::vrpn_Tng3(), vrpn_Tracker_DTrack::vrpn_Tracker_DTrack(), vrpn_Tracker_RazerHydra::vrpn_Tracker_RazerHydra(), vrpn_Wanda::vrpn_Wanda(), vrpn_WiiMote::vrpn_WiiMote(), vrpn_YEI_3Space::vrpn_YEI_3Space(), and vrpn_Zaber::vrpn_Zaber().

◆ status

◆ timestamp

struct timeval vrpn_Analog::timestamp
protected

Definition at line 41 of file vrpn_Analog.h.

Referenced by vrpn_LUDL_USBMAC6000::handle_request_channels_message(), vrpn_LUDL_USBMAC6000::handle_request_message(), vrpn_Joystick::mainloop(), vrpn_ADBox::mainloop(), vrpn_3DConnexion::mainloop(), vrpn_Tracker_DTrack::mainloop(), vrpn_Joystick::report(), vrpn_Nikon_Controls::report(), vrpn_Zaber::report(), vrpn_5dt16::report(), vrpn_3DConnexion::report(), vrpn_CerealBox::report(), vrpn_Magellan::report(), vrpn_GlobalHapticsOrb::report(), vrpn_Tng3::report(), vrpn_Spaceball::report(), vrpn_ImmersionBox::report(), report(), vrpn_Logitech_Extreme_3D_Pro::report(), vrpn_CHProducts_Fighterstick_USB::report(), vrpn_Saitek_ST290_Pro::report(), vrpn_Griffin_PowerMate::report(), vrpn_Contour_ShuttleXpress::report(), vrpn_Futaba_InterLink_Elite::report(), vrpn_Radamec_SPI::report(), vrpn_5dt::report(), vrpn_LUDL_USBMAC6000::report(), vrpn_Microsoft_SideWinder_Precision_2::report(), vrpn_BiosciencesTools::report(), vrpn_Retrolink_GameCube::report(), vrpn_Mouse::report(), vrpn_Microsoft_SideWinder::report(), vrpn_Analog_5dtUSB::report(), vrpn_Xkeys_Joystick::report(), vrpn_Microsoft_Controller_Raw_Xbox_S::report(), vrpn_YEI_3Space::report(), vrpn_IDEA::report(), vrpn_Xkeys_Jog_And_Shuttle::report(), vrpn_Microsoft_Controller_Raw_Xbox_360::report(), vrpn_inertiamouse::report(), vrpn_Nikon_Controls::report_changes(), vrpn_Zaber::report_changes(), vrpn_5dt16::report_changes(), vrpn_CerealBox::report_changes(), vrpn_3DConnexion::report_changes(), vrpn_Magellan::report_changes(), vrpn_Spaceball::report_changes(), vrpn_GlobalHapticsOrb::report_changes(), vrpn_Tng3::report_changes(), vrpn_ImmersionBox::report_changes(), vrpn_Logitech_Extreme_3D_Pro::report_changes(), vrpn_Saitek_ST290_Pro::report_changes(), vrpn_CHProducts_Fighterstick_USB::report_changes(), vrpn_Griffin_PowerMate::report_changes(), vrpn_Contour_ShuttleXpress::report_changes(), vrpn_Futaba_InterLink_Elite::report_changes(), vrpn_Radamec_SPI::report_changes(), vrpn_5dt::report_changes(), vrpn_LUDL_USBMAC6000::report_changes(), vrpn_Microsoft_SideWinder_Precision_2::report_changes(), vrpn_BiosciencesTools::report_changes(), vrpn_Retrolink_GameCube::report_changes(), vrpn_Mouse::report_changes(), vrpn_Microsoft_SideWinder::report_changes(), vrpn_Analog_5dtUSB::report_changes(), vrpn_Xkeys_Joystick::report_changes(), vrpn_Microsoft_Controller_Raw_Xbox_S::report_changes(), vrpn_YEI_3Space::report_changes(), vrpn_IDEA::report_changes(), vrpn_Xkeys_Jog_And_Shuttle::report_changes(), vrpn_Microsoft_Controller_Raw_Xbox_360::report_changes(), vrpn_inertiamouse::report_changes(), vrpn_Wanda::report_new_valuator_info(), vrpn_ADBox::vrpn_ADBox(), vrpn_Analog(), vrpn_Analog_Remote::vrpn_Analog_Remote(), vrpn_Event_Analog::vrpn_Event_Analog(), vrpn_Event_Mouse::vrpn_Event_Mouse(), and vrpn_Serial_Analog::vrpn_Serial_Analog().


The documentation for this class was generated from the following files: