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

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

vrpn: improved timeout

File size: 2.2 KB
RevLine 
[3]1// %flair:license{
[15]2// This file is part of the Flair framework distributed under the
3// CECILL-C License, Version 1.0.
[3]4// %flair:license}
5/*!
6 * \file VrpnClient.h
7 * \brief Class to connect to a Vrpn server
[15]8 * \author César Richard, Guillaume Sanahuja, Copyright Heudiasyc UMR UTC/CNRS
9 * 7253
[3]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
[15]19namespace flair {
[122]20 namespace core {
21 class SerialPort;
22 }
23 namespace gui {
24 class TabWidget;
25 class Layout;
26 }
[3]27}
28
29class VrpnClient_impl;
30class VrpnObject_impl;
31
[15]32namespace flair {
33namespace sensor {
34/*! \class VrpnClient
35*
[122]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.
[15]39*/
40class VrpnClient : public core::Thread {
41 friend class ::VrpnObject_impl;
[3]42
[15]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 */
[122]53 VrpnClient(std::string name,
[136]54 std::string address, uint8_t priority);
[3]55
[15]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 */
[122]66 VrpnClient(std::string name,
[15]67 core::SerialPort *serialport, uint16_t us_period,
68 uint8_t priority);
[3]69
[15]70 /*!
71 * \brief Destructor
72 *
73 */
74 ~VrpnClient();
[3]75
[15]76 /*!
77 * \brief Setup Layout
78 *
79 * \return a Layout available
80 */
81 gui::Layout *GetLayout(void) const;
[3]82
[15]83 /*!
84 * \brief Setup Tab
85 *
86 * \return a Tab available
87 */
88 gui::TabWidget *GetTabWidget(void) const;
[3]89
[15]90 /*!
91 * \brief Is XBee used?
92 *
93 * \return true if connection is based on XBee modem
94 */
95 bool UseXbee(void) const;
[3]96
[15]97private:
98 /*!
99 * \brief Run function
100 *
101 * Reimplemented from Thread.
102 *
103 */
104 void Run(void);
[3]105
[15]106 class VrpnClient_impl *pimpl_;
107};
[122]108
109/*!
110* \brief get VrpnClient
111*
112* \return the VrpnClient
113*/
114VrpnClient *GetVrpnClient(void);
115
[3]116} // end namespace sensor
117} // end namespace flair
118#endif // VRPNCLIENT_H
Note: See TracBrowser for help on using the repository browser.