Debian Codegraph @

3rdparty/xspublic/xstypes/xsbaudrate.h

raw
1
2 // Copyright (c) 2003-2019 Xsens Technologies B.V. or subsidiaries worldwide.
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without modification,
6 // are permitted provided that the following conditions are met:
7 //
8 // 1. Redistributions of source code must retain the above copyright notice,
9 // this list of conditions, and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright notice,
12 // this list of conditions, and the following disclaimer in the documentation
13 // and/or other materials provided with the distribution.
14 //
15 // 3. Neither the names of the copyright holders nor the names of their contributors
16 // may be used to endorse or promote products derived from this software without
17 // specific prior written permission.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
20 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
22 // THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
24 // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
26 // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
28 // SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
29 // OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
30 // ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
31 //
32
33 #ifndef XSBAUDRATE_H
34 #define XSBAUDRATE_H
35
36 #ifdef _WIN32
37 # include <windows.h>
38 #else
39 # include <termios.h>
40 # ifndef B460800
41 # undef B230400
42 # define B230400 0010003
43 # define B460800 0010004
44 # define B921600 0010007
45 # endif
46 #endif
47
48 /*! \addtogroup enums Global enumerations
49 @{
50 */
51 #ifdef _WIN32
52
53 //AUTO namespace xstypes {
54 /*! \brief Communication speed. */
55 enum XsBaudRate {
56 XBR_Invalid = 0, //!< Not a valid baud rate
57 XBR_4800 = CBR_4800, //!< 4k8 (4800 bps)
58 XBR_9600 = CBR_9600, //!< 9k6 (9600 bps)
59 // XBR_14k4 = CBR_14400,
60 XBR_19k2 = CBR_19200, //!< 19k2 (19200 bps)
61 // XBR_28k8 = 28800,
62 XBR_38k4 = CBR_38400, //!< 38k4 (38400 bps)
63 XBR_57k6 = CBR_57600, //!< 57k6 (57600 bps)
64 XBR_115k2 = CBR_115200, //!< 115k2 (115200 bps)
65 XBR_230k4 = 230400, //!< 230k4 (230400 bps)
66 XBR_460k8 = 460800, //!< 460k8 (460800 bps)
67 XBR_921k6 = 921600, //!< 921k6 (921600 bps)
68 XBR_2000k = 2000000, //!< 2000k0 (2000000 bps)
69 XBR_3500k = 3500000, //!< 3500k0 (3500000 bps)
70 XBR_4000k = 4000000 //!< 4000k0 (4000000 bps)
71 };
72 //AUTO }
73
74 #else
75
76 /*! \brief Communication speed. */
77 enum XSNOCOMEXPORT XsBaudRate {
78
79 // support high baudrates on MAC OS X
80 #ifndef SWIG
81
82 #ifndef B2000000
83 #define B2000000 2000000
84 #endif
85 #ifndef B3500000
86 #define B3500000 3500000
87 #endif
88 #ifndef B4000000
89 #define B4000000 4000000
90 #endif
91 #endif
92 XBR_Invalid = 0, //!< Not a valid baud rate
93
94 XBR_4800 = B4800, //!< 4k8 (4800 bps)
95 XBR_9600 = B9600, //!< 9k6 (9600 bps)
96 // XBR_14k4 = B14400,
97 XBR_19k2 = B19200, //!< 19k2 (19200 bps)
98 // XBR_28k8 = B28800,
99 XBR_38k4 = B38400, //!< 38k4 (38400 bps)
100 XBR_57k6 = B57600, //!< 57k6 (57600 bps)
101 XBR_115k2 = B115200, //!< 115k2 (115200 bps)
102 XBR_230k4 = B230400, //!< 230k4 (230400 bps)
103 XBR_460k8 = B460800, //!< 460k8 (460800 bps)
104 XBR_921k6 = B921600, //!< 921k6 (921600 bps)
105 #ifndef SWIG
106 XBR_2000k = B2000000, //!< 2000k0 (2000000 bps)
107 XBR_3500k = B3500000, //!< 3500k0 (3500000 bps)
108 XBR_4000k = B4000000 //!< 4000k0 (4000000 bps)
109 #else
110 XBR_2000k = 2000000, //!< 2000k0 (2000000 bps)
111 XBR_3500k = 3500000, //!< 3500k0 (3500000 bps)
112 XBR_4000k = 4000000 //!< 4000k0 (4000000 bps)
113 #endif
114 };
115 /*! \brief Communication speed. */
116 typedef enum XsBaudRate XsBaudRate;
117 #endif
118 /*! @} */
119
120 #endif