1
#ifndef VRPN_TRACKER_JSONNET
2
#define VRPN_TRACKER_JSONNET
4
#include "vrpn_Configure.h"
5
#if defined(VRPN_USE_JSONNET)
7
#include "vrpn_Tracker.h"
8
#include "vrpn_Button.h"
9
#include "vrpn_Analog.h"
17
* A tracker class that accepts network updates in JSON format.
19
* This tracker is used by the Vrpn Android widgets.
20
* Any other application that can send UDP packets with a JSON payload
21
* and feed this tracker.
23
* @Author Philippe Crassous / ENSAM ParisTech-Institut Image
25
class vrpn_Tracker_JsonNet :
26
public vrpn_Tracker, public vrpn_Button, public vrpn_Analog
34
~vrpn_Tracker_JsonNet(void);
47
bool _network_init(int udp_port);
48
int _network_receive(void *buffer, int maxlen, int tout_us);
49
void _network_release();
51
typedef SOCKET socket_type;
53
typedef int socket_type;
57
_NETWORK_BUFFER_SIZE = 2000,
60
char _network_buffer[_NETWORK_BUFFER_SIZE];
65
bool _parse(const char* buffer, int length);
66
bool _parse_tracker_data(const Json::Value& root);
67
bool _parse_analog(const Json::Value& root);
68
bool _parse_button(const Json::Value& root);
69
Json::Reader* _pJsonReader;
72
#endif // ifdef JSONNET