vrpn
07.36
Virtual Reality Peripheral Network
Loading...
Searching...
No Matches
vrpn_Tracker_JsonNet.h
Go to the documentation of this file.
1
#ifndef VRPN_TRACKER_JSONNET
2
#define VRPN_TRACKER_JSONNET
3
4
#include "
vrpn_Configure.h
"
5
6
#if defined(VRPN_USE_JSONNET)
7
8
#include "
vrpn_Analog.h
"
9
#include "
vrpn_Button.h
"
10
#include "
vrpn_Tracker.h
"
11
#include "
vrpn_Text.h
"
12
13
namespace
Json {
14
class
Reader;
15
class
Value;
16
}
17
27
class
vrpn_Tracker_JsonNet :
28
public
vrpn_Tracker
,
public
vrpn_Button_Filter
,
public
vrpn_Analog
,
public
vrpn_Text_Sender
29
{
30
public
:
31
vrpn_Tracker_JsonNet(
32
const
char
* name,
33
vrpn_Connection
* c,
34
int
udpPort
35
);
36
~vrpn_Tracker_JsonNet(
void
);
37
38
void
mainloop
();
39
40
enum
{
41
TILT_TRACKER_ID = 0,
42
};
43
44
45
private
:
46
/*
47
* Network part
48
*/
49
bool
_network_init(
int
udp_port);
50
int
_network_receive(
void
*buffer,
int
maxlen,
int
tout_us);
51
void
_network_release();
52
vrpn_SOCKET
_socket;
53
enum
{
54
_NETWORK_BUFFER_SIZE = 2000,
55
56
};
57
char
_network_buffer[_NETWORK_BUFFER_SIZE];
58
59
/*
60
* Json part
61
*/
62
bool
_parse(
const
char
* buffer,
int
length);
63
bool
_parse_tracker_data(
const
Json::Value& root);
64
bool
_parse_analog(
const
Json::Value& root);
65
bool
_parse_button(
const
Json::Value& root);
66
bool
_parse_text(
const
Json::Value& root);
67
bool
_do_tracker_report;
68
Json::Reader* _pJsonReader;
69
};
70
71
#endif
// ifdef JSONNET
72
#endif
vrpn_Analog
Definition
vrpn_Analog.h:28
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
All button servers should derive from this class, which provides the ability to turn any of the butto...
Definition
vrpn_Button.h:66
vrpn_Text_Sender
Allows a user to send text messages from a device (usually,.
Definition
vrpn_Text.h:40
vrpn_Tracker
Definition
vrpn_Tracker.h:49
vrpn_Connection
class VRPN_API vrpn_Connection
Definition
vrpn_3Space.h:7
vrpn_Analog.h
vrpn_Button.h
vrpn_Configure.h
vrpn_SOCKET
#define vrpn_SOCKET
Definition
vrpn_Shared.h:54
vrpn_Text.h
vrpn_Tracker.h
vrpn_Tracker_JsonNet.h
Generated by
1.14.0