25 #ifndef INCLUDED_VrpnAnalogServer_h_GUID_16F2A08F_2ECF_4EBB_D7B0_A2B87ACC9272 26 #define INCLUDED_VrpnAnalogServer_h_GUID_16F2A08F_2ECF_4EBB_D7B0_A2B87ACC9272 33 #include <vrpn_Analog.h> 39 namespace connection {
42 typedef vrpn_Analog Base;
44 : Base(init.getQualifiedName().c_str(), init.conn) {
45 m_setNumChannels(std::min(*init.obj.getAnalogs(),
48 memset(Base::channel, 0,
sizeof(Base::channel));
49 memset(Base::last, 0,
sizeof(Base::last));
55 static const vrpn_uint32 CLASS_OF_SERVICE = vrpn_CONNECTION_LOW_LATENCY;
59 if (chan >= m_getNumChannels()) {
62 Base::channel[chan] = val;
68 if (chans > m_getNumChannels()) {
69 chans = m_getNumChannels();
72 Base::channel[i] = val[i];
82 Base::num_channel = chans;
86 util::time::toStructTimeval(t, tv);
87 Base::report_changes(CLASS_OF_SERVICE, t);
93 #endif // INCLUDED_VrpnAnalogServer_h_GUID_16F2A08F_2ECF_4EBB_D7B0_A2B87ACC9272 uint32_t OSVR_ChannelCount
The integer type specifying a number of channels/sensors or a channel/sensor index.
Definition: ChannelCountC.h:51
The main namespace for all C++ elements of the framework, internal and external.
Definition: namespace_osvr.dox:3
virtual void setValues(value_type val[], OSVR_ChannelCount chans, util::time::TimeValue const &tv)
Sets the values from the val array at channels [0, chans), and reports changes with the given timesta...
Definition: VrpnAnalogServer.h:66
Definition: VrpnAnalogServer.h:40
Interface for external access to generating analog reports.
Definition: AnalogServerInterface.h:45
void returnAnalogInterface(osvr::connection::AnalogServerInterface &iface)
Returns an analog interface through the pointer-pointer.
Definition: DeviceInitObject.cpp:76
Definition: DeviceConstructionData.h:41
Standardized, portable parallel to struct timeval for representing both absolute times and time inter...
Definition: TimeValueC.h:81
virtual bool setValue(value_type val, OSVR_ChannelCount chan, util::time::TimeValue const &tv)
Sets the value to val at channel chan, and reports changes with the given timestamp.
Definition: VrpnAnalogServer.h:57