source: flair-src/trunk/lib/FlairSensorActuator/src/VrpnClient.h@ 139

Last change on this file since 139 was 136, checked in by Sanahuja Guillaume, 8 years ago

vrpn: improved timeout

File size: 2.2 KB
Line 
1// %flair:license{
2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
4// %flair:license}
5/*!
6 * \file VrpnClient.h
7 * \brief Class to connect to a Vrpn server
8 * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
9 * 7253
10 * \date 2013/04/03
11 * \version 4.0
12 */
13
14#ifndef VRPNCLIENT_H
15#define VRPNCLIENT_H
16
17#include <Thread.h>
18
19namespace flair {
20 namespace core {
21 class SerialPort;
22 }
23 namespace gui {
24 class TabWidget;
25 class Layout;
26 }
27}
28
29class VrpnClient_impl;
30class VrpnObject_impl;
31
32namespace flair {
33namespace sensor {
34/*! \class VrpnClient
35*
36* \brief Class to connect to a Vrpn server. The Thread is created with
37* the FrameworkManager as parent. FrameworkManager must be created before.
38* Only one instance of this class is allowed by program.
39*/
40class VrpnClient : public core::Thread {
41 friend class ::VrpnObject_impl;
42
43public:
44 /*!
45 * \brief Constructor
46 *
47 * Construct a VrpnClient. Connection is done by IP.
48 *
49 * \param name name
50 * \param address server address
51 * \param priority priority of the Thread
52 */
53 VrpnClient(std::string name,
54 std::string address, uint8_t priority);
55
56 /*!
57 * \brief Constructor
58 *
59 * Construct a VrpnClient. Connection is done by XBee modem.
60 *
61 * \param name name
62 * \param serialport SerialPort for XBee modem
63 * \param us_period Xbee RX timeout in us
64 * \param priority priority of the Thread
65 */
66 VrpnClient(std::string name,
67 core::SerialPort *serialport, uint16_t us_period,
68 uint8_t priority);
69
70 /*!
71 * \brief Destructor
72 *
73 */
74 ~VrpnClient();
75
76 /*!
77 * \brief Setup Layout
78 *
79 * \return a Layout available
80 */
81 gui::Layout *GetLayout(void) const;
82
83 /*!
84 * \brief Setup Tab
85 *
86 * \return a Tab available
87 */
88 gui::TabWidget *GetTabWidget(void) const;
89
90 /*!
91 * \brief Is XBee used?
92 *
93 * \return true if connection is based on XBee modem
94 */
95 bool UseXbee(void) const;
96
97private:
98 /*!
99 * \brief Run function
100 *
101 * Reimplemented from Thread.
102 *
103 */
104 void Run(void);
105
106 class VrpnClient_impl *pimpl_;
107};
108
109/*!
110* \brief get VrpnClient
111*
112* \return the VrpnClient
113*/
114VrpnClient *GetVrpnClient(void);
115
116} // end namespace sensor
117} // end namespace flair
118#endif // VRPNCLIENT_H
Note: See TracBrowser for help on using the repository browser.