MIP SDK  0.0.1
MicroStrain Communications Library for embedded systems
commands_gnss.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "descriptors.h"
4 #include "../mip_result.h"
5 
6 #include <stdint.h>
7 #include <stddef.h>
8 #include <stdbool.h>
9 
10 namespace mip {
11 class Serializer;
12 
13 namespace C {
14 struct mip_interface;
15 } // namespace C
16 
17 namespace commands_gnss {
18 
25 
27 // Descriptors
29 
30 enum
31 {
33 
38 
42 };
43 
45 // Shared Type Definitions
47 
48 static const uint16_t GNSS_GPS_ENABLE_L1CA = 0x0001;
49 static const uint16_t GNSS_GPS_ENABLE_L2C = 0x0002;
50 static const uint16_t GNSS_GLONASS_ENABLE_L1OF = 0x0001;
51 static const uint16_t GNSS_GLONASS_ENABLE_L2OF = 0x0002;
52 static const uint16_t GNSS_GALILEO_ENABLE_E1 = 0x0001;
53 static const uint16_t GNSS_GALILEO_ENABLE_E5B = 0x0002;
54 static const uint16_t GNSS_BEIDOU_ENABLE_B1 = 0x0001;
55 static const uint16_t GNSS_BEIDOU_ENABLE_B2 = 0x0002;
56 
58 // Mip Fields
60 
67 
69 {
72 
73  static const bool HAS_FUNCTION_SELECTOR = false;
74 
75  struct Info
76  {
77  uint8_t receiver_id = 0;
79  char description[32] = {0};
80 
81  };
82 
83  struct Response
84  {
87 
88  uint8_t num_receivers = 0;
89  Info* receiver_info = {nullptr};
90 
91  };
92 };
93 void insert(Serializer& serializer, const ReceiverInfo& self);
94 void extract(Serializer& serializer, ReceiverInfo& self);
95 
96 void insert(Serializer& serializer, const ReceiverInfo::Info& self);
97 void extract(Serializer& serializer, ReceiverInfo::Info& self);
98 
99 void insert(Serializer& serializer, const ReceiverInfo::Response& self);
100 void extract(Serializer& serializer, ReceiverInfo::Response& self);
101 
102 CmdResult receiverInfo(C::mip_interface& device, uint8_t* numReceiversOut, uint8_t numReceiversOutMax, ReceiverInfo::Info* receiverInfoOut);
111 
113 {
116 
117  static const bool HAS_WRITE_FUNCTION = true;
118  static const bool HAS_READ_FUNCTION = true;
119  static const bool HAS_SAVE_FUNCTION = true;
120  static const bool HAS_LOAD_FUNCTION = true;
121  static const bool HAS_RESET_FUNCTION = true;
122 
123  FunctionSelector function = static_cast<FunctionSelector>(0);
124  uint8_t gps_enable = 0;
125  uint8_t glonass_enable = 0;
126  uint8_t galileo_enable = 0;
127  uint8_t beidou_enable = 0;
128  uint8_t reserved[4] = {0};
129 
130  struct Response
131  {
134 
135  uint8_t gps_enable = 0;
136  uint8_t glonass_enable = 0;
137  uint8_t galileo_enable = 0;
138  uint8_t beidou_enable = 0;
139  uint8_t reserved[4] = {0};
140 
141  };
142 };
143 void insert(Serializer& serializer, const SignalConfiguration& self);
144 void extract(Serializer& serializer, SignalConfiguration& self);
145 
146 void insert(Serializer& serializer, const SignalConfiguration::Response& self);
147 void extract(Serializer& serializer, SignalConfiguration::Response& self);
148 
149 CmdResult writeSignalConfiguration(C::mip_interface& device, uint8_t gpsEnable, uint8_t glonassEnable, uint8_t galileoEnable, uint8_t beidouEnable, const uint8_t* reserved);
150 CmdResult readSignalConfiguration(C::mip_interface& device, uint8_t* gpsEnableOut, uint8_t* glonassEnableOut, uint8_t* galileoEnableOut, uint8_t* beidouEnableOut, uint8_t* reservedOut);
162 
164 {
167 
168  static const bool HAS_WRITE_FUNCTION = true;
169  static const bool HAS_READ_FUNCTION = true;
170  static const bool HAS_SAVE_FUNCTION = true;
171  static const bool HAS_LOAD_FUNCTION = true;
172  static const bool HAS_RESET_FUNCTION = true;
173 
174  FunctionSelector function = static_cast<FunctionSelector>(0);
175  uint8_t enable = 0;
176  uint8_t reserved[3] = {0};
177 
178  struct Response
179  {
182 
183  uint8_t enable = 0;
184  uint8_t reserved[3] = {0};
185 
186  };
187 };
188 void insert(Serializer& serializer, const RtkDongleConfiguration& self);
189 void extract(Serializer& serializer, RtkDongleConfiguration& self);
190 
191 void insert(Serializer& serializer, const RtkDongleConfiguration::Response& self);
192 void extract(Serializer& serializer, RtkDongleConfiguration::Response& self);
193 
194 CmdResult writeRtkDongleConfiguration(C::mip_interface& device, uint8_t enable, const uint8_t* reserved);
195 CmdResult readRtkDongleConfiguration(C::mip_interface& device, uint8_t* enableOut, uint8_t* reservedOut);
208 
210 {
213 
214  static const bool HAS_FUNCTION_SELECTOR = false;
215 
216  uint8_t receiver_id = 0;
217  uint8_t enable = 0;
218 
219 };
220 void insert(Serializer& serializer, const ReceiverSafeMode& self);
221 void extract(Serializer& serializer, ReceiverSafeMode& self);
222 
223 CmdResult receiverSafeMode(C::mip_interface& device, uint8_t receiverId, uint8_t enable);
226 
231 } // namespace commands_gnss
232 } // namespace mip
233 
Serialization class.
Definition: serialization.h:145
void extract(Serializer &serializer, ReceiverInfo &self)
Definition: commands_gnss.cpp:37
CmdResult receiverInfo(C::mip_interface &device, uint8_t *numReceiversOut, uint8_t numReceiversOutMax, ReceiverInfo::Info *receiverInfoOut)
Definition: commands_gnss.cpp:80
void insert(Serializer &serializer, const ReceiverInfo &self)
Definition: commands_gnss.cpp:32
CmdResult receiverSafeMode(C::mip_interface &device, uint8_t receiverId, uint8_t enable)
Definition: commands_gnss.cpp:389
CmdResult loadRtkDongleConfiguration(C::mip_interface &device)
Definition: commands_gnss.cpp:354
CmdResult writeRtkDongleConfiguration(C::mip_interface &device, uint8_t enable, const uint8_t *reserved)
Definition: commands_gnss.cpp:301
CmdResult readRtkDongleConfiguration(C::mip_interface &device, uint8_t *enableOut, uint8_t *reservedOut)
Definition: commands_gnss.cpp:317
CmdResult saveRtkDongleConfiguration(C::mip_interface &device)
Definition: commands_gnss.cpp:344
CmdResult defaultRtkDongleConfiguration(C::mip_interface &device)
Definition: commands_gnss.cpp:364
CmdResult saveSignalConfiguration(C::mip_interface &device)
Definition: commands_gnss.cpp:227
CmdResult defaultSignalConfiguration(C::mip_interface &device)
Definition: commands_gnss.cpp:247
CmdResult loadSignalConfiguration(C::mip_interface &device)
Definition: commands_gnss.cpp:237
CmdResult writeSignalConfiguration(C::mip_interface &device, uint8_t gpsEnable, uint8_t glonassEnable, uint8_t galileoEnable, uint8_t beidouEnable, const uint8_t *reserved)
Definition: commands_gnss.cpp:169
CmdResult readSignalConfiguration(C::mip_interface &device, uint8_t *gpsEnableOut, uint8_t *glonassEnableOut, uint8_t *galileoEnableOut, uint8_t *beidouEnableOut, uint8_t *reservedOut)
Definition: commands_gnss.cpp:191
@ CMD_RECEIVER_SAFE_MODE
Definition: commands_gnss.hpp:37
@ CMD_LIST_RECEIVERS
Definition: commands_gnss.hpp:34
@ CMD_SIGNAL_CONFIGURATION
Definition: commands_gnss.hpp:35
@ REPLY_LIST_RECEIVERS
Definition: commands_gnss.hpp:39
@ CMD_RTK_DONGLE_CONFIGURATION
Definition: commands_gnss.hpp:36
@ DESCRIPTOR_SET
Definition: commands_gnss.hpp:32
@ REPLY_SIGNAL_CONFIGURATION
Definition: commands_gnss.hpp:40
@ REPLY_RTK_DONGLE_CONFIGURATION
Definition: commands_gnss.hpp:41
struct mip::C::mip_interface mip_interface
State of the interface for communicating with a MIP device.
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
FunctionSelector
Definition: descriptors.h:102
State of the interface for communicating with a MIP device.
Definition: mip_interface.h:52
Represents the status of a MIP command.
Definition: mip_result.h:67
Definition: commands_gnss.hpp:76
uint8_t receiver_id
Receiver id: e.g. 1, 2, etc.
Definition: commands_gnss.hpp:77
uint8_t mip_data_descriptor_set
MIP descriptor set associated with this receiver.
Definition: commands_gnss.hpp:78
char description[32]
Ascii description of receiver.
Definition: commands_gnss.hpp:79
Definition: commands_gnss.hpp:84
static const uint8_t FIELD_DESCRIPTOR
Definition: commands_gnss.hpp:86
Info * receiver_info
Definition: commands_gnss.hpp:89
uint8_t num_receivers
Number of physical receivers in the device.
Definition: commands_gnss.hpp:88
static const uint8_t DESCRIPTOR_SET
Definition: commands_gnss.hpp:85
Definition: commands_gnss.hpp:69
static const uint8_t DESCRIPTOR_SET
Definition: commands_gnss.hpp:70
static const uint8_t FIELD_DESCRIPTOR
Definition: commands_gnss.hpp:71
static const bool HAS_FUNCTION_SELECTOR
Definition: commands_gnss.hpp:73
Definition: commands_gnss.hpp:210
static const bool HAS_FUNCTION_SELECTOR
Definition: commands_gnss.hpp:214
static const uint8_t FIELD_DESCRIPTOR
Definition: commands_gnss.hpp:212
uint8_t enable
0 - Disabled, 1- Enabled
Definition: commands_gnss.hpp:217
static const uint8_t DESCRIPTOR_SET
Definition: commands_gnss.hpp:211
uint8_t receiver_id
Receiver id: e.g. 1, 2, etc.
Definition: commands_gnss.hpp:216
static const uint8_t DESCRIPTOR_SET
Definition: commands_gnss.hpp:180
static const uint8_t FIELD_DESCRIPTOR
Definition: commands_gnss.hpp:181
uint8_t reserved[3]
Definition: commands_gnss.hpp:184
uint8_t enable
Definition: commands_gnss.hpp:183
Definition: commands_gnss.hpp:164
static const bool HAS_LOAD_FUNCTION
Definition: commands_gnss.hpp:171
uint8_t reserved[3]
Definition: commands_gnss.hpp:176
static const bool HAS_WRITE_FUNCTION
Definition: commands_gnss.hpp:168
static const uint8_t FIELD_DESCRIPTOR
Definition: commands_gnss.hpp:166
static const bool HAS_READ_FUNCTION
Definition: commands_gnss.hpp:169
static const bool HAS_SAVE_FUNCTION
Definition: commands_gnss.hpp:170
static const bool HAS_RESET_FUNCTION
Definition: commands_gnss.hpp:172
uint8_t enable
0 - Disabled, 1- Enabled
Definition: commands_gnss.hpp:175
static const uint8_t DESCRIPTOR_SET
Definition: commands_gnss.hpp:165
Definition: commands_gnss.hpp:131
static const uint8_t DESCRIPTOR_SET
Definition: commands_gnss.hpp:132
uint8_t beidou_enable
Bitfield 0: Enable B1, 1: Enable B2.
Definition: commands_gnss.hpp:138
static const uint8_t FIELD_DESCRIPTOR
Definition: commands_gnss.hpp:133
uint8_t reserved[4]
Definition: commands_gnss.hpp:139
uint8_t gps_enable
Bitfield 0: Enable L1CA, 1: Enable L2C.
Definition: commands_gnss.hpp:135
uint8_t galileo_enable
Bitfield 0: Enable E1, 1: Enable E5B.
Definition: commands_gnss.hpp:137
uint8_t glonass_enable
Bitfield 0: Enable L1OF, 1: Enable L2OF.
Definition: commands_gnss.hpp:136
Definition: commands_gnss.hpp:113
static const bool HAS_LOAD_FUNCTION
Definition: commands_gnss.hpp:120
static const uint8_t DESCRIPTOR_SET
Definition: commands_gnss.hpp:114
uint8_t reserved[4]
Definition: commands_gnss.hpp:128
static const uint8_t FIELD_DESCRIPTOR
Definition: commands_gnss.hpp:115
uint8_t beidou_enable
Bitfield 0: Enable B1, 1: Enable B2.
Definition: commands_gnss.hpp:127
uint8_t galileo_enable
Bitfield 0: Enable E1, 1: Enable E5B.
Definition: commands_gnss.hpp:126
uint8_t glonass_enable
Bitfield 0: Enable L1OF, 1: Enable L2OF.
Definition: commands_gnss.hpp:125
static const bool HAS_SAVE_FUNCTION
Definition: commands_gnss.hpp:119
static const bool HAS_WRITE_FUNCTION
Definition: commands_gnss.hpp:117
uint8_t gps_enable
Bitfield 0: Enable L1CA, 1: Enable L2C.
Definition: commands_gnss.hpp:124
static const bool HAS_RESET_FUNCTION
Definition: commands_gnss.hpp:121
static const bool HAS_READ_FUNCTION
Definition: commands_gnss.hpp:118