42 SpacePointAcceptor(
unsigned index)
46 virtual ~SpacePointAcceptor()
57 (m_accepted_already.size() == m_index) &&
58 (m_accepted_already.find(device.
path) == m_accepted_already.end()))
60 m_accepted_already.insert(device.
path);
75 static std::set<std::string> m_accepted_already;
78std::set<std::string> SpacePointAcceptor::m_accepted_already;
86 memset(
d_quat, 0, 4 *
sizeof(
float));
112 vrpn_uint8 * bufptr = buffer + 6;
114 for (
int i = 0; i < 4; i++) {
115 d_quat[i] = (vrpn_unbuffer_from_little_endian<vrpn_uint16>(bufptr) - 32768) / 32768.0;
129 memset(
pos, 0,
sizeof(vrpn_float64) * 3);
134 fprintf(stderr,
"SpacePoint tracker: can't write message: tossing\n");
vrpn_Connection * d_connection
Connection that this object talks to.
vrpn_int32 d_sender_id
Sender ID registered with the connection.
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
Generic connection class not specific to the transport mechanism.
virtual int pack_message(vrpn_uint32 len, struct timeval time, vrpn_int32 type, vrpn_int32 sender, const char *buffer, vrpn_uint32 class_of_service)
Pack a message that will be sent the next time mainloop() is called. Turn off the RELIABLE flag if yo...
virtual bool accept(const vrpn_HIDDEVINFO &device)=0
virtual bool reconnect()
Tries to reconnect to an acceptable device. Call this if you suspect a hotplug event has occurred.
virtual void update()
Polls the device buffers and causes on_data_received callbacks if appropriate You NEED to call this f...
virtual bool connected() const
Returns true iff the last device I/O succeeded.
virtual void mainloop()
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
virtual void on_data_received(size_t bytes, vrpn_uint8 *buffer)
Derived class reimplements this callback.
struct timeval _timestamp
vrpn_Tracker_SpacePoint(const char *name, vrpn_Connection *trackercon, int index=0)
virtual int encode_to(char *buf)
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
#define vrpn_gettimeofday
const unsigned SPACEPOINT_VENDOR
const unsigned SPACEPOINT_PRODUCT