vrpn
07.35
Virtual Reality Peripheral Network
Toggle main menu visibility
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
13
class
VRPN_API
vrpn_Streaming_Arduino
:
public
vrpn_Serial_Analog
,
14
public
vrpn_Button_Filter
15
{
16
public
:
17
vrpn_Streaming_Arduino
(std::string name,
18
vrpn_Connection
* c,
19
std::string port,
20
int
numchannels = 1,
21
int
baud = 115200);
22
23
~vrpn_Streaming_Arduino
() {};
24
25
// Called once through each main loop iteration to handle
26
// updates.
27
virtual
void
mainloop
(
void
);
28
29
protected
:
30
int
m_status
;
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
};
vrpn_Analog::report
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
vrpn_Analog::report_changes
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
vrpn_BaseClass::mainloop
virtual void mainloop()=0
Called once through each main loop iteration to handle updates. Remote object mainloop() should call ...
vrpn_Button_Filter::vrpn_Button_Filter
vrpn_Button_Filter(const char *, vrpn_Connection *c=NULL)
Definition
vrpn_Button.C:129
vrpn_Connection
Generic connection class not specific to the transport mechanism.
Definition
vrpn_Connection.h:561
vrpn_Serial_Analog::vrpn_Serial_Analog
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)
Definition
vrpn_Analog.C:124
vrpn_Streaming_Arduino::~vrpn_Streaming_Arduino
~vrpn_Streaming_Arduino()
Definition
vrpn_Streaming_Arduino.h:23
vrpn_Streaming_Arduino::m_timestamp
struct timeval m_timestamp
Definition
vrpn_Streaming_Arduino.h:34
vrpn_Streaming_Arduino::m_numchannels
int m_numchannels
Definition
vrpn_Streaming_Arduino.h:31
vrpn_Streaming_Arduino::reset
int reset()
Definition
vrpn_Streaming_Arduino.C:73
vrpn_Streaming_Arduino::vrpn_Streaming_Arduino
vrpn_Streaming_Arduino(std::string name, vrpn_Connection *c, std::string port, int numchannels=1, int baud=115200)
Definition
vrpn_Streaming_Arduino.C:31
vrpn_Streaming_Arduino::get_report
virtual int get_report(void)
Definition
vrpn_Streaming_Arduino.C:131
vrpn_Streaming_Arduino::m_buffer
std::string m_buffer
Definition
vrpn_Streaming_Arduino.h:33
vrpn_Streaming_Arduino::m_status
int m_status
Definition
vrpn_Streaming_Arduino.h:30
vrpn_Streaming_Arduino::clear_values
void clear_values()
Definition
vrpn_Streaming_Arduino.C:60
vrpn_Analog.h
vrpn_Button.h
VRPN_API
#define VRPN_API
Definition
vrpn_Configure.h:648
vrpn_CONNECTION_LOW_LATENCY
const vrpn_uint32 vrpn_CONNECTION_LOW_LATENCY
Definition
vrpn_Connection.h:120
vrpn_Streaming_Arduino.h
Generated by
1.17.0