xsselftestresult.h
Go to the documentation of this file.
1 
2 // Copyright (c) 2003-2021 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 
34 // Copyright (c) 2003-2021 Xsens Technologies B.V. or subsidiaries worldwide.
35 // All rights reserved.
36 //
37 // Redistribution and use in source and binary forms, with or without modification,
38 // are permitted provided that the following conditions are met:
39 //
40 // 1. Redistributions of source code must retain the above copyright notice,
41 // this list of conditions, and the following disclaimer.
42 //
43 // 2. Redistributions in binary form must reproduce the above copyright notice,
44 // this list of conditions, and the following disclaimer in the documentation
45 // and/or other materials provided with the distribution.
46 //
47 // 3. Neither the names of the copyright holders nor the names of their contributors
48 // may be used to endorse or promote products derived from this software without
49 // specific prior written permission.
50 //
51 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
52 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
53 // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
54 // THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
55 // SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
56 // OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 // HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY OR
58 // TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
59 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.THE LAWS OF THE NETHERLANDS
60 // SHALL BE EXCLUSIVELY APPLICABLE AND ANY DISPUTES SHALL BE FINALLY SETTLED UNDER THE RULES
61 // OF ARBITRATION OF THE INTERNATIONAL CHAMBER OF COMMERCE IN THE HAGUE BY ONE OR MORE
62 // ARBITRATORS APPOINTED IN ACCORDANCE WITH SAID RULES.
63 //
64 
65 #ifndef XSSELFTESTRESULT_H
66 #define XSSELFTESTRESULT_H
67 
68 #include <xstypes/pstdint.h>
69 
77 {
78  XSTF_X = 0x01
79  , XSTF_Y = 0x02
80  , XSTF_Z = 0x04
93  , XSTF_Baro = 1 << 9
94  , XSTF_Gnss = 1 << 10
95  , XSTF_Battery = 1 << 11
96  , XSTF_Flash = 1 << 12
97  , XSTF_Button = 1 << 13
98  , XSTF_Sync = 1 << 14
99 };
102 
106 {
107  uint16_t m_flags;
108 
109 #ifdef __cplusplus
110  static inline XsSelfTestResult create(uint16_t resultFlags)
112  {
113  XsSelfTestResult tmp = { resultFlags };
114  return tmp;
115  }
116 
118  inline bool accX() const
119  {
120  return (m_flags & XSTF_AccX) != 0;
121  }
122 
124  inline bool accY() const
125  {
126  return (m_flags & XSTF_AccY) != 0;
127  }
128 
130  inline bool accZ() const
131  {
132  return (m_flags & XSTF_AccZ) != 0;
133  }
134 
136  inline bool gyrX() const
137  {
138  return (m_flags & XSTF_GyrX) != 0;
139  }
140 
142  inline bool gyrY() const
143  {
144  return (m_flags & XSTF_GyrY) != 0;
145  }
146 
148  inline bool gyrZ() const
149  {
150  return (m_flags & XSTF_GyrZ) != 0;
151  }
152 
154  inline bool magX() const
155  {
156  return (m_flags & XSTF_MagX) != 0;
157  }
158 
160  inline bool magY() const
161  {
162  return (m_flags & XSTF_MagY) != 0;
163  }
164 
166  inline bool magZ() const
167  {
168  return (m_flags & XSTF_MagZ) != 0;
169  }
170 
175  inline bool baro() const
176  {
177  return (m_flags & XSTF_Baro) != 0;
178  }
179 
184  inline bool gnss() const
185  {
186  return (m_flags & XSTF_Gnss) != 0;
187  }
188 
193  inline bool battery() const
194  {
195  return (m_flags & XSTF_Battery) != 0;
196  }
197 
202  inline bool flash() const
203  {
204  return (m_flags & XSTF_Flash) != 0;
205  }
206 
211  inline bool button() const
212  {
213  return (m_flags & XSTF_Button) != 0;
214  }
215 
216 
221  inline bool sync() const
222  {
223  return (m_flags & XSTF_Sync) != 0;
224  }
225 #endif
226 };
227 
229 
230 #endif
XSTF_MagZ
@ XSTF_MagZ
Definition: xsselftestresult.h:92
XSTF_Sync
@ XSTF_Sync
Definition: xsselftestresult.h:98
XsSelfTestResult
Contains the results of a self-test performed by an Xsens device.
Definition: xsselftestresult.h:105
XSTF_AccZ
@ XSTF_AccZ
Definition: xsselftestresult.h:84
XSTF_Baro
@ XSTF_Baro
Definition: xsselftestresult.h:93
XSTF_Gnss
@ XSTF_Gnss
Definition: xsselftestresult.h:94
XSTF_MagShift
@ XSTF_MagShift
Definition: xsselftestresult.h:89
XSTF_AccShift
@ XSTF_AccShift
Definition: xsselftestresult.h:81
XSTF_AccY
@ XSTF_AccY
Definition: xsselftestresult.h:83
XSTF_GyrShift
@ XSTF_GyrShift
Definition: xsselftestresult.h:85
XSTF_Button
@ XSTF_Button
Definition: xsselftestresult.h:97
XSTF_Battery
@ XSTF_Battery
Definition: xsselftestresult.h:95
pstdint.h
XSTF_Z
@ XSTF_Z
Definition: xsselftestresult.h:80
XsSelfTestFlag
XsSelfTestFlag
Enumeration of bits that describe whether the various self-tests succeeded.
Definition: xsselftestresult.h:76
XsSelfTestResult::m_flags
uint16_t m_flags
Flags that specify which tests have passed.
Definition: xsselftestresult.h:107
XSTF_GyrX
@ XSTF_GyrX
Definition: xsselftestresult.h:86
XSTF_GyrZ
@ XSTF_GyrZ
Definition: xsselftestresult.h:88
XSTF_X
@ XSTF_X
Definition: xsselftestresult.h:78
XSTF_MagX
@ XSTF_MagX
Definition: xsselftestresult.h:90
XSTF_AccX
@ XSTF_AccX
Definition: xsselftestresult.h:82
XSTF_GyrY
@ XSTF_GyrY
Definition: xsselftestresult.h:87
XSTF_Y
@ XSTF_Y
Definition: xsselftestresult.h:79
XSTF_Flash
@ XSTF_Flash
Definition: xsselftestresult.h:96
XSTF_MagY
@ XSTF_MagY
Definition: xsselftestresult.h:91


xsens_mti_driver
Author(s):
autogenerated on Sun Sep 3 2023 02:43:20