Wrapper class for OSVR_DeviceToken. More...
#include <osvr/PluginKit/DeviceInterface.h>
Public Member Functions | |||||||||
DeviceToken (OSVR_DeviceToken device) | |||||||||
Constructor wrapping an existing device token. | |||||||||
DeviceToken () | |||||||||
Default constructor. | |||||||||
operator OSVR_DeviceToken () const | |||||||||
Conversion operator to the un-wrapped device token. | |||||||||
void | initSync (OSVR_PluginRegContext ctx, const char *name, OSVR_DeviceInitOptions options=NULL) | ||||||||
Initialize this device token as synchronous, with the given name and options. | |||||||||
void | initSync (OSVR_PluginRegContext ctx, std::string const &name, OSVR_DeviceInitOptions options=NULL) | ||||||||
void | initAsync (OSVR_PluginRegContext ctx, const char *name, OSVR_DeviceInitOptions options=NULL) | ||||||||
Initialize this device token as asynchronous, with the given name and options. | |||||||||
void | initAsync (OSVR_PluginRegContext ctx, std::string const &name, OSVR_DeviceInitOptions options=NULL) | ||||||||
template<typename InterfaceType , typename MessageType > | |||||||||
void | send (InterfaceType &iface, MessageType const &msg, OSVR_TimeValue const ×tamp) | ||||||||
Send a message on a registered interface type, providing the timestamp yourself. More... | |||||||||
template<typename InterfaceType , typename MessageType > | |||||||||
void | send (InterfaceType &iface, MessageType const &msg) | ||||||||
void | sendJsonDescriptor (const char *json, size_t len) | ||||||||
Submit a JSON self-descriptor string for the device. More... | |||||||||
template<size_t N> | |||||||||
void | sendJsonDescriptor (const char(&json)[N]) | ||||||||
void | sendJsonDescriptor (std::string const &json) | ||||||||
template<typename DeviceObjectType > | |||||||||
void | registerUpdateCallback (DeviceObjectType *object) | ||||||||
Given a pointer to your object that has a public OSVR_ReturnCode update() method, registers that instance and method as the update callback for the device. More... | |||||||||
Advanced Functionality | |||||||||
Rarely needed Send a raw bytestream from your device with a custom message type.
| |||||||||
void | sendData (OSVR_MessageType msg, const char *bytestream=NULL, size_t len=0) | ||||||||
template<size_t N> | |||||||||
void | sendData (OSVR_MessageType msg, const char(&bytestream)[N]) | ||||||||
void | sendData (OSVR_MessageType msg, std::string const &bytestream) | ||||||||
void | sendData (OSVR_MessageType msg, std::vector< char > const &bytestream) | ||||||||
void | sendData (OSVR_TimeValue const ×tamp, OSVR_MessageType msg, const char *bytestream=NULL, size_t len=0) | ||||||||
Sends a raw bytestream from your device with a known timestamp. More... | |||||||||
template<size_t N> | |||||||||
void | sendData (OSVR_TimeValue const ×tamp, OSVR_MessageType msg, const char(&bytestream)[N]) | ||||||||
void | sendData (OSVR_TimeValue const ×tamp, OSVR_MessageType msg, std::string const &bytestream) | ||||||||
void | sendData (OSVR_TimeValue const ×tamp, OSVR_MessageType msg, std::vector< char > const &bytestream) | ||||||||
Wrapper class for OSVR_DeviceToken.
Definition at line 93 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 125 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 154 of file DeviceInterface.h.
|
inline |
Send a message on a registered interface type, providing the timestamp yourself.
Templated to call implementation in the InterfaceType class.
Definition at line 172 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. This version takes the current time and uses it as the timestamp.
Definition at line 180 of file DeviceInterface.h.
|
inline |
Submit a JSON self-descriptor string for the device.
json | The JSON string to transmit. |
len | The length of the string. |
std::runtime_error | if error in sending. |
Definition at line 190 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
For string literals: automatically deduces the length at compile time.
Definition at line 204 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 209 of file DeviceInterface.h.
|
inline |
Given a pointer to your object that has a public OSVR_ReturnCode update()
method, registers that instance and method as the update callback for the device.
std::runtime_error | if update callback registration fails |
Definition at line 223 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
For string literals: automatically deduces the length at compile time.
Definition at line 267 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 272 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 282 of file DeviceInterface.h.
|
inline |
Sends a raw bytestream from your device with a known timestamp.
timestamp | The timestamp you want to associate with this message. |
msg | The registered message type. |
bytestream | A string of bytes to transmit. |
len | The length of the string of bytes. |
std::runtime_error | if error in sending. |
Definition at line 305 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
For string literals: automatically deduces the length at compile time.
Definition at line 321 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 327 of file DeviceInterface.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 339 of file DeviceInterface.h.