-
Notifications
You must be signed in to change notification settings - Fork 13
/
CfgFxn.h
161 lines (132 loc) · 4.96 KB
/
CfgFxn.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
//
// Copyright 2015 - 2017 (C). Alex Robenko. All rights reserved.
//
// This file is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http:https://www.gnu.org/licenses/>.
/// @file
/// @brief Contains definition of CFG-FXN message and its fields.
#pragma once
#include "ublox/Message.h"
#include "ublox/field/common.h"
namespace ublox
{
namespace message
{
/// @brief Accumulates details of all the CFG-FXN message fields.
/// @see CfgFxn
struct CfgFxnFields
{
/// @brief Definition of "flags" field.
struct flags : public
field::common::X4T<
comms::option::BitmaskReservedBits<0xffffffe5, 0>
>
{
/// @brief Provide names for internal bits.
/// @details See definition of @b COMMS_BITMASK_BITS macro
/// related to @b comms::field::BitmaskValue class from COMMS library
/// for details.
COMMS_BITMASK_BITS(sleep=1, absAlign=3, onOff);
/// @brief Provide convenience access functions for internal bits.
/// @details See definition of @b COMMS_BITMASK_BITS_ACCESS macro
/// related to @b comms::field::BitmaskValue class from COMMS library
/// for details.
COMMS_BITMASK_BITS_ACCESS(sleep, absAlign, onOff);
};
/// @brief Definition of "tReacq" field.
using tReacq = field::common::U4T<comms::option::UnitsMilliseconds>;
/// @brief Definition of "tAcq" field.
using tAcq = field::common::U4T<comms::option::UnitsMilliseconds>;
/// @brief Definition of "tReacqOff" field.
using tReacqOff = field::common::U4T<comms::option::UnitsMilliseconds>;
/// @brief Definition of "tAcqOff" field.
using tAcqOff = field::common::U4T<comms::option::UnitsMilliseconds>;
/// @brief Definition of "tOn" field.
using tOn = field::common::U4T<comms::option::UnitsMilliseconds>;
/// @brief Definition of "tOff" field.
using tOff = field::common::U4T<comms::option::UnitsMilliseconds>;
/// @brief Definition of "res" field.
using res = field::common::res4;
/// @brief Definition of "baseTow" field.
using baseTow = field::common::U4T<comms::option::UnitsMilliseconds>;
/// @brief All the fields bundled in std::tuple.
using All = std::tuple<
flags,
tReacq,
tAcq,
tReacqOff,
tAcqOff,
tOn,
tOff,
res,
baseTow
>;
};
/// @brief Definition of CFG-FXN message
/// @details Inherits from @b comms::MessageBase
/// while providing @b TMsgBase as common interface class as well as
/// various implementation options. @n
/// See @ref CfgFxnFields and for definition of the fields this message contains
/// and COMMS_MSG_FIELDS_ACCESS() for fields access details.
/// @tparam TMsgBase Common interface class for all the messages.
template <typename TMsgBase = Message>
class CfgFxn : public
comms::MessageBase<
TMsgBase,
comms::option::StaticNumIdImpl<MsgId_CFG_FXN>,
comms::option::FieldsImpl<CfgFxnFields::All>,
comms::option::MsgType<CfgFxn<TMsgBase> >
>
{
public:
/// @brief Allow access to internal fields.
/// @details See definition of @b COMMS_MSG_FIELDS_ACCESS macro
/// related to @b comms::MessageBase class from COMMS library
/// for details.
///
/// The field names are:
/// @li @b flags for @ref CfgFxnFields::flags field
/// @li @b tReacq for @ref CfgFxnFields::tReacq field
/// @li @b tAcq for @ref CfgFxnFields::tAcq field
/// @li @b tReacqOff for @ref CfgFxnFields::tReacqOff field
/// @li @b tAcqOff for @ref CfgFxnFields::tAcqOff field
/// @li @b tOn for @ref CfgFxnFields::tOn field
/// @li @b tOff for @ref CfgFxnFields::tOff field
/// @li @b res for @ref CfgFxnFields::res field
/// @li @b baseTow for @ref CfgFxnFields::baseTow field
COMMS_MSG_FIELDS_ACCESS(
flags,
tReacq,
tAcq,
tReacqOff,
tAcqOff,
tOn,
tOff,
res,
baseTow
);
/// @brief Default constructor
CfgFxn() = default;
/// @brief Copy constructor
CfgFxn(const CfgFxn&) = default;
/// @brief Move constructor
CfgFxn(CfgFxn&& other) = default;
/// @brief Destructor
~CfgFxn() = default;
/// @brief Copy assignment
CfgFxn& operator=(const CfgFxn&) = default;
/// @brief Move assignment
CfgFxn& operator=(CfgFxn&&) = default;
};
} // namespace message
} // namespace ublox