RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
vrpn_Tracker_JsonNet.h
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
13namespace Json {
14 class Reader;
15 class Value;
16}
17
27class vrpn_Tracker_JsonNet :
28 public vrpn_Tracker, public vrpn_Button_Filter, public vrpn_Analog, public vrpn_Text_Sender
29{
30public:
31 vrpn_Tracker_JsonNet(
32 const char* name,
34 int udpPort
35 );
36 ~vrpn_Tracker_JsonNet(void);
37
38 void mainloop();
39
40 enum {
41 TILT_TRACKER_ID = 0,
42 };
43
44
45private:
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.h:28
virtual void mainloop()=0
定义 vrpn_Button.h:66
Generic connection class not specific to the transport mechanism.
定义 vrpn_Connection.h:562
Allows a user to send text messages from a device (usually,
定义 vrpn_Text.h:40
定义 vrpn_Tracker.h:49