vrpn
07.33
Virtual Reality Peripheral Network
|
#include <vrpn_5DT16.h>
Public Member Functions | |
vrpn_5dt16 (const char *name, vrpn_Connection *c, const char *port, int baud=19200) | |
~vrpn_5dt16 () | |
virtual void | mainloop () |
Called once through each main loop iteration to handle updates. More... | |
![]() | |
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) | |
~vrpn_Serial_Analog () | |
![]() | |
vrpn_Analog (const char *name, vrpn_Connection *c=NULL) | |
void | print (void) |
vrpn_int32 | getNumChannels (void) const |
![]() | |
vrpn_BaseClass (const char *name, vrpn_Connection *c=NULL) | |
Names the device and assigns or opens connection, calls registration methods. More... | |
virtual | ~vrpn_BaseClass () |
![]() | |
vrpn_BaseClassUnique () | |
virtual | ~vrpn_BaseClassUnique () |
Unregister all of the message handlers that were to be autodeleted. More... | |
vrpn_Connection * | connectionPtr () |
Returns a pointer to the connection this object is using. More... | |
Protected Member Functions | |
virtual int | reset (void) |
virtual void | get_report (void) |
virtual void | clear_values (void) |
virtual void | report_changes (vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY) |
send report iff changed More... | |
virtual void | report (vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY) |
send report whether or not changed More... | |
![]() | |
int | read_available_characters (char *buffer, int bytes) |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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 | |
int | _status |
int | _numchannels |
int | _mode |
unsigned | _expected_chars |
unsigned char | _buffer [512] |
unsigned | _bufcount |
bool | _tenbytes |
struct timeval | timestamp |
![]() | |
int | serial_fd |
char | portname [1024] |
int | baudrate |
unsigned char | buffer [1024] |
int | bufcounter |
![]() | |
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 |
![]() | |
vrpn_Connection * | d_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 | |
![]() | |
bool | shutup |
vrpn_MESSAGEHANDLER | handler |
vrpn_int32 | sender |
vrpn_int32 | type |
void * | userdata |
![]() | |
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... | |
Definition at line 14 of file vrpn_5DT16.h.
vrpn_5dt16::vrpn_5dt16 | ( | const char * | name, |
vrpn_Connection * | c, | ||
const char * | port, | ||
int | baud = 19200 |
||
) |
Definition at line 36 of file vrpn_5DT16.C.
References _numchannels, _status, clear_values(), vrpn_Analog::num_channel, and STATUS_RESETTING.
|
inline |
Definition at line 22 of file vrpn_5DT16.h.
|
protectedvirtual |
Definition at line 57 of file vrpn_5DT16.C.
References _numchannels, vrpn_Analog::channel, and vrpn_Analog::last.
Referenced by vrpn_5dt16().
|
protectedvirtual |
Definition at line 134 of file vrpn_5DT16.C.
References _bufcount, _buffer, _expected_chars, _status, vrpn_Analog::channel, report_changes(), vrpn_Serial_Analog::serial_fd, STATUS_RESETTING, timestamp, vrpn_gettimeofday, VRPN_MSG_ERROR, VRPN_MSG_INFO, and vrpn_read_available_characters().
Referenced by mainloop().
|
virtual |
Called once through each main loop iteration to handle updates.
Implements vrpn_BaseClass.
Definition at line 258 of file vrpn_5DT16.C.
References _status, get_report(), MAX_TIME_INTERVAL, reset(), vrpn_BaseClassUnique::server_mainloop(), STATUS_READING, STATUS_RESETTING, timestamp, vrpn_gettimeofday, VRPN_MSG_ERROR, and vrpn_TimevalDuration().
|
protectedvirtual |
send report whether or not changed
Definition at line 241 of file vrpn_5DT16.C.
References vrpn_Analog::report(), timestamp, and vrpn_Analog::timestamp.
|
protectedvirtual |
send report iff changed
Definition at line 228 of file vrpn_5DT16.C.
References vrpn_Analog::report_changes(), timestamp, and vrpn_Analog::timestamp.
Referenced by get_report().
|
protectedvirtual |
Definition at line 73 of file vrpn_5DT16.C.
References _bufcount, _status, vrpn_Serial_Analog::serial_fd, STATUS_READING, timestamp, vrpn_gettimeofday, VRPN_MSG_WARNING, vrpn_read_available_characters(), and vrpn_SleepMsecs().
Referenced by mainloop().
|
protected |
Definition at line 33 of file vrpn_5DT16.h.
Referenced by get_report(), and reset().
|
protected |
Definition at line 32 of file vrpn_5DT16.h.
Referenced by get_report().
|
protected |
Definition at line 31 of file vrpn_5DT16.h.
Referenced by get_report().
|
protected |
Definition at line 30 of file vrpn_5DT16.h.
|
protected |
Definition at line 29 of file vrpn_5DT16.h.
Referenced by clear_values(), and vrpn_5dt16().
|
protected |
Definition at line 28 of file vrpn_5DT16.h.
Referenced by get_report(), mainloop(), reset(), and vrpn_5dt16().
|
protected |
Definition at line 34 of file vrpn_5DT16.h.
|
protected |
Definition at line 36 of file vrpn_5DT16.h.
Referenced by get_report(), mainloop(), report(), report_changes(), and reset().