vrpn
07.33
Virtual Reality Peripheral Network
|
Go to the documentation of this file.
23 #if defined(VRPN_USE_HID)
26 static const vrpn_uint16 vrpn_OSVR_VENDOR = 0x1532;
27 static const vrpn_uint16 vrpn_OSVR_HACKER_DEV_KIT_HMD = 0x0b00;
30 static const vrpn_uint16 vrpn_OSVR_ALT_VENDOR = 0x03EB;
31 static const vrpn_uint16 vrpn_OSVR_ALT_HACKER_DEV_KIT_HMD = 0x2421;
38 vrpn_OSVR_HACKER_DEV_KIT_HMD),
40 vrpn_OSVR_ALT_HACKER_DEV_KIT_HMD)))
41 , _wasConnected(false)
63 <<
"Received a report " << bytes
64 <<
" in length, but expected it to be 32 bytes. Discarding.";
68 vrpn_uint8 version = vrpn_unbuffer_from_little_endian<vrpn_uint8>(buffer);
70 vrpn_uint8 msg_seq = vrpn_unbuffer_from_little_endian<vrpn_uint8>(buffer);
75 FixedPointValue(vrpn_unbuffer_from_little_endian<vrpn_int16>(buffer))
78 FixedPointValue(vrpn_unbuffer_from_little_endian<vrpn_int16>(buffer))
81 FixedPointValue(vrpn_unbuffer_from_little_endian<vrpn_int16>(buffer))
84 FixedPointValue(vrpn_unbuffer_from_little_endian<vrpn_int16>(buffer))
94 "vrpn_Tracker_OSVRHackerDevKit: cannot write message: tossing\n");
virtual bool connected() const
Returns true iff the last device I/O succeeded.
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...
header for OSVR Hacker Dev Kit
Accepts devices meeting at least one of two criteria. NOT SHORT-CIRCUIT. Another demonstration of acc...
virtual int encode_to(char *buf)
virtual void update()
Polls the device buffers and causes on_data_received callbacks if appropriate You NEED to call this f...
void on_data_received(std::size_t bytes, vrpn_uint8 *buffer)
Extracts the sensor values from each report.
Header allowing use of a output stream-style method of sending text messages from devices....
struct timeval _timestamp
Timestamp updated during mainloop()
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
vrpn_Connection * d_connection
Connection that this object talks to.
virtual ~vrpn_Tracker_OSVRHackerDevKit()
Destructor.
virtual void mainloop()
Standard VRPN mainloop method.
bool _wasConnected
Flag indicating whether we were connected last time through the mainloop. Used to send a "normal"-sev...
Accepts any device with the given vendor and product IDs.
vrpn_int32 d_sender_id
Sender ID registered with the connection.
vrpn_Tracker_OSVRHackerDevKit(const char *name, vrpn_Connection *c=NULL)
Constructor.
A fixed-point value class.
Generic connection class not specific to the transport mechanism.
#define vrpn_gettimeofday
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.
vrpn_HidAcceptor * _acceptor
This is the HidAcceptor we use when reconnecting.
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...