vrpn 07.35
Virtual Reality Peripheral Network
 
Loading...
Searching...
No Matches
vrpn_Streaming_Arduino.h
Go to the documentation of this file.
1// Copyright 2015 by Russ Taylor, working for ReliaSolve.
2// Based on the vrpn_Tng3.h header file.
3// License: Standard VRPN.
4//
5// See the vrpn_streaming_arduino directory for a program that should be
6// loaded onto the Arduino and be running for this device to connect to.
7
8#pragma once
9#include "vrpn_Analog.h" // for vrpn_Serial_Analog
10#include "vrpn_Button.h" // for vrpn_Button_Filter
11#include <string>
12
15{
16 public:
17 vrpn_Streaming_Arduino(std::string name,
19 std::string port,
20 int numchannels = 1,
21 int baud = 115200);
22
24
25 // Called once through each main loop iteration to handle
26 // updates.
27 virtual void mainloop (void);
28
29 protected:
31 int m_numchannels; // How many analog channels to open
32
33 std::string m_buffer; // Characters read from the device.
34 struct timeval m_timestamp; // Time of the last report from the device
35
36 virtual int get_report(void); // Try to read a report from the device
37
38 // send report iff changed
39 virtual void report_changes (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
40 // send report whether or not changed
41 virtual void report (vrpn_uint32 class_of_service = vrpn_CONNECTION_LOW_LATENCY);
42
43 // NOTE: class_of_service is only applied to vrpn_Analog
44 // values, not vrpn_Button or vrpn_Dial
45
46 void clear_values();
47 int reset();
48
49 private:
50};
virtual void report(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Send a report whether something has changed or not (for servers) Optionally, tell what time to stamp ...
Definition vrpn_Analog.C:94
virtual void report_changes(vrpn_uint32 class_of_service=vrpn_CONNECTION_LOW_LATENCY, const struct timeval time=vrpn_ANALOG_NOW)
Send a report only if something has changed (for servers) Optionally, tell what time to stamp the val...
Definition vrpn_Analog.C:71
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Button_Filter(const char *, vrpn_Connection *c=NULL)
Generic connection class not specific to the transport mechanism.
vrpn_Serial_Analog(const char *name, vrpn_Connection *connection, const char *port, int baud=9600, int bits=8, vrpn_SER_PARITY parity=vrpn_SER_PARITY_NONE, bool rts_flow=false)
vrpn_Streaming_Arduino(std::string name, vrpn_Connection *c, std::string port, int numchannels=1, int baud=115200)
#define VRPN_API
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY