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");
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
void server_mainloop(void)
Handles functions that all servers should provide in their mainloop() (ping/pong, for example) Should...
virtual void mainloop()
Standard VRPN mainloop method.
virtual bool connected() const
Returns true iff the last device I/O succeeded.
Accepts any device with the given vendor and product IDs.
header for OSVR Hacker Dev Kit
Generic connection class not specific to the transport mechanism.
vrpn_Tracker_OSVRHackerDevKit(const char *name, vrpn_Connection *c=NULL)
Constructor.
All types of client/server/peer objects in VRPN should be derived from the vrpn_BaseClass type descri...
Accepts devices meeting at least one of two criteria. NOT SHORT-CIRCUIT. Another demonstration of acc...
vrpn_Connection * d_connection
Connection that this object talks to.
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...
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.
virtual int encode_to(char *buf)
vrpn_HidAcceptor * _acceptor
This is the HidAcceptor we use when reconnecting.
virtual ~vrpn_Tracker_OSVRHackerDevKit()
Destructor.
bool _wasConnected
Flag indicating whether we were connected last time through the mainloop. Used to send a "normal"-sev...
Header allowing use of a output stream-style method of sending text messages from devices...
#define vrpn_gettimeofday
virtual void update()
Polls the device buffers and causes on_data_received callbacks if appropriate You NEED to call this f...
struct timeval _timestamp
Timestamp updated during mainloop()
A fixed-point value class.
vrpn_int32 d_sender_id
Sender ID registered with the connection.
void on_data_received(std::size_t bytes, vrpn_uint8 *buffer)
Extracts the sensor values from each report.