ISDataMappings.cpp
Go to the documentation of this file.
1 /*
2 MIT LICENSE
3 
4 Copyright (c) 2014-2020 Inertial Sense, Inc. - http://inertialsense.com
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions :
7 
8 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
9 
10 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11 */
12 
13 #include <map>
14 #include <vector>
15 #include <set>
16 #include <algorithm>
17 #include <stdlib.h>
18 #include <stddef.h>
19 #include <inttypes.h>
20 #include <stdio.h>
21 #include <assert.h>
22 #include <string.h>
23 
24 #include "ISDataMappings.h"
25 #include "DataJSON.h"
26 #include "ISUtilities.h"
27 #include "ISConstants.h"
28 #include "data_sets.h"
29 
30 #ifdef USE_IS_INTERNAL
31 #include "../../libs/IS_internal.h"
32 #endif
33 
34 #if PLATFORM_IS_EMBEDDED
36 #else
38 #endif
39 
40 const unsigned char g_asciiToLowerMap[256] =
41 {
42  0,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,
43  41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
44  'r','s','t','u','v','w','x','y','z',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,
45  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,
46  154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,
47  189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,
48  224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
49 };
50 
52 {
53  (uint32_t)sizeof(int8_t),
54  (uint32_t)sizeof(uint8_t),
55  (uint32_t)sizeof(int16_t),
56  (uint32_t)sizeof(uint16_t),
57  (uint32_t)sizeof(int32_t),
58  (uint32_t)sizeof(uint32_t),
59  (uint32_t)sizeof(int64_t),
60  (uint32_t)sizeof(uint64_t),
61  (uint32_t)sizeof(float),
62  (uint32_t)sizeof(double),
63  (uint32_t)0, // string, must be set to actual size by caller
64  (uint32_t)0 // binary, must be set to actual size by caller
65 };
66 
67 inline uint32_t GetDataTypeSize(eDataType dataType)
68 {
69  if (dataType >= 0 && dataType < DataTypeCount)
70  {
71  return s_eDataTypeSizes[dataType];
72  }
73  return 0;
74 }
75 
76 #if CPP11_IS_ENABLED
77 
78 // dataSize can be 0 for default size, must be set for string type
79 #define ADD_MAP_NO_VALIDATION(map, totalSize, name, member, dataSize, dataType, memberType) (map)[std::string(name)] = { (uint32_t)offsetof(MAP_TYPE, member), (uint32_t)(dataSize == 0 ? sizeof(memberType) : dataSize), dataType, name }; totalSize += sizeof(memberType);
80 
81 // note when passing member type for arrays, it must be a reference, i.e. float&
82 #define ADD_MAP(map, totalSize, name, member, dataSize, dataType, memberType) \
83  ADD_MAP_NO_VALIDATION(map, totalSize, name, member, dataSize, dataType, memberType); \
84  static_assert(is_same<decltype(MAP_TYPE::member), memberType>::value, "Member type is an unexpected type"); \
85  static_assert((uint32_t)(dataSize == 0 ? sizeof(memberType) : dataSize) == sizeof(memberType), "Member type is an unexpected size"); \
86  static_assert((uint32_t)(dataSize == 0 ? sizeof(memberType) : dataSize) == sizeof(MAP_TYPE::member), "Member type is an unexpected size"); \
87  static_assert(s_eDataTypeSizes[dataType] == 0 || (uint32_t)(dataSize == 0 ? sizeof(memberType) : dataSize) == s_eDataTypeSizes[dataType], "Data type size does not match member size");
88 #define ASSERT_SIZE(s) assert(s == sizeof(MAP_TYPE))
89 
90 #else
91 
92 #define ADD_MAP_NO_VALIDATION(map, totalSize, name, member, dataSize, dataType, memberType) (map)[std::string(name)] = { (uint32_t)offsetof(MAP_TYPE, member), (uint32_t)(dataSize == 0 ? sizeof(memberType) : dataSize), dataType, name }; totalSize += sizeof(memberType);
93 #define ADD_MAP(map, totalSize, name, member, dataSize, dataType, memberType) ADD_MAP_NO_VALIDATION(map, totalSize, name, member, dataSize, dataType, memberType)
94 #define ASSERT_SIZE(s) // not supported on VS < 2015
95 
96 #endif
97 
98 static void PopulateSizeMappings(uint32_t sizeMap[DID_COUNT])
99 {
100  //memset(sizeMap, 0, sizeof(sizeMap));
101  // NOTE: If you use the line above, the compiler issues this warning:
102  // "‘sizeof’ on array function parameter ‘sizeMap’ will return size of ‘uint32_t* {aka unsigned int*}’"
103  // So, we use `sizeof(uint32_t) * DID_COUNT` instead to get the correct size.
104  memset(sizeMap, 0, sizeof(uint32_t) * DID_COUNT);
105 
106  sizeMap[DID_DEV_INFO] = sizeof(dev_info_t);
107  sizeMap[DID_MAGNETOMETER_1] = sizeof(magnetometer_t);
108  sizeMap[DID_MAGNETOMETER_2] = sizeof(magnetometer_t);
109  sizeMap[DID_BAROMETER] = sizeof(barometer_t);
110  sizeMap[DID_PREINTEGRATED_IMU] = sizeof(preintegrated_imu_t);
111  sizeMap[DID_WHEEL_ENCODER] = sizeof(wheel_encoder_t);
112  sizeMap[DID_SYS_CMD] = sizeof(system_command_t);
113  sizeMap[DID_INS_1] = sizeof(ins_1_t);
114  sizeMap[DID_INS_2] = sizeof(ins_2_t);
115  sizeMap[DID_INS_3] = sizeof(ins_3_t);
116  sizeMap[DID_INS_4] = sizeof(ins_4_t);
117  sizeMap[DID_GPS1_POS] = sizeof(gps_pos_t);
118  sizeMap[DID_GPS1_UBX_POS] = sizeof(gps_pos_t);
119  sizeMap[DID_GPS1_VEL] = sizeof(gps_vel_t);
120  sizeMap[DID_GPS2_POS] = sizeof(gps_pos_t);
121  sizeMap[DID_GPS2_VEL] = sizeof(gps_vel_t);
122  sizeMap[DID_GPS1_SAT] = sizeof(gps_sat_t);
123  sizeMap[DID_GPS2_SAT] = sizeof(gps_sat_t);
124  sizeMap[DID_GPS1_VERSION] = sizeof(gps_version_t);
125  sizeMap[DID_GPS2_VERSION] = sizeof(gps_version_t);
126  sizeMap[DID_GPS1_RTK_POS] = sizeof(gps_pos_t);
127  sizeMap[DID_GPS1_RTK_POS_REL] = sizeof(gps_rtk_rel_t);
128  sizeMap[DID_GPS1_RTK_POS_MISC] = sizeof(gps_rtk_misc_t);
129  sizeMap[DID_GPS2_RTK_CMP_REL] = sizeof(gps_rtk_rel_t);
130  sizeMap[DID_GPS2_RTK_CMP_MISC] = sizeof(gps_rtk_misc_t);
131  sizeMap[DID_SYS_PARAMS] = sizeof(sys_params_t);
132  sizeMap[DID_SYS_SENSORS] = sizeof(sys_sensors_t);
133  sizeMap[DID_FLASH_CONFIG] = sizeof(nvm_flash_cfg_t);
134  sizeMap[DID_DUAL_IMU] = sizeof(dual_imu_t);
135  sizeMap[DID_DUAL_IMU_RAW] = sizeof(dual_imu_t);
136  sizeMap[DID_GPS_BASE_RAW] = sizeof(gps_raw_t);
137  sizeMap[DID_STROBE_IN_TIME] = sizeof(strobe_in_time_t);
138  sizeMap[DID_RTOS_INFO] = sizeof(rtos_info_t);
139  sizeMap[DID_DUAL_IMU_RAW_MAG] = sizeof(imu_mag_t);
140  sizeMap[DID_CAN_CONFIG] = sizeof(can_config_t);
141 
142 
143 #ifdef USE_IS_INTERNAL
144 
145  sizeMap[DID_SENSORS_IS1] = sizeof(sensors_w_temp_t);
146  sizeMap[DID_SENSORS_IS2] = sizeof(sensors_w_temp_t);
147  sizeMap[DID_SENSORS_TC_BIAS] = sizeof(sensors_t);
148  sizeMap[DID_SCOMP] = sizeof(sensor_compensation_t);
149  sizeMap[DID_DEBUG_ARRAY] = sizeof(debug_array_t);
150  sizeMap[DID_RTK_DEBUG] = sizeof(rtk_debug_t);
151 // sizeMap[DID_RTK_STATE] = sizeof(rtk_state_t);
152  sizeMap[DID_RTK_CODE_RESIDUAL] = sizeof(rtk_residual_t);
153  sizeMap[DID_RTK_PHASE_RESIDUAL] = sizeof(rtk_residual_t);
154  sizeMap[DID_NVR_USERPAGE_G0] = sizeof(nvm_group_0_t);
155  sizeMap[DID_NVR_USERPAGE_G1] = sizeof(nvm_group_1_t);
156  sizeMap[DID_INL2_STATES] = sizeof(inl2_states_t);
157  sizeMap[DID_INL2_STATUS] = sizeof(inl2_status_t);
158  sizeMap[DID_INL2_MISC] = sizeof(inl2_misc_t);
159  sizeMap[DID_INL2_MAG_OBS_INFO] = sizeof(inl2_mag_obs_info_t);
160  sizeMap[DID_DUAL_IMU_MAG] = sizeof(imu_mag_t);
161  sizeMap[DID_PREINTEGRATED_IMU_MAG] = sizeof(pimu_mag_t);
162  sizeMap[DID_SENSORS_ADC] = sizeof(sys_sensors_adc_t);
163  sizeMap[DID_RTK_DEBUG_2] = sizeof(rtk_debug_2_t);
164 
165 #endif
166 
167 }
168 
169 static void PopulateTimestampField(uint32_t id, const data_info_t** timestamps, map_name_to_info_t mappings[DID_COUNT])
170 {
171  static const string timestampFields[] = { "time", "timeOfWeek", "timeOfWeekMs", "seconds" };
172  const map_name_to_info_t& offsetMap = mappings[id];
173 
174  if (offsetMap.size() != 0)
175  {
176  for (size_t i = 0; i < _ARRAY_ELEMENT_COUNT(timestampFields); i++)
177  {
178  map_name_to_info_t::const_iterator timestampField = offsetMap.find(timestampFields[i]);
179  if (timestampField != offsetMap.end())
180  {
181  timestamps[id] = (const data_info_t*)&timestampField->second;
182  return;
183  }
184  }
185  }
186 
187  timestamps[id] = NULLPTR; // ensure value is not garbage
188 }
189 
191 {
192  typedef dev_info_t MAP_TYPE;
193  map_name_to_info_t& m = mappings[DID_DEV_INFO];
194  uint32_t totalSize = 0;
195  ADD_MAP(m, totalSize, "reserved", reserved, 0, DataTypeUInt32, uint32_t);
196  ADD_MAP(m, totalSize, "serialNumber", serialNumber, 0, DataTypeUInt32, uint32_t);
197  ADD_MAP(m, totalSize, "hardwareVer[0]", hardwareVer[0], 0, DataTypeUInt8, uint8_t&);
198  ADD_MAP(m, totalSize, "hardwareVer[1]", hardwareVer[1], 0, DataTypeUInt8, uint8_t&);
199  ADD_MAP(m, totalSize, "hardwareVer[2]", hardwareVer[2], 0, DataTypeUInt8, uint8_t&);
200  ADD_MAP(m, totalSize, "hardwareVer[3]", hardwareVer[3], 0, DataTypeUInt8, uint8_t&);
201  ADD_MAP(m, totalSize, "firmwareVer[0]", firmwareVer[0], 0, DataTypeUInt8, uint8_t&);
202  ADD_MAP(m, totalSize, "firmwareVer[1]", firmwareVer[1], 0, DataTypeUInt8, uint8_t&);
203  ADD_MAP(m, totalSize, "firmwareVer[2]", firmwareVer[2], 0, DataTypeUInt8, uint8_t&);
204  ADD_MAP(m, totalSize, "firmwareVer[3]", firmwareVer[3], 0, DataTypeUInt8, uint8_t&);
205  ADD_MAP(m, totalSize, "buildNumber", buildNumber, 0, DataTypeUInt32, uint32_t);
206  ADD_MAP(m, totalSize, "protocolVer[0]", protocolVer[0], 0, DataTypeUInt8, uint8_t&);
207  ADD_MAP(m, totalSize, "protocolVer[1]", protocolVer[1], 0, DataTypeUInt8, uint8_t&);
208  ADD_MAP(m, totalSize, "protocolVer[2]", protocolVer[2], 0, DataTypeUInt8, uint8_t&);
209  ADD_MAP(m, totalSize, "protocolVer[3]", protocolVer[3], 0, DataTypeUInt8, uint8_t&);
210  ADD_MAP(m, totalSize, "repoRevision", repoRevision, 0, DataTypeUInt32, uint32_t);
211  ADD_MAP(m, totalSize, "manufacturer", manufacturer, DEVINFO_MANUFACTURER_STRLEN, DataTypeString, char[DEVINFO_MANUFACTURER_STRLEN]);
212  ADD_MAP(m, totalSize, "buildDate[0]", buildDate[0], 0, DataTypeUInt8, uint8_t&);
213  ADD_MAP(m, totalSize, "buildDate[1]", buildDate[1], 0, DataTypeUInt8, uint8_t&);
214  ADD_MAP(m, totalSize, "buildDate[2]", buildDate[2], 0, DataTypeUInt8, uint8_t&);
215  ADD_MAP(m, totalSize, "buildDate[3]", buildDate[3], 0, DataTypeUInt8, uint8_t&);
216  ADD_MAP(m, totalSize, "buildTime[0]", buildTime[0], 0, DataTypeUInt8, uint8_t&);
217  ADD_MAP(m, totalSize, "buildTime[1]", buildTime[1], 0, DataTypeUInt8, uint8_t&);
218  ADD_MAP(m, totalSize, "buildTime[2]", buildTime[2], 0, DataTypeUInt8, uint8_t&);
219  ADD_MAP(m, totalSize, "buildTime[3]", buildTime[3], 0, DataTypeUInt8, uint8_t&);
220  ADD_MAP(m, totalSize, "addInfo", addInfo, DEVINFO_ADDINFO_STRLEN, DataTypeString, char[DEVINFO_ADDINFO_STRLEN]);
221 
222  ASSERT_SIZE(totalSize);
223 }
224 
225 static void PopulateIMUMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t dataId)
226 {
227  typedef dual_imu_t MAP_TYPE;
228  map_name_to_info_t& m = mappings[dataId];
229  uint32_t totalSize = 0;
230  ADD_MAP(m, totalSize, "time", time, 0, DataTypeDouble, double);
231  ADD_MAP(m, totalSize, "pqr1[0]", I[0].pqr[0], 0, DataTypeFloat, float&);
232  ADD_MAP(m, totalSize, "pqr1[1]", I[0].pqr[1], 0, DataTypeFloat, float&);
233  ADD_MAP(m, totalSize, "pqr1[2]", I[0].pqr[2], 0, DataTypeFloat, float&);
234  ADD_MAP(m, totalSize, "acc1[0]", I[0].acc[0], 0, DataTypeFloat, float&);
235  ADD_MAP(m, totalSize, "acc1[1]", I[0].acc[1], 0, DataTypeFloat, float&);
236  ADD_MAP(m, totalSize, "acc1[2]", I[0].acc[2], 0, DataTypeFloat, float&);
237  ADD_MAP(m, totalSize, "pqr2[0]", I[1].pqr[0], 0, DataTypeFloat, float&);
238  ADD_MAP(m, totalSize, "pqr2[1]", I[1].pqr[1], 0, DataTypeFloat, float&);
239  ADD_MAP(m, totalSize, "pqr2[2]", I[1].pqr[2], 0, DataTypeFloat, float&);
240  ADD_MAP(m, totalSize, "acc2[0]", I[1].acc[0], 0, DataTypeFloat, float&);
241  ADD_MAP(m, totalSize, "acc2[1]", I[1].acc[1], 0, DataTypeFloat, float&);
242  ADD_MAP(m, totalSize, "acc2[2]", I[1].acc[2], 0, DataTypeFloat, float&);
243  ADD_MAP(m, totalSize, "status", status, 0, DataTypeUInt32, uint32_t);
244 
245  ASSERT_SIZE(totalSize);
246 }
247 
249 {
250  typedef sys_params_t MAP_TYPE;
251  map_name_to_info_t& m = mappings[DID_SYS_PARAMS];
252  uint32_t totalSize = 0;
253  ADD_MAP(m, totalSize, "timeOfWeekMs", timeOfWeekMs, 0, DataTypeUInt32, uint32_t);
254  ADD_MAP(m, totalSize, "insStatus", insStatus, 0, DataTypeUInt32, uint32_t);
255  ADD_MAP(m, totalSize, "hdwStatus", hdwStatus, 0, DataTypeUInt32, uint32_t);
256  ADD_MAP(m, totalSize, "imuTemp", imuTemp, 0, DataTypeFloat, float);
257  ADD_MAP(m, totalSize, "baroTemp", baroTemp, 0, DataTypeFloat, float);
258  ADD_MAP(m, totalSize, "mcuTemp", mcuTemp, 0, DataTypeFloat, float);
259  ADD_MAP(m, totalSize, "reserved1", reserved1, 0, DataTypeFloat, float);
260  ADD_MAP(m, totalSize, "imuPeriodMs", imuPeriodMs, 0, DataTypeUInt32, uint32_t);
261  ADD_MAP(m, totalSize, "navPeriodMs", navPeriodMs, 0, DataTypeUInt32, uint32_t);
262  ADD_MAP(m, totalSize, "sensorTruePeriod", sensorTruePeriod, 0, DataTypeDouble, double);
263  ADD_MAP(m, totalSize, "reserved2[0]", reserved2[0], 0, DataTypeFloat, float&);
264  ADD_MAP(m, totalSize, "reserved2[1]", reserved2[1], 0, DataTypeFloat, float&);
265  ADD_MAP(m, totalSize, "genFaultCode", genFaultCode, 0, DataTypeUInt32, uint32_t);
266 
267  ASSERT_SIZE(totalSize);
268 }
269 
271 {
272  typedef sys_sensors_t MAP_TYPE;
273  map_name_to_info_t& m = mappings[DID_SYS_SENSORS];
274  uint32_t totalSize = 0;
275  ADD_MAP(m, totalSize, "time", time, 0, DataTypeDouble, double);
276  ADD_MAP(m, totalSize, "temp", temp, 0, DataTypeFloat, float);
277  ADD_MAP(m, totalSize, "pqr[0]", pqr[0], 0, DataTypeFloat, float&);
278  ADD_MAP(m, totalSize, "pqr[1]", pqr[1], 0, DataTypeFloat, float&);
279  ADD_MAP(m, totalSize, "pqr[2]", pqr[2], 0, DataTypeFloat, float&);
280  ADD_MAP(m, totalSize, "acc[0]", acc[0], 0, DataTypeFloat, float&);
281  ADD_MAP(m, totalSize, "acc[1]", acc[1], 0, DataTypeFloat, float&);
282  ADD_MAP(m, totalSize, "acc[2]", acc[2], 0, DataTypeFloat, float&);
283  ADD_MAP(m, totalSize, "mag[0]", mag[0], 0, DataTypeFloat, float&);
284  ADD_MAP(m, totalSize, "mag[1]", mag[1], 0, DataTypeFloat, float&);
285  ADD_MAP(m, totalSize, "mag[2]", mag[2], 0, DataTypeFloat, float&);
286  ADD_MAP(m, totalSize, "bar", bar, 0, DataTypeFloat, float);
287  ADD_MAP(m, totalSize, "barTemp", barTemp, 0, DataTypeFloat, float);
288  ADD_MAP(m, totalSize, "mslBar", mslBar, 0, DataTypeFloat, float);
289  ADD_MAP(m, totalSize, "humidity", humidity, 0, DataTypeFloat, float);
290  ADD_MAP(m, totalSize, "vin", vin, 0, DataTypeFloat, float);
291  ADD_MAP(m, totalSize, "ana1", ana1, 0, DataTypeFloat, float);
292  ADD_MAP(m, totalSize, "ana3", ana1, 0, DataTypeFloat, float);
293  ADD_MAP(m, totalSize, "ana4", ana1, 0, DataTypeFloat, float);
294 
295  ASSERT_SIZE(totalSize);
296 }
297 
299 {
300  typedef ins_1_t MAP_TYPE;
301  map_name_to_info_t& m = mappings[DID_INS_1];
302  uint32_t totalSize = 0;
303  ADD_MAP(m, totalSize, "week", week, 0, DataTypeUInt32, uint32_t);
304  ADD_MAP(m, totalSize, "timeOfWeek", timeOfWeek, 0, DataTypeDouble, double);
305  ADD_MAP(m, totalSize, "insStatus", insStatus, 0, DataTypeUInt32, uint32_t);
306  ADD_MAP(m, totalSize, "hdwStatus", hdwStatus, 0, DataTypeUInt32, uint32_t);
307  ADD_MAP(m, totalSize, "theta[0]", theta[0], 0, DataTypeFloat, float&);
308  ADD_MAP(m, totalSize, "theta[1]", theta[1], 0, DataTypeFloat, float&);
309  ADD_MAP(m, totalSize, "theta[2]", theta[2], 0, DataTypeFloat, float&);
310  ADD_MAP(m, totalSize, "uvw[0]", uvw[0], 0, DataTypeFloat, float&);
311  ADD_MAP(m, totalSize, "uvw[1]", uvw[1], 0, DataTypeFloat, float&);
312  ADD_MAP(m, totalSize, "uvw[2]", uvw[2], 0, DataTypeFloat, float&);
313  ADD_MAP(m, totalSize, "lla[0]", lla[0], 0, DataTypeDouble, double&);
314  ADD_MAP(m, totalSize, "lla[1]", lla[1], 0, DataTypeDouble, double&);
315  ADD_MAP(m, totalSize, "lla[2]", lla[2], 0, DataTypeDouble, double&);
316  ADD_MAP(m, totalSize, "ned[0]", ned[0], 0, DataTypeFloat, float&);
317  ADD_MAP(m, totalSize, "ned[1]", ned[1], 0, DataTypeFloat, float&);
318  ADD_MAP(m, totalSize, "ned[2]", ned[2], 0, DataTypeFloat, float&);
319 
320  ASSERT_SIZE(totalSize);
321 }
322 
323 static void PopulateINS2Mappings(map_name_to_info_t mappings[DID_COUNT], uint32_t did)
324 {
325  typedef ins_2_t MAP_TYPE;
326  map_name_to_info_t& m = mappings[did];
327  uint32_t totalSize = 0;
328  ADD_MAP(m, totalSize, "week", week, 0, DataTypeUInt32, uint32_t);
329  ADD_MAP(m, totalSize, "timeOfWeek", timeOfWeek, 0, DataTypeDouble, double);
330  ADD_MAP(m, totalSize, "insStatus", insStatus, 0, DataTypeUInt32, uint32_t);
331  ADD_MAP(m, totalSize, "hdwStatus", hdwStatus, 0, DataTypeUInt32, uint32_t);
332  ADD_MAP(m, totalSize, "qn2b[0]", qn2b[0], 0, DataTypeFloat, float&);
333  ADD_MAP(m, totalSize, "qn2b[1]", qn2b[1], 0, DataTypeFloat, float&);
334  ADD_MAP(m, totalSize, "qn2b[2]", qn2b[2], 0, DataTypeFloat, float&);
335  ADD_MAP(m, totalSize, "qn2b[3]", qn2b[3], 0, DataTypeFloat, float&);
336  ADD_MAP(m, totalSize, "uvw[0]", uvw[0], 0, DataTypeFloat, float&);
337  ADD_MAP(m, totalSize, "uvw[1]", uvw[1], 0, DataTypeFloat, float&);
338  ADD_MAP(m, totalSize, "uvw[2]", uvw[2], 0, DataTypeFloat, float&);
339  ADD_MAP(m, totalSize, "lla[0]", lla[0], 0, DataTypeDouble, double&);
340  ADD_MAP(m, totalSize, "lla[1]", lla[1], 0, DataTypeDouble, double&);
341  ADD_MAP(m, totalSize, "lla[2]", lla[2], 0, DataTypeDouble, double&);
342 
343  ASSERT_SIZE(totalSize);
344 }
345 
347 {
348  typedef ins_4_t MAP_TYPE;
349  map_name_to_info_t& m = mappings[DID_INS_4];
350  uint32_t totalSize = 0;
351  ADD_MAP(m, totalSize, "week", week, 0, DataTypeUInt32, uint32_t);
352  ADD_MAP(m, totalSize, "timeOfWeek", timeOfWeek, 0, DataTypeDouble, double);
353  ADD_MAP(m, totalSize, "insStatus", insStatus, 0, DataTypeUInt32, uint32_t);
354  ADD_MAP(m, totalSize, "hdwStatus", hdwStatus, 0, DataTypeUInt32, uint32_t);
355  ADD_MAP(m, totalSize, "qe2b[0]", qe2b[0], 0, DataTypeFloat, float&);
356  ADD_MAP(m, totalSize, "qe2b[1]", qe2b[1], 0, DataTypeFloat, float&);
357  ADD_MAP(m, totalSize, "qe2b[2]", qe2b[2], 0, DataTypeFloat, float&);
358  ADD_MAP(m, totalSize, "qe2b[3]", qe2b[3], 0, DataTypeFloat, float&);
359  ADD_MAP(m, totalSize, "ve[0]", ve[0], 0, DataTypeFloat, float&);
360  ADD_MAP(m, totalSize, "ve[1]", ve[1], 0, DataTypeFloat, float&);
361  ADD_MAP(m, totalSize, "ve[2]", ve[2], 0, DataTypeFloat, float&);
362  ADD_MAP(m, totalSize, "ecef[0]", ecef[0], 0, DataTypeDouble, double&);
363  ADD_MAP(m, totalSize, "ecef[1]", ecef[1], 0, DataTypeDouble, double&);
364  ADD_MAP(m, totalSize, "ecef[2]", ecef[2], 0, DataTypeDouble, double&);
365 
366  ASSERT_SIZE(totalSize);
367 }
368 
369 static void PopulateGpsPosMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
370 {
371  typedef gps_pos_t MAP_TYPE;
372  map_name_to_info_t& m = mappings[id];
373  uint32_t totalSize = 0;
374  ADD_MAP(m, totalSize, "week", week, 0, DataTypeUInt32, uint32_t);
375  ADD_MAP(m, totalSize, "timeOfWeekMs", timeOfWeekMs, 0, DataTypeUInt32, uint32_t);
376  ADD_MAP(m, totalSize, "status", status, 0, DataTypeUInt32, uint32_t);
377  ADD_MAP(m, totalSize, "ecef[0]", ecef[0], 0, DataTypeDouble, double&);
378  ADD_MAP(m, totalSize, "ecef[1]", ecef[1], 0, DataTypeDouble, double&);
379  ADD_MAP(m, totalSize, "ecef[2]", ecef[2], 0, DataTypeDouble, double&);
380  ADD_MAP(m, totalSize, "lla[0]", lla[0], 0, DataTypeDouble, double&);
381  ADD_MAP(m, totalSize, "lla[1]", lla[1], 0, DataTypeDouble, double&);
382  ADD_MAP(m, totalSize, "lla[2]", lla[2], 0, DataTypeDouble, double&);
383  ADD_MAP(m, totalSize, "hMSL", hMSL, 0, DataTypeFloat, float);
384  ADD_MAP(m, totalSize, "hAcc", hAcc, 0, DataTypeFloat, float);
385  ADD_MAP(m, totalSize, "vAcc", vAcc, 0, DataTypeFloat, float);
386  ADD_MAP(m, totalSize, "pDop", pDop, 0, DataTypeFloat, float);
387  ADD_MAP(m, totalSize, "cnoMean", cnoMean, 0, DataTypeFloat, float);
388  ADD_MAP(m, totalSize, "towOffset", towOffset, 0, DataTypeDouble, double);
389  ADD_MAP(m, totalSize, "leapS", leapS, 0, DataTypeUInt8, uint8_t);
390  ADD_MAP(m, totalSize, "reserved[0]", reserved[0], 0, DataTypeUInt8, uint8_t&);
391  ADD_MAP(m, totalSize, "reserved[1]", reserved[1], 0, DataTypeUInt8, uint8_t&);
392  ADD_MAP(m, totalSize, "reserved[2]", reserved[2], 0, DataTypeUInt8, uint8_t&);
393 
394  ASSERT_SIZE(totalSize);
395 }
396 
397 static void PopulateGpsVelMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
398 {
399  typedef gps_vel_t MAP_TYPE;
400  map_name_to_info_t& m = mappings[id];
401  uint32_t totalSize = 0;
402  ADD_MAP(m, totalSize, "timeOfWeekMs", timeOfWeekMs, 0, DataTypeUInt32, uint32_t);
403  ADD_MAP(m, totalSize, "vel[0]", vel[0], 0, DataTypeFloat, float&);
404  ADD_MAP(m, totalSize, "vel[1]", vel[1], 0, DataTypeFloat, float&);
405  ADD_MAP(m, totalSize, "vel[2]", vel[2], 0, DataTypeFloat, float&);
406  ADD_MAP(m, totalSize, "sAcc", sAcc, 0, DataTypeFloat, float);
407  ADD_MAP(m, totalSize, "status", status, 0, DataTypeUInt32, uint32_t);
408 
409  ASSERT_SIZE(totalSize);
410 }
411 
412 static void PopulateGPSCNOMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
413 {
414  typedef gps_sat_t MAP_TYPE;
415  map_name_to_info_t& m = mappings[id];
416  uint32_t totalSize = 0;
417  ADD_MAP(m, totalSize, "timeOfWeekMs", timeOfWeekMs, 0, DataTypeUInt32, uint32_t);
418  ADD_MAP(m, totalSize, "numSats", numSats, 0, DataTypeUInt32, uint32_t);
419  ADD_MAP(m, totalSize, "svId[0]", sat[0].svId, 0, DataTypeUInt8, uint8_t);
420  ADD_MAP(m, totalSize, "svId[1]", sat[1].svId, 0, DataTypeUInt8, uint8_t);
421  ADD_MAP(m, totalSize, "svId[2]", sat[2].svId, 0, DataTypeUInt8, uint8_t);
422  ADD_MAP(m, totalSize, "svId[3]", sat[3].svId, 0, DataTypeUInt8, uint8_t);
423  ADD_MAP(m, totalSize, "svId[4]", sat[4].svId, 0, DataTypeUInt8, uint8_t);
424  ADD_MAP(m, totalSize, "svId[5]", sat[5].svId, 0, DataTypeUInt8, uint8_t);
425  ADD_MAP(m, totalSize, "svId[6]", sat[6].svId, 0, DataTypeUInt8, uint8_t);
426  ADD_MAP(m, totalSize, "svId[7]", sat[7].svId, 0, DataTypeUInt8, uint8_t);
427  ADD_MAP(m, totalSize, "svId[8]", sat[8].svId, 0, DataTypeUInt8, uint8_t);
428  ADD_MAP(m, totalSize, "svId[9]", sat[9].svId, 0, DataTypeUInt8, uint8_t);
429  ADD_MAP(m, totalSize, "svId[10]", sat[10].svId, 0, DataTypeUInt8, uint8_t);
430  ADD_MAP(m, totalSize, "svId[11]", sat[11].svId, 0, DataTypeUInt8, uint8_t);
431  ADD_MAP(m, totalSize, "svId[12]", sat[12].svId, 0, DataTypeUInt8, uint8_t);
432  ADD_MAP(m, totalSize, "svId[13]", sat[13].svId, 0, DataTypeUInt8, uint8_t);
433  ADD_MAP(m, totalSize, "svId[14]", sat[14].svId, 0, DataTypeUInt8, uint8_t);
434  ADD_MAP(m, totalSize, "svId[15]", sat[15].svId, 0, DataTypeUInt8, uint8_t);
435  ADD_MAP(m, totalSize, "svId[16]", sat[16].svId, 0, DataTypeUInt8, uint8_t);
436  ADD_MAP(m, totalSize, "svId[17]", sat[17].svId, 0, DataTypeUInt8, uint8_t);
437  ADD_MAP(m, totalSize, "svId[18]", sat[18].svId, 0, DataTypeUInt8, uint8_t);
438  ADD_MAP(m, totalSize, "svId[19]", sat[19].svId, 0, DataTypeUInt8, uint8_t);
439  ADD_MAP(m, totalSize, "svId[20]", sat[20].svId, 0, DataTypeUInt8, uint8_t);
440  ADD_MAP(m, totalSize, "svId[21]", sat[21].svId, 0, DataTypeUInt8, uint8_t);
441  ADD_MAP(m, totalSize, "svId[22]", sat[22].svId, 0, DataTypeUInt8, uint8_t);
442  ADD_MAP(m, totalSize, "svId[23]", sat[23].svId, 0, DataTypeUInt8, uint8_t);
443  ADD_MAP(m, totalSize, "svId[24]", sat[24].svId, 0, DataTypeUInt8, uint8_t);
444  ADD_MAP(m, totalSize, "svId[25]", sat[25].svId, 0, DataTypeUInt8, uint8_t);
445  ADD_MAP(m, totalSize, "svId[26]", sat[26].svId, 0, DataTypeUInt8, uint8_t);
446  ADD_MAP(m, totalSize, "svId[27]", sat[27].svId, 0, DataTypeUInt8, uint8_t);
447  ADD_MAP(m, totalSize, "svId[28]", sat[28].svId, 0, DataTypeUInt8, uint8_t);
448  ADD_MAP(m, totalSize, "svId[29]", sat[29].svId, 0, DataTypeUInt8, uint8_t);
449  ADD_MAP(m, totalSize, "svId[30]", sat[30].svId, 0, DataTypeUInt8, uint8_t);
450  ADD_MAP(m, totalSize, "svId[31]", sat[31].svId, 0, DataTypeUInt8, uint8_t);
451  ADD_MAP(m, totalSize, "svId[32]", sat[32].svId, 0, DataTypeUInt8, uint8_t);
452  ADD_MAP(m, totalSize, "svId[33]", sat[33].svId, 0, DataTypeUInt8, uint8_t);
453  ADD_MAP(m, totalSize, "svId[34]", sat[34].svId, 0, DataTypeUInt8, uint8_t);
454  ADD_MAP(m, totalSize, "svId[35]", sat[35].svId, 0, DataTypeUInt8, uint8_t);
455  ADD_MAP(m, totalSize, "svId[36]", sat[36].svId, 0, DataTypeUInt8, uint8_t);
456  ADD_MAP(m, totalSize, "svId[37]", sat[37].svId, 0, DataTypeUInt8, uint8_t);
457  ADD_MAP(m, totalSize, "svId[38]", sat[38].svId, 0, DataTypeUInt8, uint8_t);
458  ADD_MAP(m, totalSize, "svId[39]", sat[39].svId, 0, DataTypeUInt8, uint8_t);
459  ADD_MAP(m, totalSize, "svId[40]", sat[40].svId, 0, DataTypeUInt8, uint8_t);
460  ADD_MAP(m, totalSize, "svId[41]", sat[41].svId, 0, DataTypeUInt8, uint8_t);
461  ADD_MAP(m, totalSize, "svId[42]", sat[42].svId, 0, DataTypeUInt8, uint8_t);
462  ADD_MAP(m, totalSize, "svId[43]", sat[43].svId, 0, DataTypeUInt8, uint8_t);
463  ADD_MAP(m, totalSize, "svId[44]", sat[44].svId, 0, DataTypeUInt8, uint8_t);
464  ADD_MAP(m, totalSize, "svId[45]", sat[45].svId, 0, DataTypeUInt8, uint8_t);
465  ADD_MAP(m, totalSize, "svId[46]", sat[46].svId, 0, DataTypeUInt8, uint8_t);
466  ADD_MAP(m, totalSize, "svId[47]", sat[47].svId, 0, DataTypeUInt8, uint8_t);
467  ADD_MAP(m, totalSize, "svId[48]", sat[48].svId, 0, DataTypeUInt8, uint8_t);
468  ADD_MAP(m, totalSize, "svId[49]", sat[49].svId, 0, DataTypeUInt8, uint8_t);
469  ADD_MAP(m, totalSize, "cno[0]", sat[0].cno, 0, DataTypeUInt8, uint8_t);
470  ADD_MAP(m, totalSize, "cno[1]", sat[1].cno, 0, DataTypeUInt8, uint8_t);
471  ADD_MAP(m, totalSize, "cno[2]", sat[2].cno, 0, DataTypeUInt8, uint8_t);
472  ADD_MAP(m, totalSize, "cno[3]", sat[3].cno, 0, DataTypeUInt8, uint8_t);
473  ADD_MAP(m, totalSize, "cno[4]", sat[4].cno, 0, DataTypeUInt8, uint8_t);
474  ADD_MAP(m, totalSize, "cno[5]", sat[5].cno, 0, DataTypeUInt8, uint8_t);
475  ADD_MAP(m, totalSize, "cno[6]", sat[6].cno, 0, DataTypeUInt8, uint8_t);
476  ADD_MAP(m, totalSize, "cno[7]", sat[7].cno, 0, DataTypeUInt8, uint8_t);
477  ADD_MAP(m, totalSize, "cno[8]", sat[8].cno, 0, DataTypeUInt8, uint8_t);
478  ADD_MAP(m, totalSize, "cno[9]", sat[9].cno, 0, DataTypeUInt8, uint8_t);
479  ADD_MAP(m, totalSize, "cno[10]", sat[10].cno, 0, DataTypeUInt8, uint8_t);
480  ADD_MAP(m, totalSize, "cno[11]", sat[11].cno, 0, DataTypeUInt8, uint8_t);
481  ADD_MAP(m, totalSize, "cno[12]", sat[12].cno, 0, DataTypeUInt8, uint8_t);
482  ADD_MAP(m, totalSize, "cno[13]", sat[13].cno, 0, DataTypeUInt8, uint8_t);
483  ADD_MAP(m, totalSize, "cno[14]", sat[14].cno, 0, DataTypeUInt8, uint8_t);
484  ADD_MAP(m, totalSize, "cno[15]", sat[15].cno, 0, DataTypeUInt8, uint8_t);
485  ADD_MAP(m, totalSize, "cno[16]", sat[16].cno, 0, DataTypeUInt8, uint8_t);
486  ADD_MAP(m, totalSize, "cno[17]", sat[17].cno, 0, DataTypeUInt8, uint8_t);
487  ADD_MAP(m, totalSize, "cno[18]", sat[18].cno, 0, DataTypeUInt8, uint8_t);
488  ADD_MAP(m, totalSize, "cno[19]", sat[19].cno, 0, DataTypeUInt8, uint8_t);
489  ADD_MAP(m, totalSize, "cno[20]", sat[20].cno, 0, DataTypeUInt8, uint8_t);
490  ADD_MAP(m, totalSize, "cno[21]", sat[21].cno, 0, DataTypeUInt8, uint8_t);
491  ADD_MAP(m, totalSize, "cno[22]", sat[22].cno, 0, DataTypeUInt8, uint8_t);
492  ADD_MAP(m, totalSize, "cno[23]", sat[23].cno, 0, DataTypeUInt8, uint8_t);
493  ADD_MAP(m, totalSize, "cno[24]", sat[24].cno, 0, DataTypeUInt8, uint8_t);
494  ADD_MAP(m, totalSize, "cno[25]", sat[25].cno, 0, DataTypeUInt8, uint8_t);
495  ADD_MAP(m, totalSize, "cno[26]", sat[26].cno, 0, DataTypeUInt8, uint8_t);
496  ADD_MAP(m, totalSize, "cno[27]", sat[27].cno, 0, DataTypeUInt8, uint8_t);
497  ADD_MAP(m, totalSize, "cno[28]", sat[28].cno, 0, DataTypeUInt8, uint8_t);
498  ADD_MAP(m, totalSize, "cno[29]", sat[29].cno, 0, DataTypeUInt8, uint8_t);
499  ADD_MAP(m, totalSize, "cno[30]", sat[30].cno, 0, DataTypeUInt8, uint8_t);
500  ADD_MAP(m, totalSize, "cno[31]", sat[31].cno, 0, DataTypeUInt8, uint8_t);
501  ADD_MAP(m, totalSize, "cno[32]", sat[32].cno, 0, DataTypeUInt8, uint8_t);
502  ADD_MAP(m, totalSize, "cno[33]", sat[33].cno, 0, DataTypeUInt8, uint8_t);
503  ADD_MAP(m, totalSize, "cno[34]", sat[34].cno, 0, DataTypeUInt8, uint8_t);
504  ADD_MAP(m, totalSize, "cno[35]", sat[35].cno, 0, DataTypeUInt8, uint8_t);
505  ADD_MAP(m, totalSize, "cno[36]", sat[36].cno, 0, DataTypeUInt8, uint8_t);
506  ADD_MAP(m, totalSize, "cno[37]", sat[37].cno, 0, DataTypeUInt8, uint8_t);
507  ADD_MAP(m, totalSize, "cno[38]", sat[38].cno, 0, DataTypeUInt8, uint8_t);
508  ADD_MAP(m, totalSize, "cno[39]", sat[39].cno, 0, DataTypeUInt8, uint8_t);
509  ADD_MAP(m, totalSize, "cno[40]", sat[40].cno, 0, DataTypeUInt8, uint8_t);
510  ADD_MAP(m, totalSize, "cno[41]", sat[41].cno, 0, DataTypeUInt8, uint8_t);
511  ADD_MAP(m, totalSize, "cno[42]", sat[42].cno, 0, DataTypeUInt8, uint8_t);
512  ADD_MAP(m, totalSize, "cno[43]", sat[43].cno, 0, DataTypeUInt8, uint8_t);
513  ADD_MAP(m, totalSize, "cno[44]", sat[44].cno, 0, DataTypeUInt8, uint8_t);
514  ADD_MAP(m, totalSize, "cno[45]", sat[45].cno, 0, DataTypeUInt8, uint8_t);
515  ADD_MAP(m, totalSize, "cno[46]", sat[46].cno, 0, DataTypeUInt8, uint8_t);
516  ADD_MAP(m, totalSize, "cno[47]", sat[47].cno, 0, DataTypeUInt8, uint8_t);
517  ADD_MAP(m, totalSize, "cno[48]", sat[48].cno, 0, DataTypeUInt8, uint8_t);
518  ADD_MAP(m, totalSize, "cno[49]", sat[49].cno, 0, DataTypeUInt8, uint8_t);
519 
520  ASSERT_SIZE(totalSize);
521 }
522 
523 static void PopulateMagnetometerMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
524 {
525  typedef magnetometer_t MAP_TYPE;
526  map_name_to_info_t& m = mappings[id];
527  uint32_t totalSize = 0;
528  ADD_MAP(m, totalSize, "time", time, 0, DataTypeDouble, double);
529  ADD_MAP(m, totalSize, "mag[0]", mag[0], 0, DataTypeFloat, float&);
530  ADD_MAP(m, totalSize, "mag[1]", mag[1], 0, DataTypeFloat, float&);
531  ADD_MAP(m, totalSize, "mag[2]", mag[2], 0, DataTypeFloat, float&);
532 
533  ASSERT_SIZE(totalSize);
534 }
535 
537 {
538  typedef barometer_t MAP_TYPE;
539  map_name_to_info_t& m = mappings[DID_BAROMETER];
540  uint32_t totalSize = 0;
541  ADD_MAP(m, totalSize, "time", time, 0, DataTypeDouble, double);
542  ADD_MAP(m, totalSize, "bar", bar, 0, DataTypeFloat, float);
543  ADD_MAP(m, totalSize, "mslBar", mslBar, 0, DataTypeFloat, float);
544  ADD_MAP(m, totalSize, "barTemp", barTemp, 0, DataTypeFloat, float);
545  ADD_MAP(m, totalSize, "humidity", humidity, 0, DataTypeFloat, float);
546 
547  ASSERT_SIZE(totalSize);
548 }
549 
551 {
552  typedef preintegrated_imu_t MAP_TYPE;
554  uint32_t totalSize = 0;
555  ADD_MAP(m, totalSize, "time", time, 0, DataTypeDouble, double);
556  ADD_MAP(m, totalSize, "theta1[0]", theta1[0], 0, DataTypeFloat, float&);
557  ADD_MAP(m, totalSize, "theta1[1]", theta1[1], 0, DataTypeFloat, float&);
558  ADD_MAP(m, totalSize, "theta1[2]", theta1[2], 0, DataTypeFloat, float&);
559  ADD_MAP(m, totalSize, "vel1[0]", vel1[0], 0, DataTypeFloat, float&);
560  ADD_MAP(m, totalSize, "vel1[1]", vel1[1], 0, DataTypeFloat, float&);
561  ADD_MAP(m, totalSize, "vel1[2]", vel1[2], 0, DataTypeFloat, float&);
562  ADD_MAP(m, totalSize, "theta2[0]", theta2[0], 0, DataTypeFloat, float&);
563  ADD_MAP(m, totalSize, "theta2[1]", theta2[1], 0, DataTypeFloat, float&);
564  ADD_MAP(m, totalSize, "theta2[2]", theta2[2], 0, DataTypeFloat, float&);
565  ADD_MAP(m, totalSize, "vel2[0]", vel2[0], 0, DataTypeFloat, float&);
566  ADD_MAP(m, totalSize, "vel2[1]", vel2[1], 0, DataTypeFloat, float&);
567  ADD_MAP(m, totalSize, "vel2[2]", vel2[2], 0, DataTypeFloat, float&);
568  ADD_MAP(m, totalSize, "dt", dt, 0, DataTypeFloat, float);
569  ADD_MAP(m, totalSize, "status", status, 0, DataTypeUInt32, uint32_t);
570 
571  ASSERT_SIZE(totalSize);
572 }
573 
575 {
576  typedef pimu_mag_t MAP_TYPE;
578  uint32_t totalSize = 0;
579  ADD_MAP(m, totalSize, "imutime", pimu.time, 0, DataTypeDouble, double);
580  ADD_MAP(m, totalSize, "theta1[0]", pimu.theta1[0], 0, DataTypeFloat, float&);
581  ADD_MAP(m, totalSize, "theta1[1]", pimu.theta1[1], 0, DataTypeFloat, float&);
582  ADD_MAP(m, totalSize, "theta1[2]", pimu.theta1[2], 0, DataTypeFloat, float&);
583  ADD_MAP(m, totalSize, "vel1[0]", pimu.vel1[0], 0, DataTypeFloat, float&);
584  ADD_MAP(m, totalSize, "vel1[1]", pimu.vel1[1], 0, DataTypeFloat, float&);
585  ADD_MAP(m, totalSize, "vel1[2]", pimu.vel1[2], 0, DataTypeFloat, float&);
586  ADD_MAP(m, totalSize, "theta2[0]", pimu.theta2[0], 0, DataTypeFloat, float&);
587  ADD_MAP(m, totalSize, "theta2[1]", pimu.theta2[1], 0, DataTypeFloat, float&);
588  ADD_MAP(m, totalSize, "theta2[2]", pimu.theta2[2], 0, DataTypeFloat, float&);
589  ADD_MAP(m, totalSize, "vel2[0]", pimu.vel2[0], 0, DataTypeFloat, float&);
590  ADD_MAP(m, totalSize, "vel2[1]", pimu.vel2[1], 0, DataTypeFloat, float&);
591  ADD_MAP(m, totalSize, "vel2[2]", pimu.vel2[2], 0, DataTypeFloat, float&);
592  ADD_MAP(m, totalSize, "dt", pimu.dt, 0, DataTypeFloat, float);
593  ADD_MAP(m, totalSize, "imustatus", pimu.status, 0, DataTypeUInt32, uint32_t);
594  ADD_MAP(m, totalSize, "mag1time", mag1.time, 0, DataTypeDouble, double);
595  ADD_MAP(m, totalSize, "mag1[0]", mag1.mag[0], 0, DataTypeFloat, float&);
596  ADD_MAP(m, totalSize, "mag1[1]", mag1.mag[1], 0, DataTypeFloat, float&);
597  ADD_MAP(m, totalSize, "mag1[2]", mag1.mag[2], 0, DataTypeFloat, float&);
598  ADD_MAP(m, totalSize, "mag2time", mag2.time, 0, DataTypeDouble, double);
599  ADD_MAP(m, totalSize, "mag2[0]", mag2.mag[0], 0, DataTypeFloat, float&);
600  ADD_MAP(m, totalSize, "mag2[1]", mag2.mag[1], 0, DataTypeFloat, float&);
601  ADD_MAP(m, totalSize, "mag2[2]", mag2.mag[2], 0, DataTypeFloat, float&);
602 
603  ASSERT_SIZE(totalSize);
604 }
605 
607 {
608  typedef imu_mag_t MAP_TYPE;
609  map_name_to_info_t& m = mappings[id];
610  uint32_t totalSize = 0;
611  ADD_MAP(m, totalSize, "time", imu.time, 0, DataTypeDouble, double);
612  ADD_MAP(m, totalSize, "pqr1[0]", imu.I[0].pqr[0], 0, DataTypeFloat, float&);
613  ADD_MAP(m, totalSize, "pqr1[1]", imu.I[0].pqr[1], 0, DataTypeFloat, float&);
614  ADD_MAP(m, totalSize, "pqr1[2]", imu.I[0].pqr[2], 0, DataTypeFloat, float&);
615  ADD_MAP(m, totalSize, "acc1[0]", imu.I[0].acc[0], 0, DataTypeFloat, float&);
616  ADD_MAP(m, totalSize, "acc1[1]", imu.I[0].acc[1], 0, DataTypeFloat, float&);
617  ADD_MAP(m, totalSize, "acc1[2]", imu.I[0].acc[2], 0, DataTypeFloat, float&);
618  ADD_MAP(m, totalSize, "pqr2[0]", imu.I[1].pqr[0], 0, DataTypeFloat, float&);
619  ADD_MAP(m, totalSize, "pqr2[1]", imu.I[1].pqr[1], 0, DataTypeFloat, float&);
620  ADD_MAP(m, totalSize, "pqr2[2]", imu.I[1].pqr[2], 0, DataTypeFloat, float&);
621  ADD_MAP(m, totalSize, "acc2[0]", imu.I[1].acc[0], 0, DataTypeFloat, float&);
622  ADD_MAP(m, totalSize, "acc2[1]", imu.I[1].acc[1], 0, DataTypeFloat, float&);
623  ADD_MAP(m, totalSize, "acc2[2]", imu.I[1].acc[2], 0, DataTypeFloat, float&);
624  ADD_MAP(m, totalSize, "imustatus", imu.status, 0, DataTypeUInt32, uint32_t);
625  ADD_MAP(m, totalSize, "mag1time", mag1.time, 0, DataTypeDouble, double);
626  ADD_MAP(m, totalSize, "mag1[0]", mag1.mag[0], 0, DataTypeFloat, float&);
627  ADD_MAP(m, totalSize, "mag1[1]", mag1.mag[1], 0, DataTypeFloat, float&);
628  ADD_MAP(m, totalSize, "mag1[2]", mag1.mag[2], 0, DataTypeFloat, float&);
629  ADD_MAP(m, totalSize, "mag2time", mag2.time, 0, DataTypeDouble, double);
630  ADD_MAP(m, totalSize, "mag2[0]", mag2.mag[0], 0, DataTypeFloat, float&);
631  ADD_MAP(m, totalSize, "mag2[1]", mag2.mag[1], 0, DataTypeFloat, float&);
632  ADD_MAP(m, totalSize, "mag2[2]", mag2.mag[2], 0, DataTypeFloat, float&);
633 
634  ASSERT_SIZE(totalSize);
635 }
636 
638 {
639  typedef wheel_encoder_t MAP_TYPE;
640  map_name_to_info_t& m = mappings[DID_WHEEL_ENCODER];
641  uint32_t totalSize = 0;
642  ADD_MAP(m, totalSize, "timeOfWeek", timeOfWeek, 0, DataTypeDouble, double);
643  ADD_MAP(m, totalSize, "status", status, 0, DataTypeUInt32, uint32_t);
644  ADD_MAP(m, totalSize, "theta_l", theta_l, 0, DataTypeFloat, float);
645  ADD_MAP(m, totalSize, "omega_l", omega_l, 0, DataTypeFloat, float);
646  ADD_MAP(m, totalSize, "theta_r", theta_r, 0, DataTypeFloat, float);
647  ADD_MAP(m, totalSize, "omega_r", omega_r, 0, DataTypeFloat, float);
648  ADD_MAP(m, totalSize, "wrap_count_l", wrap_count_l, 0, DataTypeUInt32, uint32_t);
649  ADD_MAP(m, totalSize, "wrap_count_r", wrap_count_r, 0, DataTypeUInt32, uint32_t);
650 
651  ASSERT_SIZE(totalSize);
652 }
653 
655 {
656  typedef system_command_t MAP_TYPE;
657  map_name_to_info_t& m = mappings[DID_SYS_CMD];
658  uint32_t totalSize = 0;
659  ADD_MAP(m, totalSize, "command", command, 0, DataTypeUInt32, uint32_t);
660  ADD_MAP(m, totalSize, "invCommand", invCommand, 0, DataTypeUInt32, uint32_t);
661 
662  ASSERT_SIZE(totalSize);
663 }
664 
666 {
667  typedef nvm_flash_cfg_t MAP_TYPE;
668  map_name_to_info_t& m = mappings[DID_FLASH_CONFIG];
669  uint32_t totalSize = 0;
670  ADD_MAP(m, totalSize, "size", size, 0, DataTypeUInt32, uint32_t);
671  ADD_MAP(m, totalSize, "checksum", checksum, 0, DataTypeUInt32, uint32_t);
672  ADD_MAP(m, totalSize, "key", key, 0, DataTypeUInt32, uint32_t);
673  ADD_MAP(m, totalSize, "startupImuDtMs", startupImuDtMs, 0, DataTypeUInt32, uint32_t);
674  ADD_MAP(m, totalSize, "startupNavDtMs", startupNavDtMs, 0, DataTypeUInt32, uint32_t);
675  ADD_MAP(m, totalSize, "ser0BaudRate", ser0BaudRate, 0, DataTypeUInt32, uint32_t);
676  ADD_MAP(m, totalSize, "ser1BaudRate", ser1BaudRate, 0, DataTypeUInt32, uint32_t);
677  ADD_MAP(m, totalSize, "insRotation[0]", insRotation[0], 0, DataTypeFloat, float&);
678  ADD_MAP(m, totalSize, "insRotation[1]", insRotation[1], 0, DataTypeFloat, float&);
679  ADD_MAP(m, totalSize, "insRotation[2]", insRotation[2], 0, DataTypeFloat, float&);
680  ADD_MAP(m, totalSize, "insOffset[0]", insOffset[0], 0, DataTypeFloat, float&);
681  ADD_MAP(m, totalSize, "insOffset[1]", insOffset[1], 0, DataTypeFloat, float&);
682  ADD_MAP(m, totalSize, "insOffset[2]", insOffset[2], 0, DataTypeFloat, float&);
683  ADD_MAP(m, totalSize, "gps1AntOffset[0]", gps1AntOffset[0], 0, DataTypeFloat, float&);
684  ADD_MAP(m, totalSize, "gps1AntOffset[1]", gps1AntOffset[1], 0, DataTypeFloat, float&);
685  ADD_MAP(m, totalSize, "gps1AntOffset[2]", gps1AntOffset[2], 0, DataTypeFloat, float&);
686  ADD_MAP(m, totalSize, "insDynModel", insDynModel, 0, DataTypeUInt8, uint8_t);
687  ADD_MAP(m, totalSize, "reserved", reserved, 0, DataTypeUInt8, uint8_t);
688  ADD_MAP(m, totalSize, "gnssSatSigConst", gnssSatSigConst, 0, DataTypeUInt16, uint16_t);
689  ADD_MAP(m, totalSize, "sysCfgBits", sysCfgBits, 0, DataTypeUInt32, uint32_t);
690  ADD_MAP(m, totalSize, "refLla[0]", refLla[0], 0, DataTypeDouble, double&);
691  ADD_MAP(m, totalSize, "refLla[1]", refLla[1], 0, DataTypeDouble, double&);
692  ADD_MAP(m, totalSize, "refLla[2]", refLla[2], 0, DataTypeDouble, double&);
693  ADD_MAP(m, totalSize, "lastLla[0]", lastLla[0], 0, DataTypeDouble, double&);
694  ADD_MAP(m, totalSize, "lastLla[1]", lastLla[1], 0, DataTypeDouble, double&);
695  ADD_MAP(m, totalSize, "lastLla[2]", lastLla[2], 0, DataTypeDouble, double&);
696  ADD_MAP(m, totalSize, "lastLlaTimeOfWeekMs", lastLlaTimeOfWeekMs, 0, DataTypeUInt32, uint32_t);
697  ADD_MAP(m, totalSize, "lastLlaWeek", lastLlaWeek, 0, DataTypeUInt32, uint32_t);
698  ADD_MAP(m, totalSize, "lastLlaUpdateDistance", lastLlaUpdateDistance, 0, DataTypeFloat, float);
699  ADD_MAP(m, totalSize, "ioConfig", ioConfig, 0, DataTypeUInt32, uint32_t);
700  ADD_MAP(m, totalSize, "cBrdConfig", cBrdConfig, 0, DataTypeUInt32, uint32_t);
701  ADD_MAP(m, totalSize, "magInclination", magInclination, 0, DataTypeFloat, float);
702  ADD_MAP(m, totalSize, "magDeclination", magDeclination, 0, DataTypeFloat, float);
703  ADD_MAP(m, totalSize, "gps2AntOffset[0]", gps2AntOffset[0], 0, DataTypeFloat, float&);
704  ADD_MAP(m, totalSize, "gps2AntOffset[1]", gps2AntOffset[1], 0, DataTypeFloat, float&);
705  ADD_MAP(m, totalSize, "gps2AntOffset[2]", gps2AntOffset[2], 0, DataTypeFloat, float&);
706  ADD_MAP(m, totalSize, "zeroVelRotation[0]", zeroVelRotation[0], 0, DataTypeFloat, float&);
707  ADD_MAP(m, totalSize, "zeroVelRotation[1]", zeroVelRotation[1], 0, DataTypeFloat, float&);
708  ADD_MAP(m, totalSize, "zeroVelRotation[2]", zeroVelRotation[2], 0, DataTypeFloat, float&);
709  ADD_MAP(m, totalSize, "zeroVelOffset[0]", zeroVelOffset[0], 0, DataTypeFloat, float&);
710  ADD_MAP(m, totalSize, "zeroVelOffset[1]", zeroVelOffset[1], 0, DataTypeFloat, float&);
711  ADD_MAP(m, totalSize, "zeroVelOffset[2]", zeroVelOffset[2], 0, DataTypeFloat, float&);
712  ADD_MAP(m, totalSize, "gpsTimeSyncPeriodMs", gpsTimeSyncPeriodMs, 0, DataTypeUInt32, uint32_t);
713  ADD_MAP(m, totalSize, "startupGPSDtMs", startupGPSDtMs, 0, DataTypeUInt32, uint32_t);
714  ADD_MAP(m, totalSize, "RTKCfgBits", RTKCfgBits, 0, DataTypeUInt32, uint32_t);
715  ADD_MAP(m, totalSize, "sensorConfig", sensorConfig, 0, DataTypeUInt32, uint32_t);
716  ADD_MAP(m, totalSize, "wheelConfig.bits", wheelConfig.bits, 0, DataTypeUInt32, uint32_t);
717  ADD_MAP(m, totalSize, "wheelConfig.e_i2l[0]", wheelConfig.e_i2l[0], 0, DataTypeFloat, float&);
718  ADD_MAP(m, totalSize, "wheelConfig.e_i2l[1]", wheelConfig.e_i2l[1], 0, DataTypeFloat, float&);
719  ADD_MAP(m, totalSize, "wheelConfig.e_i2l[2]", wheelConfig.e_i2l[2], 0, DataTypeFloat, float&);
720  ADD_MAP(m, totalSize, "wheelConfig.t_i2l[0]", wheelConfig.t_i2l[0], 0, DataTypeFloat, float&);
721  ADD_MAP(m, totalSize, "wheelConfig.t_i2l[1]", wheelConfig.t_i2l[1], 0, DataTypeFloat, float&);
722  ADD_MAP(m, totalSize, "wheelConfig.t_i2l[2]", wheelConfig.t_i2l[2], 0, DataTypeFloat, float&);
723  ADD_MAP(m, totalSize, "wheelConfig.distance", wheelConfig.distance, 0, DataTypeFloat, float);
724  ADD_MAP(m, totalSize, "wheelConfig.diameter", wheelConfig.diameter, 0, DataTypeFloat, float);
725  ADD_MAP(m, totalSize, "gpsMinimumElevation", gpsMinimumElevation, 0, DataTypeFloat, float);
726 
727  ASSERT_SIZE(totalSize);
728 }
729 
731 {
732  typedef gps_rtk_rel_t MAP_TYPE;
734  uint32_t totalSize = 0;
735  ADD_MAP(m, totalSize, "timeOfWeekMs", timeOfWeekMs, 0, DataTypeUInt32, uint32_t);
736  ADD_MAP(m, totalSize, "baseToRoverVector[0]", baseToRoverVector[0], 0, DataTypeFloat, float&);
737  ADD_MAP(m, totalSize, "baseToRoverVector[1]", baseToRoverVector[1], 0, DataTypeFloat, float&);
738  ADD_MAP(m, totalSize, "baseToRoverVector[2]", baseToRoverVector[2], 0, DataTypeFloat, float&);
739  ADD_MAP(m, totalSize, "differentialAge", differentialAge, 0, DataTypeFloat, float);
740  ADD_MAP(m, totalSize, "arRatio", arRatio, 0, DataTypeFloat, float);
741  ADD_MAP(m, totalSize, "baseToRoverDistance", baseToRoverDistance, 0, DataTypeFloat, float);
742  ADD_MAP(m, totalSize, "baseToRoverHeading", baseToRoverHeading, 0, DataTypeFloat, float);
743  ADD_MAP(m, totalSize, "baseToRoverHeadingAcc", baseToRoverHeadingAcc, 0, DataTypeFloat, float);
744  ADD_MAP(m, totalSize, "status", status, 0, DataTypeUInt32, uint32_t);
745 
746  ASSERT_SIZE(totalSize);
747 }
748 
750 {
751  typedef gps_rtk_misc_t MAP_TYPE;
753  uint32_t totalSize = 0;
754  ADD_MAP(m, totalSize, "timeOfWeekMs", timeOfWeekMs, 0, DataTypeUInt32, uint32_t);
755  ADD_MAP(m, totalSize, "accuracyPos[0]", accuracyPos[0], 0, DataTypeFloat, float&);
756  ADD_MAP(m, totalSize, "accuracyPos[1]", accuracyPos[1], 0, DataTypeFloat, float&);
757  ADD_MAP(m, totalSize, "accuracyPos[2]", accuracyPos[2], 0, DataTypeFloat, float&);
758  ADD_MAP(m, totalSize, "accuracyCov[0]", accuracyCov[0], 0, DataTypeFloat, float&);
759  ADD_MAP(m, totalSize, "accuracyCov[1]", accuracyCov[1], 0, DataTypeFloat, float&);
760  ADD_MAP(m, totalSize, "accuracyCov[2]", accuracyCov[2], 0, DataTypeFloat, float&);
761  ADD_MAP(m, totalSize, "arThreshold", arThreshold, 0, DataTypeFloat, float);
762  ADD_MAP(m, totalSize, "gDop", gDop, 0, DataTypeFloat, float);
763  ADD_MAP(m, totalSize, "hDop", hDop, 0, DataTypeFloat, float);
764  ADD_MAP(m, totalSize, "vDop", vDop, 0, DataTypeFloat, float);
765  ADD_MAP(m, totalSize, "baseLla[0]", baseLla[0], 0, DataTypeDouble, double&);
766  ADD_MAP(m, totalSize, "baseLla[1]", baseLla[1], 0, DataTypeDouble, double&);
767  ADD_MAP(m, totalSize, "baseLla[2]", baseLla[2], 0, DataTypeDouble, double&);
768  ADD_MAP(m, totalSize, "cycleSlipCount", cycleSlipCount, 0, DataTypeUInt32, uint32_t);
769  ADD_MAP(m, totalSize, "roverGpsObservationCount", roverGpsObservationCount, 0, DataTypeUInt32, uint32_t);
770  ADD_MAP(m, totalSize, "baseGpsObservationCount", baseGpsObservationCount, 0, DataTypeUInt32, uint32_t);
771  ADD_MAP(m, totalSize, "roverGlonassObservationCount", roverGlonassObservationCount, 0, DataTypeUInt32, uint32_t);
772  ADD_MAP(m, totalSize, "baseGlonassObservationCount", baseGlonassObservationCount, 0, DataTypeUInt32, uint32_t);
773  ADD_MAP(m, totalSize, "roverGalileoObservationCount", roverGalileoObservationCount, 0, DataTypeUInt32, uint32_t);
774  ADD_MAP(m, totalSize, "baseGalileoObservationCount", baseGalileoObservationCount, 0, DataTypeUInt32, uint32_t);
775  ADD_MAP(m, totalSize, "roverBeidouObservationCount", roverBeidouObservationCount, 0, DataTypeUInt32, uint32_t);
776  ADD_MAP(m, totalSize, "baseBeidouObservationCount", baseBeidouObservationCount, 0, DataTypeUInt32, uint32_t);
777  ADD_MAP(m, totalSize, "roverQzsObservationCount", roverQzsObservationCount, 0, DataTypeUInt32, uint32_t);
778  ADD_MAP(m, totalSize, "baseQzsObservationCount", baseQzsObservationCount, 0, DataTypeUInt32, uint32_t);
779  ADD_MAP(m, totalSize, "roverGpsEphemerisCount", roverGpsEphemerisCount, 0, DataTypeUInt32, uint32_t);
780  ADD_MAP(m, totalSize, "baseGpsEphemerisCount", baseGpsEphemerisCount, 0, DataTypeUInt32, uint32_t);
781  ADD_MAP(m, totalSize, "roverGlonassEphemerisCount", roverGlonassEphemerisCount, 0, DataTypeUInt32, uint32_t);
782  ADD_MAP(m, totalSize, "baseGlonassEphemerisCount", baseGlonassEphemerisCount, 0, DataTypeUInt32, uint32_t);
783  ADD_MAP(m, totalSize, "roverGalileoEphemerisCount", roverGalileoEphemerisCount, 0, DataTypeUInt32, uint32_t);
784  ADD_MAP(m, totalSize, "baseGalileoEphemerisCount", baseGalileoEphemerisCount, 0, DataTypeUInt32, uint32_t);
785  ADD_MAP(m, totalSize, "roverBeidouEphemerisCount", roverBeidouEphemerisCount, 0, DataTypeUInt32, uint32_t);
786  ADD_MAP(m, totalSize, "baseBeidouEphemerisCount", baseBeidouEphemerisCount, 0, DataTypeUInt32, uint32_t);
787  ADD_MAP(m, totalSize, "roverQzsEphemerisCount", roverQzsEphemerisCount, 0, DataTypeUInt32, uint32_t);
788  ADD_MAP(m, totalSize, "baseQzsEphemerisCount", baseQzsEphemerisCount, 0, DataTypeUInt32, uint32_t);
789  ADD_MAP(m, totalSize, "roverSbasCount", roverSbasCount, 0, DataTypeUInt32, uint32_t);
790  ADD_MAP(m, totalSize, "baseSbasCount", baseSbasCount, 0, DataTypeUInt32, uint32_t);
791  ADD_MAP(m, totalSize, "baseAntennaCount", baseAntennaCount, 0, DataTypeUInt32, uint32_t);
792  ADD_MAP(m, totalSize, "ionUtcAlmCount", ionUtcAlmCount, 0, DataTypeUInt32, uint32_t);
793  ADD_MAP(m, totalSize, "correctionChecksumFailures", correctionChecksumFailures, 0, DataTypeUInt32, uint32_t);
794  ADD_MAP(m, totalSize, "timeToFirstFixMs", timeToFirstFixMs, 0, DataTypeUInt32, uint32_t);
795 
796  ASSERT_SIZE(totalSize);
797 }
798 
799 static void PopulateGpsRawMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
800 {
801  typedef gps_raw_t MAP_TYPE;
802  map_name_to_info_t& m = mappings[id];
803  uint32_t totalSize = 0;
804 
805  ADD_MAP(m, totalSize, "receiveIndex", receiverIndex, 0, DataTypeUInt8, uint8_t);
806  ADD_MAP(m, totalSize, "dataType", dataType, 0, DataTypeUInt8, uint8_t);
807  ADD_MAP(m, totalSize, "obsCount", obsCount, 0, DataTypeUInt8, uint8_t);
808  ADD_MAP(m, totalSize, "reserved", reserved, 0, DataTypeUInt8, uint8_t);
809  ADD_MAP(m, totalSize, "dataBuf", data.buf, 0, DataTypeBinary, uint8_t[MEMBERSIZE(MAP_TYPE, data.buf)]);
810 
811  ASSERT_SIZE(totalSize);
812 }
813 
815 {
816  typedef strobe_in_time_t MAP_TYPE;
817  map_name_to_info_t& m = mappings[DID_STROBE_IN_TIME];
818  uint32_t totalSize = 0;
819 
820  ADD_MAP(m, totalSize, "week", week, 0, DataTypeUInt32, uint32_t);
821  ADD_MAP(m, totalSize, "timeOfWeekMs", timeOfWeekMs, 0, DataTypeUInt32, uint32_t);
822  ADD_MAP(m, totalSize, "pin", pin, 0, DataTypeUInt32, uint32_t);
823  ADD_MAP(m, totalSize, "count", count, 0, DataTypeUInt32, uint32_t);
824 
825  ASSERT_SIZE(totalSize);
826 }
827 
829 {
830  typedef rtos_info_t MAP_TYPE;
831  map_name_to_info_t& m = mappings[DID_RTOS_INFO];
832  uint32_t totalSize = 0;
833 
834  ADD_MAP(m, totalSize, "name[0]", task[0].name, MAX_TASK_NAME_LEN, DataTypeString, char[MAX_TASK_NAME_LEN]);
835  ADD_MAP(m, totalSize, "priority[0]", task[0].priority, 0, DataTypeUInt32, uint32_t);
836  ADD_MAP(m, totalSize, "stackUnused[0]", task[0].stackUnused, 0, DataTypeUInt32, uint32_t);
837  ADD_MAP(m, totalSize, "periodMs[0]", task[0].periodMs, 0, DataTypeUInt32, uint32_t);
838  ADD_MAP(m, totalSize, "runTimeUs[0]", task[0].runTimeUs, 0, DataTypeUInt32, uint32_t);
839  ADD_MAP(m, totalSize, "maxRunTimeUs[0]", task[0].maxRunTimeUs, 0, DataTypeUInt32, uint32_t);
840  ADD_MAP(m, totalSize, "averageRunTimeUs[0]", task[0].averageRunTimeUs, 0, DataTypeFloat, float);
841  ADD_MAP(m, totalSize, "gapCount[0]", task[0].gapCount, 0, DataTypeUInt32, uint32_t);
842  ADD_MAP(m, totalSize, "cpuUsage[0]", task[0].cpuUsage, 0, DataTypeFloat, f_t);
843  ADD_MAP(m, totalSize, "handle[0]", task[0].handle, 0, DataTypeUInt32, uint32_t);
844 
845  ADD_MAP(m, totalSize, "name[1]", task[1].name, MAX_TASK_NAME_LEN, DataTypeString, char[MAX_TASK_NAME_LEN]);
846  ADD_MAP(m, totalSize, "priority[1]", task[1].priority, 0, DataTypeUInt32, uint32_t);
847  ADD_MAP(m, totalSize, "stackUnused[1]", task[1].stackUnused, 0, DataTypeUInt32, uint32_t);
848  ADD_MAP(m, totalSize, "periodMs[1]", task[1].periodMs, 0, DataTypeUInt32, uint32_t);
849  ADD_MAP(m, totalSize, "runTimeUs[1]", task[1].runTimeUs, 0, DataTypeUInt32, uint32_t);
850  ADD_MAP(m, totalSize, "maxRunTimeUs[1]", task[1].maxRunTimeUs, 0, DataTypeUInt32, uint32_t);
851  ADD_MAP(m, totalSize, "averageRunTimeUs[1]", task[1].averageRunTimeUs, 0, DataTypeFloat, float);
852  ADD_MAP(m, totalSize, "gapCount[1]", task[1].gapCount, 0, DataTypeUInt32, uint32_t);
853  ADD_MAP(m, totalSize, "cpuUsage[1]", task[1].cpuUsage, 0, DataTypeFloat, f_t);
854  ADD_MAP(m, totalSize, "handle[1]", task[1].handle, 0, DataTypeUInt32, uint32_t);
855 
856  ADD_MAP(m, totalSize, "name[2]", task[2].name, MAX_TASK_NAME_LEN, DataTypeString, char[MAX_TASK_NAME_LEN]);
857  ADD_MAP(m, totalSize, "priority[2]", task[2].priority, 0, DataTypeUInt32, uint32_t);
858  ADD_MAP(m, totalSize, "stackUnused[2]", task[2].stackUnused, 0, DataTypeUInt32, uint32_t);
859  ADD_MAP(m, totalSize, "periodMs[2]", task[2].periodMs, 0, DataTypeUInt32, uint32_t);
860  ADD_MAP(m, totalSize, "runTimeUs[2]", task[2].runTimeUs, 0, DataTypeUInt32, uint32_t);
861  ADD_MAP(m, totalSize, "maxRunTimeUs[2]", task[2].maxRunTimeUs, 0, DataTypeUInt32, uint32_t);
862  ADD_MAP(m, totalSize, "averageRunTimeUs[2]", task[2].averageRunTimeUs, 0, DataTypeFloat, float);
863  ADD_MAP(m, totalSize, "gapCount[2]", task[2].gapCount, 0, DataTypeUInt32, uint32_t);
864  ADD_MAP(m, totalSize, "cpuUsage[2]", task[2].cpuUsage, 0, DataTypeFloat, f_t);
865  ADD_MAP(m, totalSize, "handle[2]", task[2].handle, 0, DataTypeUInt32, uint32_t);
866 
867  ADD_MAP(m, totalSize, "name[3]", task[3].name, MAX_TASK_NAME_LEN, DataTypeString, char[MAX_TASK_NAME_LEN]);
868  ADD_MAP(m, totalSize, "priority[3]", task[3].priority, 0, DataTypeUInt32, uint32_t);
869  ADD_MAP(m, totalSize, "stackUnused[3]", task[3].stackUnused, 0, DataTypeUInt32, uint32_t);
870  ADD_MAP(m, totalSize, "periodMs[3]", task[3].periodMs, 0, DataTypeUInt32, uint32_t);
871  ADD_MAP(m, totalSize, "runTimeUs[3]", task[3].runTimeUs, 0, DataTypeUInt32, uint32_t);
872  ADD_MAP(m, totalSize, "maxRunTimeUs[3]", task[3].maxRunTimeUs, 0, DataTypeUInt32, uint32_t);
873  ADD_MAP(m, totalSize, "averageRunTimeUs[3]", task[3].averageRunTimeUs, 0, DataTypeFloat, float);
874  ADD_MAP(m, totalSize, "gapCount[3]", task[3].gapCount, 0, DataTypeUInt32, uint32_t);
875  ADD_MAP(m, totalSize, "cpuUsage[3]", task[3].cpuUsage, 0, DataTypeFloat, f_t);
876  ADD_MAP(m, totalSize, "handle[3]", task[3].handle, 0, DataTypeUInt32, uint32_t);
877 
878  ADD_MAP(m, totalSize, "name[4]", task[4].name, MAX_TASK_NAME_LEN, DataTypeString, char[MAX_TASK_NAME_LEN]);
879  ADD_MAP(m, totalSize, "priority[4]", task[4].priority, 0, DataTypeUInt32, uint32_t);
880  ADD_MAP(m, totalSize, "stackUnused[4]", task[4].stackUnused, 0, DataTypeUInt32, uint32_t);
881  ADD_MAP(m, totalSize, "periodMs[4]", task[4].periodMs, 0, DataTypeUInt32, uint32_t);
882  ADD_MAP(m, totalSize, "runTimeUs[4]", task[4].runTimeUs, 0, DataTypeUInt32, uint32_t);
883  ADD_MAP(m, totalSize, "maxRunTimeUs[4]", task[4].maxRunTimeUs, 0, DataTypeUInt32, uint32_t);
884  ADD_MAP(m, totalSize, "averageRunTimeUs[4]", task[4].averageRunTimeUs, 0, DataTypeFloat, float);
885  ADD_MAP(m, totalSize, "gapCount[4]", task[4].gapCount, 0, DataTypeUInt32, uint32_t);
886  ADD_MAP(m, totalSize, "cpuUsage[4]", task[4].cpuUsage, 0, DataTypeFloat, f_t);
887  ADD_MAP(m, totalSize, "handle[4]", task[4].handle, 0, DataTypeUInt32, uint32_t);
888 
889  ADD_MAP(m, totalSize, "name[5]", task[5].name, MAX_TASK_NAME_LEN, DataTypeString, char[MAX_TASK_NAME_LEN]);
890  ADD_MAP(m, totalSize, "priority[5]", task[5].priority, 0, DataTypeUInt32, uint32_t);
891  ADD_MAP(m, totalSize, "stackUnused[5]", task[5].stackUnused, 0, DataTypeUInt32, uint32_t);
892  ADD_MAP(m, totalSize, "periodMs[5]", task[5].periodMs, 0, DataTypeUInt32, uint32_t);
893  ADD_MAP(m, totalSize, "runTimeUs[5]", task[5].runTimeUs, 0, DataTypeUInt32, uint32_t);
894  ADD_MAP(m, totalSize, "maxRunTimeUs[5]", task[5].maxRunTimeUs, 0, DataTypeUInt32, uint32_t);
895  ADD_MAP(m, totalSize, "averageRunTimeUs[5]", task[5].averageRunTimeUs, 0, DataTypeFloat, float);
896  ADD_MAP(m, totalSize, "gapCount[5]", task[5].gapCount, 0, DataTypeUInt32, uint32_t);
897  ADD_MAP(m, totalSize, "cpuUsage[5]", task[5].cpuUsage, 0, DataTypeFloat, f_t);
898  ADD_MAP(m, totalSize, "handle[5]", task[5].handle, 0, DataTypeUInt32, uint32_t);
899 
900  ADD_MAP(m, totalSize, "freeHeapSize", freeHeapSize, 0, DataTypeUInt32, uint32_t);
901  ADD_MAP(m, totalSize, "mallocSize", mallocSize, 0, DataTypeUInt32, uint32_t);
902  ADD_MAP(m, totalSize, "freeSize", freeSize, 0, DataTypeUInt32, uint32_t);
903 
904  ASSERT_SIZE(totalSize);
905 }
907 {
908  typedef can_config_t MAP_TYPE;
909  map_name_to_info_t& m = mappings[DID_CAN_CONFIG];
910  uint32_t totalSize = 0;
911  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_TIME]", can_period_mult[CID_INS_TIME], 0, DataTypeUInt32, uint32_t&);
912  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_STATUS]", can_period_mult[CID_INS_STATUS], 0, DataTypeUInt32, uint32_t&);
913  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_EULER]", can_period_mult[CID_INS_EULER], 0, DataTypeUInt32, uint32_t&);
914  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_QUATN2B]", can_period_mult[CID_INS_QUATN2B], 0, DataTypeUInt32, uint32_t&);
915  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_QUATE2B]", can_period_mult[CID_INS_QUATE2B], 0, DataTypeUInt32, uint32_t&);
916  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_UVW]", can_period_mult[CID_INS_UVW], 0, DataTypeUInt32, uint32_t&);
917  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_VE]", can_period_mult[CID_INS_VE], 0, DataTypeUInt32, uint32_t&);
918  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_LAT]", can_period_mult[CID_INS_LAT], 0, DataTypeUInt32, uint32_t&);
919  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_LON]", can_period_mult[CID_INS_LON], 0, DataTypeUInt32, uint32_t&);
920  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_ALT]", can_period_mult[CID_INS_ALT], 0, DataTypeUInt32, uint32_t&);
921  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_NORTH_EAST]", can_period_mult[CID_INS_NORTH_EAST], 0, DataTypeUInt32, uint32_t&);
922  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_DOWN]", can_period_mult[CID_INS_DOWN], 0, DataTypeUInt32, uint32_t&);
923  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_ECEF_X]", can_period_mult[CID_INS_ECEF_X], 0, DataTypeUInt32, uint32_t&);
924  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_ECEF_Y]", can_period_mult[CID_INS_ECEF_Y], 0, DataTypeUInt32, uint32_t&);
925  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_ECEF_Z]", can_period_mult[CID_INS_ECEF_Z], 0, DataTypeUInt32, uint32_t&);
926  ADD_MAP(m, totalSize, "can_period_mult[CID_INS_MSL]", can_period_mult[CID_INS_MSL], 0, DataTypeUInt32, uint32_t&);
927  ADD_MAP(m, totalSize, "can_period_mult[CID_PREINT_PX]", can_period_mult[CID_PREINT_PX], 0, DataTypeUInt32, uint32_t&);
928  ADD_MAP(m, totalSize, "can_period_mult[CID_PREINT_QY]", can_period_mult[CID_PREINT_QY], 0, DataTypeUInt32, uint32_t&);
929  ADD_MAP(m, totalSize, "can_period_mult[CID_PREINT_RZ]", can_period_mult[CID_PREINT_RZ], 0, DataTypeUInt32, uint32_t&);
930  ADD_MAP(m, totalSize, "can_period_mult[CID_DUAL_PX]", can_period_mult[CID_DUAL_PX], 0, DataTypeUInt32, uint32_t&);
931  ADD_MAP(m, totalSize, "can_period_mult[CID_DUAL_QY]", can_period_mult[CID_DUAL_QY], 0, DataTypeUInt32, uint32_t&);
932  ADD_MAP(m, totalSize, "can_period_mult[CID_DUAL_RZ]", can_period_mult[CID_DUAL_RZ], 0, DataTypeUInt32, uint32_t&);
933  ADD_MAP(m, totalSize, "can_period_mult[CID_GPS1_POS]", can_period_mult[CID_GPS1_POS], 0, DataTypeUInt32, uint32_t&);
934  ADD_MAP(m, totalSize, "can_period_mult[CID_ROLL_ROLLRATE]", can_period_mult[CID_ROLL_ROLLRATE], 0, DataTypeUInt32, uint32_t&);
935  ADD_MAP(m, totalSize, "can_period_mult[CID_GPS1_RTK_REL]", can_period_mult[CID_GPS1_RTK_REL], 0, DataTypeUInt32, uint32_t&);
936  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_TIME]", can_transmit_address[CID_INS_TIME], 0, DataTypeUInt32, uint32_t&);
937  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_STATUS]", can_transmit_address[CID_INS_STATUS], 0, DataTypeUInt32, uint32_t&);
938  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_EULER]", can_transmit_address[CID_INS_EULER], 0, DataTypeUInt32, uint32_t&);
939  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_QUATN2B]", can_transmit_address[CID_INS_QUATN2B], 0, DataTypeUInt32, uint32_t&);
940  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_QUATE2B]", can_transmit_address[CID_INS_QUATE2B], 0, DataTypeUInt32, uint32_t&);
941  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_UVW]", can_transmit_address[CID_INS_UVW], 0, DataTypeUInt32, uint32_t&);
942  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_VE]", can_transmit_address[CID_INS_VE], 0, DataTypeUInt32, uint32_t&);
943  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_LAT]", can_transmit_address[CID_INS_LAT], 0, DataTypeUInt32, uint32_t&);
944  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_LON]", can_transmit_address[CID_INS_LON], 0, DataTypeUInt32, uint32_t&);
945  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_ALT]", can_transmit_address[CID_INS_ALT], 0, DataTypeUInt32, uint32_t&);
946  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_NORTH_EAST]", can_transmit_address[CID_INS_NORTH_EAST], 0, DataTypeUInt32, uint32_t&);
947  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_DOWN]", can_transmit_address[CID_INS_DOWN], 0, DataTypeUInt32, uint32_t&);
948  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_ECEF_X]", can_transmit_address[CID_INS_ECEF_X], 0, DataTypeUInt32, uint32_t&);
949  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_ECEF_Y]", can_transmit_address[CID_INS_ECEF_Y], 0, DataTypeUInt32, uint32_t&);
950  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_ECEF_Z]", can_transmit_address[CID_INS_ECEF_Z], 0, DataTypeUInt32, uint32_t&);
951  ADD_MAP(m, totalSize, "can_transmit_address[CID_INS_MSL]", can_transmit_address[CID_INS_MSL], 0, DataTypeUInt32, uint32_t&);
952  ADD_MAP(m, totalSize, "can_transmit_address[CID_PREINT_PX]", can_transmit_address[CID_PREINT_PX], 0, DataTypeUInt32, uint32_t&);
953  ADD_MAP(m, totalSize, "can_transmit_address[CID_PREINT_QY]", can_transmit_address[CID_PREINT_QY], 0, DataTypeUInt32, uint32_t&);
954  ADD_MAP(m, totalSize, "can_transmit_address[CID_PREINT_RZ]", can_transmit_address[CID_PREINT_RZ], 0, DataTypeUInt32, uint32_t&);
955  ADD_MAP(m, totalSize, "can_transmit_address[CID_DUAL_PX]", can_transmit_address[CID_DUAL_PX], 0, DataTypeUInt32, uint32_t&);
956  ADD_MAP(m, totalSize, "can_transmit_address[CID_DUAL_QY]", can_transmit_address[CID_DUAL_QY], 0, DataTypeUInt32, uint32_t&);
957  ADD_MAP(m, totalSize, "can_transmit_address[CID_DUAL_RZ]", can_transmit_address[CID_DUAL_RZ], 0, DataTypeUInt32, uint32_t&);
958  ADD_MAP(m, totalSize, "can_transmit_address[CID_GPS1_POS]", can_transmit_address[CID_GPS1_POS], 0, DataTypeUInt32, uint32_t&);
959  ADD_MAP(m, totalSize, "can_transmit_address[CID_GPS1_RTK_REL]", can_transmit_address[CID_GPS1_RTK_REL], 0, DataTypeUInt32, uint32_t&);
960  ADD_MAP(m, totalSize, "can_transmit_address[CID_ROLL_ROLLRATE]", can_transmit_address[CID_ROLL_ROLLRATE], 0, DataTypeUInt32, uint32_t&);
961  ADD_MAP(m, totalSize, "can_baudrate_kbps", can_baudrate_kbps, 0, DataTypeUInt32, uint32_t);
962  ADD_MAP(m, totalSize, "can_receive_address", can_receive_address, 0, DataTypeUInt32, uint32_t);
963 
964  ASSERT_SIZE(totalSize);
965 }
966 
968 {
969  typedef diag_msg_t MAP_TYPE;
971  uint32_t totalSize = 0;
972  ADD_MAP(m, totalSize, "timeOfWeekMs", timeOfWeekMs, 0, DataTypeUInt32, uint32_t);
973  ADD_MAP(m, totalSize, "messageLength", messageLength, 0, DataTypeUInt32, uint32_t);
974  ADD_MAP(m, totalSize, "message", message, MEMBERSIZE(diag_msg_t, message), DataTypeString, char[MEMBERSIZE(diag_msg_t, message)]);
975 
976  ASSERT_SIZE(totalSize);
977 }
978 
979 #ifdef USE_IS_INTERNAL
980 
981 static void PopulateSensorsADCMappings(map_name_to_info_t mappings[DID_COUNT])
982 {
983  typedef sys_sensors_adc_t MAP_TYPE;
984  map_name_to_info_t& m = mappings[DID_SENSORS_ADC];
985  uint32_t totalSize = 0;
986  ADD_MAP(m, totalSize, "time", time, 0, DataTypeDouble, double);
987  ADD_MAP(m, totalSize, "pqr1[0]", mpu[0].pqr[0], 0, DataTypeFloat, float&);
988  ADD_MAP(m, totalSize, "pqr1[1]", mpu[0].pqr[1], 0, DataTypeFloat, float&);
989  ADD_MAP(m, totalSize, "pqr1[2]", mpu[0].pqr[2], 0, DataTypeFloat, float&);
990  ADD_MAP(m, totalSize, "acc1[0]", mpu[0].acc[0], 0, DataTypeFloat, float&);
991  ADD_MAP(m, totalSize, "acc1[1]", mpu[0].acc[1], 0, DataTypeFloat, float&);
992  ADD_MAP(m, totalSize, "acc1[2]", mpu[0].acc[2], 0, DataTypeFloat, float&);
993  ADD_MAP(m, totalSize, "mag1[0]", mpu[0].mag[0], 0, DataTypeFloat, float&);
994  ADD_MAP(m, totalSize, "mag1[1]", mpu[0].mag[1], 0, DataTypeFloat, float&);
995  ADD_MAP(m, totalSize, "mag1[2]", mpu[0].mag[2], 0, DataTypeFloat, float&);
996  ADD_MAP(m, totalSize, "temp1", mpu[0].temp, 0, DataTypeFloat, float);
997  ADD_MAP(m, totalSize, "pqr2[0]", mpu[1].pqr[0], 0, DataTypeFloat, float&);
998  ADD_MAP(m, totalSize, "pqr2[1]", mpu[1].pqr[1], 0, DataTypeFloat, float&);
999  ADD_MAP(m, totalSize, "pqr2[2]", mpu[1].pqr[2], 0, DataTypeFloat, float&);
1000  ADD_MAP(m, totalSize, "acc2[0]", mpu[1].acc[0], 0, DataTypeFloat, float&);
1001  ADD_MAP(m, totalSize, "acc2[1]", mpu[1].acc[1], 0, DataTypeFloat, float&);
1002  ADD_MAP(m, totalSize, "acc2[2]", mpu[1].acc[2], 0, DataTypeFloat, float&);
1003  ADD_MAP(m, totalSize, "mag2[0]", mpu[1].mag[0], 0, DataTypeFloat, float&);
1004  ADD_MAP(m, totalSize, "mag2[1]", mpu[1].mag[1], 0, DataTypeFloat, float&);
1005  ADD_MAP(m, totalSize, "mag2[2]", mpu[1].mag[2], 0, DataTypeFloat, float&);
1006  ADD_MAP(m, totalSize, "temp2", mpu[1].temp, 0, DataTypeFloat, float);
1007  ADD_MAP(m, totalSize, "bar", bar, 0, DataTypeFloat, float);
1008  ADD_MAP(m, totalSize, "barTemp", barTemp, 0, DataTypeFloat, float);
1009  ADD_MAP(m, totalSize, "humidity", humidity, 0, DataTypeFloat, float);
1010  ADD_MAP(m, totalSize, "ana[0]", ana[0], 0, DataTypeFloat, float&);
1011  ADD_MAP(m, totalSize, "ana[1]", ana[1], 0, DataTypeFloat, float&);
1012  ADD_MAP(m, totalSize, "ana[2]", ana[2], 0, DataTypeFloat, float&);
1013  ADD_MAP(m, totalSize, "ana[3]", ana[3], 0, DataTypeFloat, float&);
1014 
1015  ASSERT_SIZE(totalSize);
1016 }
1017 
1018 static void PopulateSensorsISMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
1019 {
1020  typedef sensors_w_temp_t MAP_TYPE;
1021  map_name_to_info_t& m = mappings[id];
1022  uint32_t totalSize = 0;
1023  ADD_MAP(m, totalSize, "pqr1[0]", mpu[0].pqr[0], 0, DataTypeFloat, float&);
1024  ADD_MAP(m, totalSize, "pqr1[1]", mpu[0].pqr[1], 0, DataTypeFloat, float&);
1025  ADD_MAP(m, totalSize, "pqr1[2]", mpu[0].pqr[2], 0, DataTypeFloat, float&);
1026  ADD_MAP(m, totalSize, "acc1[0]", mpu[0].acc[0], 0, DataTypeFloat, float&);
1027  ADD_MAP(m, totalSize, "acc1[1]", mpu[0].acc[1], 0, DataTypeFloat, float&);
1028  ADD_MAP(m, totalSize, "acc1[2]", mpu[0].acc[2], 0, DataTypeFloat, float&);
1029  ADD_MAP(m, totalSize, "mag1[0]", mpu[0].mag[0], 0, DataTypeFloat, float&);
1030  ADD_MAP(m, totalSize, "mag1[1]", mpu[0].mag[1], 0, DataTypeFloat, float&);
1031  ADD_MAP(m, totalSize, "mag1[2]", mpu[0].mag[2], 0, DataTypeFloat, float&);
1032  ADD_MAP(m, totalSize, "temp1", mpu[0].temp, 0, DataTypeFloat, float);
1033  ADD_MAP(m, totalSize, "pqr2[0]", mpu[1].pqr[0], 0, DataTypeFloat, float&);
1034  ADD_MAP(m, totalSize, "pqr2[1]", mpu[1].pqr[1], 0, DataTypeFloat, float&);
1035  ADD_MAP(m, totalSize, "pqr2[2]", mpu[1].pqr[2], 0, DataTypeFloat, float&);
1036  ADD_MAP(m, totalSize, "acc2[0]", mpu[1].acc[0], 0, DataTypeFloat, float&);
1037  ADD_MAP(m, totalSize, "acc2[1]", mpu[1].acc[1], 0, DataTypeFloat, float&);
1038  ADD_MAP(m, totalSize, "acc2[2]", mpu[1].acc[2], 0, DataTypeFloat, float&);
1039  ADD_MAP(m, totalSize, "mag2[0]", mpu[1].mag[0], 0, DataTypeFloat, float&);
1040  ADD_MAP(m, totalSize, "mag2[1]", mpu[1].mag[1], 0, DataTypeFloat, float&);
1041  ADD_MAP(m, totalSize, "mag2[2]", mpu[1].mag[2], 0, DataTypeFloat, float&);
1042  ADD_MAP(m, totalSize, "temp2", mpu[1].temp, 0, DataTypeFloat, float);
1043 
1044  ASSERT_SIZE(totalSize);
1045 }
1046 
1047 static void PopulateSensorsTCMappings(map_name_to_info_t mappings[DID_COUNT])
1048 {
1049  typedef sensors_t MAP_TYPE;
1050  map_name_to_info_t& m = mappings[DID_SENSORS_TC_BIAS];
1051  uint32_t totalSize = 0;
1052  ADD_MAP(m, totalSize, "pqr1[0]", mpu[0].pqr[0], 0, DataTypeFloat, float&);
1053  ADD_MAP(m, totalSize, "pqr1[1]", mpu[0].pqr[1], 0, DataTypeFloat, float&);
1054  ADD_MAP(m, totalSize, "pqr1[2]", mpu[0].pqr[2], 0, DataTypeFloat, float&);
1055  ADD_MAP(m, totalSize, "acc1[0]", mpu[0].acc[0], 0, DataTypeFloat, float&);
1056  ADD_MAP(m, totalSize, "acc1[1]", mpu[0].acc[1], 0, DataTypeFloat, float&);
1057  ADD_MAP(m, totalSize, "acc1[2]", mpu[0].acc[2], 0, DataTypeFloat, float&);
1058  ADD_MAP(m, totalSize, "mag1[0]", mpu[0].mag[0], 0, DataTypeFloat, float&);
1059  ADD_MAP(m, totalSize, "mag1[1]", mpu[0].mag[1], 0, DataTypeFloat, float&);
1060  ADD_MAP(m, totalSize, "mag1[2]", mpu[0].mag[2], 0, DataTypeFloat, float&);
1061  ADD_MAP(m, totalSize, "pqr2[0]", mpu[1].pqr[0], 0, DataTypeFloat, float&);
1062  ADD_MAP(m, totalSize, "pqr2[1]", mpu[1].pqr[1], 0, DataTypeFloat, float&);
1063  ADD_MAP(m, totalSize, "pqr2[2]", mpu[1].pqr[2], 0, DataTypeFloat, float&);
1064  ADD_MAP(m, totalSize, "acc2[0]", mpu[1].acc[0], 0, DataTypeFloat, float&);
1065  ADD_MAP(m, totalSize, "acc2[1]", mpu[1].acc[1], 0, DataTypeFloat, float&);
1066  ADD_MAP(m, totalSize, "acc2[2]", mpu[1].acc[2], 0, DataTypeFloat, float&);
1067  ADD_MAP(m, totalSize, "mag2[0]", mpu[1].mag[0], 0, DataTypeFloat, float&);
1068  ADD_MAP(m, totalSize, "mag2[1]", mpu[1].mag[1], 0, DataTypeFloat, float&);
1069  ADD_MAP(m, totalSize, "mag2[2]", mpu[1].mag[2], 0, DataTypeFloat, float&);
1070 
1071  ASSERT_SIZE(totalSize);
1072 }
1073 
1074 static void PopulateSensorsCompMappings(map_name_to_info_t mappings[DID_COUNT])
1075 {
1076  typedef sensor_compensation_t MAP_TYPE;
1077  map_name_to_info_t& m = mappings[DID_SCOMP];
1078  uint32_t totalSize = 0;
1079  ADD_MAP(m, totalSize, "pqr1[0]", mpu[0].lpfLsb.pqr[0], 0, DataTypeFloat, float&);
1080  ADD_MAP(m, totalSize, "pqr1[1]", mpu[0].lpfLsb.pqr[1], 0, DataTypeFloat, float&);
1081  ADD_MAP(m, totalSize, "pqr1[2]", mpu[0].lpfLsb.pqr[2], 0, DataTypeFloat, float&);
1082  ADD_MAP(m, totalSize, "acc1[0]", mpu[0].lpfLsb.acc[0], 0, DataTypeFloat, float&);
1083  ADD_MAP(m, totalSize, "acc1[1]", mpu[0].lpfLsb.acc[1], 0, DataTypeFloat, float&);
1084  ADD_MAP(m, totalSize, "acc1[2]", mpu[0].lpfLsb.acc[2], 0, DataTypeFloat, float&);
1085  ADD_MAP(m, totalSize, "mag1[0]", mpu[0].lpfLsb.mag[0], 0, DataTypeFloat, float&);
1086  ADD_MAP(m, totalSize, "mag1[1]", mpu[0].lpfLsb.mag[1], 0, DataTypeFloat, float&);
1087  ADD_MAP(m, totalSize, "mag1[2]", mpu[0].lpfLsb.mag[2], 0, DataTypeFloat, float&);
1088  ADD_MAP(m, totalSize, "temp1", mpu[0].lpfLsb.temp, 0, DataTypeFloat, float);
1089  ADD_MAP(m, totalSize, "temp2", mpu[0].temp, 0, DataTypeFloat, float);
1090  ADD_MAP(m, totalSize, "tempRampRate1", mpu[0].tempRampRate, 0, DataTypeFloat, float);
1091  ADD_MAP(m, totalSize, "tci1", mpu[0].tci, 0, DataTypeUInt32, uint32_t);
1092  ADD_MAP(m, totalSize, "numTcPts1", mpu[0].numTcPts, 0, DataTypeUInt32, uint32_t);
1093  ADD_MAP(m, totalSize, "dtTemp1", mpu[0].dtTemp, 0, DataTypeFloat, float);
1094  ADD_MAP(m, totalSize, "pqr2[0]", mpu[1].lpfLsb.pqr[0], 0, DataTypeFloat, float&);
1095  ADD_MAP(m, totalSize, "pqr2[1]", mpu[1].lpfLsb.pqr[1], 0, DataTypeFloat, float&);
1096  ADD_MAP(m, totalSize, "pqr2[2]", mpu[1].lpfLsb.pqr[2], 0, DataTypeFloat, float&);
1097  ADD_MAP(m, totalSize, "acc2[0]", mpu[1].lpfLsb.acc[0], 0, DataTypeFloat, float&);
1098  ADD_MAP(m, totalSize, "acc2[1]", mpu[1].lpfLsb.acc[1], 0, DataTypeFloat, float&);
1099  ADD_MAP(m, totalSize, "acc2[2]", mpu[1].lpfLsb.acc[2], 0, DataTypeFloat, float&);
1100  ADD_MAP(m, totalSize, "mag2[0]", mpu[1].lpfLsb.mag[0], 0, DataTypeFloat, float&);
1101  ADD_MAP(m, totalSize, "mag2[1]", mpu[1].lpfLsb.mag[1], 0, DataTypeFloat, float&);
1102  ADD_MAP(m, totalSize, "mag2[2]", mpu[1].lpfLsb.mag[2], 0, DataTypeFloat, float&);
1103  ADD_MAP(m, totalSize, "temp3", mpu[1].lpfLsb.temp, 0, DataTypeFloat, float);
1104  ADD_MAP(m, totalSize, "temp4", mpu[1].temp, 0, DataTypeFloat, float);
1105  ADD_MAP(m, totalSize, "tempRampRate2", mpu[1].tempRampRate, 0, DataTypeFloat, float);
1106  ADD_MAP(m, totalSize, "tci2", mpu[1].tci, 0, DataTypeUInt32, uint32_t);
1107  ADD_MAP(m, totalSize, "numTcPts2", mpu[1].numTcPts, 0, DataTypeUInt32, uint32_t);
1108  ADD_MAP(m, totalSize, "dtTemp2", mpu[1].dtTemp, 0, DataTypeFloat, float);
1109  ADD_MAP(m, totalSize, "sampleCount", sampleCount, 0, DataTypeUInt32, uint32_t);
1110  ADD_MAP(m, totalSize, "calState", calState, 0, DataTypeUInt32, uint32_t);
1111  ADD_MAP(m, totalSize, "alignAccel[0]", alignAccel[0], 0, DataTypeFloat, float&);
1112  ADD_MAP(m, totalSize, "alignAccel[1]", alignAccel[1], 0, DataTypeFloat, float&);
1113  ADD_MAP(m, totalSize, "alignAccel[2]", alignAccel[2], 0, DataTypeFloat, float&);
1114  ADD_MAP(m, totalSize, "status", status, 0, DataTypeUInt32, uint32_t);
1115 
1116  ASSERT_SIZE(totalSize);
1117 }
1118 
1119 static void PopulateDebugArrayMappings(map_name_to_info_t mappings[DID_COUNT])
1120 {
1121  typedef debug_array_t MAP_TYPE;
1122  map_name_to_info_t& m = mappings[DID_DEBUG_ARRAY];
1123  uint32_t totalSize = 0;
1124  ADD_MAP(m, totalSize, "i[0]", i[0], 0, DataTypeInt32, int32_t&);
1125  ADD_MAP(m, totalSize, "i[1]", i[1], 0, DataTypeInt32, int32_t&);
1126  ADD_MAP(m, totalSize, "i[2]", i[2], 0, DataTypeInt32, int32_t&);
1127  ADD_MAP(m, totalSize, "i[3]", i[3], 0, DataTypeInt32, int32_t&);
1128  ADD_MAP(m, totalSize, "i[4]", i[4], 0, DataTypeInt32, int32_t&);
1129  ADD_MAP(m, totalSize, "i[5]", i[5], 0, DataTypeInt32, int32_t&);
1130  ADD_MAP(m, totalSize, "i[6]", i[6], 0, DataTypeInt32, int32_t&);
1131  ADD_MAP(m, totalSize, "i[7]", i[7], 0, DataTypeInt32, int32_t&);
1132  ADD_MAP(m, totalSize, "i[8]", i[8], 0, DataTypeInt32, int32_t&);
1133  ADD_MAP(m, totalSize, "f[0]", f[0], 0, DataTypeFloat, float&);
1134  ADD_MAP(m, totalSize, "f[1]", f[1], 0, DataTypeFloat, float&);
1135  ADD_MAP(m, totalSize, "f[2]", f[2], 0, DataTypeFloat, float&);
1136  ADD_MAP(m, totalSize, "f[3]", f[3], 0, DataTypeFloat, float&);
1137  ADD_MAP(m, totalSize, "f[4]", f[4], 0, DataTypeFloat, float&);
1138  ADD_MAP(m, totalSize, "f[5]", f[5], 0, DataTypeFloat, float&);
1139  ADD_MAP(m, totalSize, "f[6]", f[6], 0, DataTypeFloat, float&);
1140  ADD_MAP(m, totalSize, "f[7]", f[7], 0, DataTypeFloat, float&);
1141  ADD_MAP(m, totalSize, "f[8]", f[8], 0, DataTypeFloat, float&);
1142  ADD_MAP(m, totalSize, "lf[0]", lf[0], 0, DataTypeDouble, double&);
1143  ADD_MAP(m, totalSize, "lf[1]", lf[1], 0, DataTypeDouble, double&);
1144  ADD_MAP(m, totalSize, "lf[2]", lf[2], 0, DataTypeDouble, double&);
1145 
1146  ASSERT_SIZE(totalSize);
1147 }
1148 
1149 static void PopulateUserPage0Mappings(map_name_to_info_t mappings[DID_COUNT])
1150 {
1151  typedef nvm_group_0_t MAP_TYPE;
1152  map_name_to_info_t& m = mappings[DID_NVR_USERPAGE_G0];
1153  uint32_t totalSize = 0;
1154  ADD_MAP(m, totalSize, "size", size, 0, DataTypeUInt32, uint32_t);
1155  ADD_MAP(m, totalSize, "checksum", checksum, 0, DataTypeUInt32, uint32_t);
1156  ADD_MAP(m, totalSize, "key", key, 0, DataTypeUInt32, uint32_t);
1157  ADD_MAP(m, totalSize, "lockBits", lockBits, 0, DataTypeUInt32, uint32_t);
1158  ADD_MAP(m, totalSize, "featureBits", featureBits, 0, DataTypeUInt32, uint32_t);
1159  ADD_MAP(m, totalSize, "featureHash1", featureHash1, 0, DataTypeUInt32, uint32_t);
1160  ADD_MAP(m, totalSize, "featureHash2", featureHash2, 0, DataTypeUInt32, uint32_t);
1161 
1162  ASSERT_SIZE(totalSize);
1163 }
1164 
1165 static void PopulateUserPage1Mappings(map_name_to_info_t mappings[DID_COUNT])
1166 {
1167  typedef nvm_group_1_t MAP_TYPE;
1168  map_name_to_info_t& m = mappings[DID_NVR_USERPAGE_G1];
1169  uint32_t totalSize = 0;
1170  ADD_MAP(m, totalSize, "size", size, 0, DataTypeUInt32, uint32_t);
1171  ADD_MAP(m, totalSize, "checksum", checksum, 0, DataTypeUInt32, uint32_t);
1172  ADD_MAP(m, totalSize, "key", key, 0, DataTypeUInt32, uint32_t);
1173  ADD_MAP(m, totalSize, "bKpqr", cf.bKpqr, 0, DataTypeFloat, float);
1174  ADD_MAP(m, totalSize, "bKuvw", cf.bKuvw, 0, DataTypeFloat, float);
1175  ADD_MAP(m, totalSize, "oKat1", cf.oKat1, 0, DataTypeFloat, float);
1176  ADD_MAP(m, totalSize, "oKat2", cf.oKat2, 0, DataTypeFloat, float);
1177  ADD_MAP(m, totalSize, "oKuvw", cf.oKuvw, 0, DataTypeFloat, float);
1178  ADD_MAP(m, totalSize, "oKlla", cf.oKlla, 0, DataTypeFloat, float);
1179  ADD_MAP(m, totalSize, "mag.bias_cal[0]", mag.bias_cal[0], 0, DataTypeFloat, float&);
1180  ADD_MAP(m, totalSize, "mag.bias_cal[1]", mag.bias_cal[1], 0, DataTypeFloat, float&);
1181  ADD_MAP(m, totalSize, "mag.bias_cal[2]", mag.bias_cal[2], 0, DataTypeFloat, float&);
1182  ADD_MAP(m, totalSize, "mag.Wcal[0]", mag.Wcal[0], 0, DataTypeFloat, float&);
1183  ADD_MAP(m, totalSize, "mag.Wcal[1]", mag.Wcal[1], 0, DataTypeFloat, float&);
1184  ADD_MAP(m, totalSize, "mag.Wcal[2]", mag.Wcal[2], 0, DataTypeFloat, float&);
1185  ADD_MAP(m, totalSize, "mag.Wcal[3]", mag.Wcal[3], 0, DataTypeFloat, float&);
1186  ADD_MAP(m, totalSize, "mag.Wcal[4]", mag.Wcal[4], 0, DataTypeFloat, float&);
1187  ADD_MAP(m, totalSize, "mag.Wcal[5]", mag.Wcal[5], 0, DataTypeFloat, float&);
1188  ADD_MAP(m, totalSize, "mag.Wcal[6]", mag.Wcal[6], 0, DataTypeFloat, float&);
1189  ADD_MAP(m, totalSize, "mag.Wcal[7]", mag.Wcal[7], 0, DataTypeFloat, float&);
1190  ADD_MAP(m, totalSize, "mag.Wcal[8]", mag.Wcal[8], 0, DataTypeFloat, float&);
1191  ADD_MAP(m, totalSize, "mag.DtD[0]", mag.DtD[0], 0, DataTypeFloat, float&);
1192  ADD_MAP(m, totalSize, "mag.DtD[1]", mag.DtD[1], 0, DataTypeFloat, float&);
1193  ADD_MAP(m, totalSize, "mag.DtD[2]", mag.DtD[2], 0, DataTypeFloat, float&);
1194  ADD_MAP(m, totalSize, "mag.DtD[3]", mag.DtD[3], 0, DataTypeFloat, float&);
1195  ADD_MAP(m, totalSize, "mag.DtD[4]", mag.DtD[4], 0, DataTypeFloat, float&);
1196  ADD_MAP(m, totalSize, "mag.DtD[5]", mag.DtD[5], 0, DataTypeFloat, float&);
1197  ADD_MAP(m, totalSize, "mag.DtD[6]", mag.DtD[6], 0, DataTypeFloat, float&);
1198  ADD_MAP(m, totalSize, "mag.DtD[7]", mag.DtD[7], 0, DataTypeFloat, float&);
1199  ADD_MAP(m, totalSize, "mag.DtD[8]", mag.DtD[8], 0, DataTypeFloat, float&);
1200  ADD_MAP(m, totalSize, "mag.DtD[9]", mag.DtD[9], 0, DataTypeFloat, float&);
1201  ADD_MAP(m, totalSize, "mag.DtD[10]", mag.DtD[10], 0, DataTypeFloat, float&);
1202  ADD_MAP(m, totalSize, "mag.DtD[11]", mag.DtD[11], 0, DataTypeFloat, float&);
1203  ADD_MAP(m, totalSize, "mag.DtD[12]", mag.DtD[12], 0, DataTypeFloat, float&);
1204  ADD_MAP(m, totalSize, "mag.DtD[13]", mag.DtD[13], 0, DataTypeFloat, float&);
1205  ADD_MAP(m, totalSize, "mag.DtD[14]", mag.DtD[14], 0, DataTypeFloat, float&);
1206  ADD_MAP(m, totalSize, "mag.DtD[15]", mag.DtD[15], 0, DataTypeFloat, float&);
1207  ADD_MAP(m, totalSize, "mag.DtD[16]", mag.DtD[16], 0, DataTypeFloat, float&);
1208  ADD_MAP(m, totalSize, "mag.DtD[17]", mag.DtD[17], 0, DataTypeFloat, float&);
1209  ADD_MAP(m, totalSize, "mag.DtD[18]", mag.DtD[18], 0, DataTypeFloat, float&);
1210  ADD_MAP(m, totalSize, "mag.DtD[19]", mag.DtD[19], 0, DataTypeFloat, float&);
1211  ADD_MAP(m, totalSize, "mag.DtD[20]", mag.DtD[20], 0, DataTypeFloat, float&);
1212  ADD_MAP(m, totalSize, "mag.DtD[21]", mag.DtD[21], 0, DataTypeFloat, float&);
1213  ADD_MAP(m, totalSize, "mag.DtD[22]", mag.DtD[22], 0, DataTypeFloat, float&);
1214  ADD_MAP(m, totalSize, "mag.DtD[23]", mag.DtD[23], 0, DataTypeFloat, float&);
1215  ADD_MAP(m, totalSize, "mag.DtD[24]", mag.DtD[24], 0, DataTypeFloat, float&);
1216  ADD_MAP(m, totalSize, "mag.DtD[25]", mag.DtD[25], 0, DataTypeFloat, float&);
1217  ADD_MAP(m, totalSize, "mag.DtD[26]", mag.DtD[26], 0, DataTypeFloat, float&);
1218  ADD_MAP(m, totalSize, "mag.DtD[27]", mag.DtD[27], 0, DataTypeFloat, float&);
1219  ADD_MAP(m, totalSize, "mag.DtD[28]", mag.DtD[28], 0, DataTypeFloat, float&);
1220  ADD_MAP(m, totalSize, "mag.DtD[29]", mag.DtD[29], 0, DataTypeFloat, float&);
1221  ADD_MAP(m, totalSize, "mag.DtD[30]", mag.DtD[30], 0, DataTypeFloat, float&);
1222  ADD_MAP(m, totalSize, "mag.DtD[31]", mag.DtD[31], 0, DataTypeFloat, float&);
1223  ADD_MAP(m, totalSize, "mag.DtD[32]", mag.DtD[32], 0, DataTypeFloat, float&);
1224  ADD_MAP(m, totalSize, "mag.DtD[33]", mag.DtD[33], 0, DataTypeFloat, float&);
1225  ADD_MAP(m, totalSize, "mag.DtD[34]", mag.DtD[34], 0, DataTypeFloat, float&);
1226  ADD_MAP(m, totalSize, "mag.DtD[35]", mag.DtD[35], 0, DataTypeFloat, float&);
1227  ADD_MAP(m, totalSize, "mag.DtD[36]", mag.DtD[36], 0, DataTypeFloat, float&);
1228  ADD_MAP(m, totalSize, "mag.DtD[37]", mag.DtD[37], 0, DataTypeFloat, float&);
1229  ADD_MAP(m, totalSize, "mag.DtD[38]", mag.DtD[38], 0, DataTypeFloat, float&);
1230  ADD_MAP(m, totalSize, "mag.DtD[39]", mag.DtD[39], 0, DataTypeFloat, float&);
1231  ADD_MAP(m, totalSize, "mag.DtD[40]", mag.DtD[40], 0, DataTypeFloat, float&);
1232  ADD_MAP(m, totalSize, "mag.DtD[41]", mag.DtD[41], 0, DataTypeFloat, float&);
1233  ADD_MAP(m, totalSize, "mag.DtD[42]", mag.DtD[42], 0, DataTypeFloat, float&);
1234  ADD_MAP(m, totalSize, "mag.DtD[43]", mag.DtD[43], 0, DataTypeFloat, float&);
1235  ADD_MAP(m, totalSize, "mag.DtD[44]", mag.DtD[44], 0, DataTypeFloat, float&);
1236  ADD_MAP(m, totalSize, "mag.DtD[45]", mag.DtD[45], 0, DataTypeFloat, float&);
1237  ADD_MAP(m, totalSize, "mag.DtD[46]", mag.DtD[46], 0, DataTypeFloat, float&);
1238  ADD_MAP(m, totalSize, "mag.DtD[47]", mag.DtD[47], 0, DataTypeFloat, float&);
1239  ADD_MAP(m, totalSize, "mag.DtD[48]", mag.DtD[48], 0, DataTypeFloat, float&);
1240  ADD_MAP(m, totalSize, "mag.DtD[49]", mag.DtD[49], 0, DataTypeFloat, float&);
1241  ADD_MAP(m, totalSize, "mag.DtD[50]", mag.DtD[50], 0, DataTypeFloat, float&);
1242  ADD_MAP(m, totalSize, "mag.DtD[51]", mag.DtD[51], 0, DataTypeFloat, float&);
1243  ADD_MAP(m, totalSize, "mag.DtD[52]", mag.DtD[52], 0, DataTypeFloat, float&);
1244  ADD_MAP(m, totalSize, "mag.DtD[53]", mag.DtD[53], 0, DataTypeFloat, float&);
1245  ADD_MAP(m, totalSize, "mag.DtD[54]", mag.DtD[54], 0, DataTypeFloat, float&);
1246  ADD_MAP(m, totalSize, "mag.DtD[55]", mag.DtD[55], 0, DataTypeFloat, float&);
1247  ADD_MAP(m, totalSize, "mag.DtD[56]", mag.DtD[56], 0, DataTypeFloat, float&);
1248  ADD_MAP(m, totalSize, "mag.DtD[57]", mag.DtD[57], 0, DataTypeFloat, float&);
1249  ADD_MAP(m, totalSize, "mag.DtD[58]", mag.DtD[58], 0, DataTypeFloat, float&);
1250  ADD_MAP(m, totalSize, "mag.DtD[59]", mag.DtD[59], 0, DataTypeFloat, float&);
1251  ADD_MAP(m, totalSize, "mag.DtD[60]", mag.DtD[60], 0, DataTypeFloat, float&);
1252  ADD_MAP(m, totalSize, "mag.DtD[61]", mag.DtD[61], 0, DataTypeFloat, float&);
1253  ADD_MAP(m, totalSize, "mag.DtD[62]", mag.DtD[62], 0, DataTypeFloat, float&);
1254  ADD_MAP(m, totalSize, "mag.DtD[63]", mag.DtD[63], 0, DataTypeFloat, float&);
1255  ADD_MAP(m, totalSize, "mag.DtD[64]", mag.DtD[64], 0, DataTypeFloat, float&);
1256  ADD_MAP(m, totalSize, "mag.DtD[65]", mag.DtD[65], 0, DataTypeFloat, float&);
1257  ADD_MAP(m, totalSize, "mag.DtD[66]", mag.DtD[66], 0, DataTypeFloat, float&);
1258  ADD_MAP(m, totalSize, "mag.DtD[67]", mag.DtD[67], 0, DataTypeFloat, float&);
1259  ADD_MAP(m, totalSize, "mag.DtD[68]", mag.DtD[68], 0, DataTypeFloat, float&);
1260  ADD_MAP(m, totalSize, "mag.DtD[69]", mag.DtD[69], 0, DataTypeFloat, float&);
1261  ADD_MAP(m, totalSize, "mag.DtD[70]", mag.DtD[70], 0, DataTypeFloat, float&);
1262  ADD_MAP(m, totalSize, "mag.DtD[71]", mag.DtD[71], 0, DataTypeFloat, float&);
1263  ADD_MAP(m, totalSize, "mag.DtD[72]", mag.DtD[72], 0, DataTypeFloat, float&);
1264  ADD_MAP(m, totalSize, "mag.DtD[73]", mag.DtD[73], 0, DataTypeFloat, float&);
1265  ADD_MAP(m, totalSize, "mag.DtD[74]", mag.DtD[74], 0, DataTypeFloat, float&);
1266  ADD_MAP(m, totalSize, "mag.DtD[75]", mag.DtD[75], 0, DataTypeFloat, float&);
1267  ADD_MAP(m, totalSize, "mag.DtD[76]", mag.DtD[76], 0, DataTypeFloat, float&);
1268  ADD_MAP(m, totalSize, "mag.DtD[77]", mag.DtD[77], 0, DataTypeFloat, float&);
1269  ADD_MAP(m, totalSize, "mag.DtD[78]", mag.DtD[78], 0, DataTypeFloat, float&);
1270  ADD_MAP(m, totalSize, "mag.DtD[79]", mag.DtD[79], 0, DataTypeFloat, float&);
1271  ADD_MAP(m, totalSize, "mag.DtD[80]", mag.DtD[80], 0, DataTypeFloat, float&);
1272  ADD_MAP(m, totalSize, "mag.DtD[81]", mag.DtD[81], 0, DataTypeFloat, float&);
1273  ADD_MAP(m, totalSize, "mag.DtD[82]", mag.DtD[82], 0, DataTypeFloat, float&);
1274  ADD_MAP(m, totalSize, "mag.DtD[83]", mag.DtD[83], 0, DataTypeFloat, float&);
1275  ADD_MAP(m, totalSize, "mag.DtD[84]", mag.DtD[84], 0, DataTypeFloat, float&);
1276  ADD_MAP(m, totalSize, "mag.DtD[85]", mag.DtD[85], 0, DataTypeFloat, float&);
1277  ADD_MAP(m, totalSize, "mag.DtD[86]", mag.DtD[86], 0, DataTypeFloat, float&);
1278  ADD_MAP(m, totalSize, "mag.DtD[87]", mag.DtD[87], 0, DataTypeFloat, float&);
1279  ADD_MAP(m, totalSize, "mag.DtD[88]", mag.DtD[88], 0, DataTypeFloat, float&);
1280  ADD_MAP(m, totalSize, "mag.DtD[89]", mag.DtD[89], 0, DataTypeFloat, float&);
1281  ADD_MAP(m, totalSize, "mag.DtD[90]", mag.DtD[90], 0, DataTypeFloat, float&);
1282  ADD_MAP(m, totalSize, "mag.DtD[91]", mag.DtD[91], 0, DataTypeFloat, float&);
1283  ADD_MAP(m, totalSize, "mag.DtD[92]", mag.DtD[92], 0, DataTypeFloat, float&);
1284  ADD_MAP(m, totalSize, "mag.DtD[93]", mag.DtD[93], 0, DataTypeFloat, float&);
1285  ADD_MAP(m, totalSize, "mag.DtD[94]", mag.DtD[94], 0, DataTypeFloat, float&);
1286  ADD_MAP(m, totalSize, "mag.DtD[95]", mag.DtD[95], 0, DataTypeFloat, float&);
1287  ADD_MAP(m, totalSize, "mag.DtD[96]", mag.DtD[96], 0, DataTypeFloat, float&);
1288  ADD_MAP(m, totalSize, "mag.DtD[97]", mag.DtD[97], 0, DataTypeFloat, float&);
1289  ADD_MAP(m, totalSize, "mag.DtD[98]", mag.DtD[98], 0, DataTypeFloat, float&);
1290  ADD_MAP(m, totalSize, "mag.DtD[99]", mag.DtD[99], 0, DataTypeFloat, float&);
1291 
1292  ASSERT_SIZE(totalSize);
1293 }
1294 static void PopulateInl2MagObsInfo(map_name_to_info_t mappings[DID_COUNT])
1295 {
1296  typedef inl2_mag_obs_info_t MAP_TYPE;
1298  uint32_t totalSize = 0;
1299  ADD_MAP(m, totalSize, "timeOfWeekMs", timeOfWeekMs, 0, DataTypeUInt32, uint32_t);
1300  ADD_MAP(m, totalSize, "Ncal_samples", Ncal_samples, 0, DataTypeUInt32, uint32_t);
1301  ADD_MAP(m, totalSize, "ready", ready, 0, DataTypeUInt32, uint32_t);
1302  ADD_MAP(m, totalSize, "calibrated", calibrated, 0, DataTypeUInt32, uint32_t);
1303  ADD_MAP(m, totalSize, "auto_recal", auto_recal, 0, DataTypeUInt32, uint32_t);
1304  ADD_MAP(m, totalSize, "outlier", outlier, 0, DataTypeUInt32, uint32_t);
1305  ADD_MAP(m, totalSize, "magHdg", magHdg, 0, DataTypeFloat, float);
1306  ADD_MAP(m, totalSize, "insHdg", insHdg, 0, DataTypeFloat, float);
1307  ADD_MAP(m, totalSize, "magInsHdgDelta", magInsHdgDelta, 0, DataTypeFloat, float);
1308  ADD_MAP(m, totalSize, "nis", nis, 0, DataTypeFloat, float);
1309  ADD_MAP(m, totalSize, "nis_threshold", nis_threshold, 0, DataTypeFloat, float);
1310  ADD_MAP(m, totalSize, "Wcal[0]", Wcal[0], 0, DataTypeFloat, float&);
1311  ADD_MAP(m, totalSize, "Wcal[1]", Wcal[1], 0, DataTypeFloat, float&);
1312  ADD_MAP(m, totalSize, "Wcal[2]", Wcal[2], 0, DataTypeFloat, float&);
1313  ADD_MAP(m, totalSize, "Wcal[3]", Wcal[3], 0, DataTypeFloat, float&);
1314  ADD_MAP(m, totalSize, "Wcal[4]", Wcal[4], 0, DataTypeFloat, float&);
1315  ADD_MAP(m, totalSize, "Wcal[5]", Wcal[5], 0, DataTypeFloat, float&);
1316  ADD_MAP(m, totalSize, "Wcal[6]", Wcal[6], 0, DataTypeFloat, float&);
1317  ADD_MAP(m, totalSize, "Wcal[7]", Wcal[7], 0, DataTypeFloat, float&);
1318  ADD_MAP(m, totalSize, "Wcal[8]", Wcal[8], 0, DataTypeFloat, float&);
1319  ADD_MAP(m, totalSize, "activeCalSet", activeCalSet, 0, DataTypeUInt32, uint32_t);
1320  ADD_MAP(m, totalSize, "magHdgOffset", magHdgOffset, 0, DataTypeFloat, float);
1321  ADD_MAP(m, totalSize, "Tcal", Tcal, 0, DataTypeFloat, float);
1322 
1323  ASSERT_SIZE(totalSize);
1324 }
1325 static void PopulateInl2StatesMappings(map_name_to_info_t mappings[DID_COUNT])
1326 {
1327  typedef inl2_states_t MAP_TYPE;
1328  map_name_to_info_t& m = mappings[DID_INL2_STATES];
1329  uint32_t totalSize = 0;
1330  ADD_MAP(m, totalSize, "timeOfWeek", timeOfWeek, 0, DataTypeDouble, double);
1331  ADD_MAP(m, totalSize, "qe2b[0]", qe2b[0], 0, DataTypeFloat, float&);
1332  ADD_MAP(m, totalSize, "qe2b[1]", qe2b[1], 0, DataTypeFloat, float&);
1333  ADD_MAP(m, totalSize, "qe2b[2]", qe2b[2], 0, DataTypeFloat, float&);
1334  ADD_MAP(m, totalSize, "qe2b[3]", qe2b[3], 0, DataTypeFloat, float&);
1335  ADD_MAP(m, totalSize, "ve[0]", ve[0], 0, DataTypeFloat, float&);
1336  ADD_MAP(m, totalSize, "ve[1]", ve[1], 0, DataTypeFloat, float&);
1337  ADD_MAP(m, totalSize, "ve[2]", ve[2], 0, DataTypeFloat, float&);
1338  ADD_MAP(m, totalSize, "ecef[0]", ecef[0], 0, DataTypeDouble, double&);
1339  ADD_MAP(m, totalSize, "ecef[1]", ecef[1], 0, DataTypeDouble, double&);
1340  ADD_MAP(m, totalSize, "ecef[2]", ecef[2], 0, DataTypeDouble, double&);
1341  ADD_MAP(m, totalSize, "biasPqr[0]", biasPqr[0], 0, DataTypeFloat, float&);
1342  ADD_MAP(m, totalSize, "biasPqr[1]", biasPqr[1], 0, DataTypeFloat, float&);
1343  ADD_MAP(m, totalSize, "biasPqr[2]", biasPqr[2], 0, DataTypeFloat, float&);
1344  ADD_MAP(m, totalSize, "biasAcc[0]", biasAcc[0], 0, DataTypeFloat, float&);
1345  ADD_MAP(m, totalSize, "biasAcc[1]", biasAcc[1], 0, DataTypeFloat, float&);
1346  ADD_MAP(m, totalSize, "biasAcc[2]", biasAcc[2], 0, DataTypeFloat, float&);
1347  ADD_MAP(m, totalSize, "biasBaro", biasBaro, 0, DataTypeFloat, float);
1348  ADD_MAP(m, totalSize, "magDec", magDec, 0, DataTypeFloat, float);
1349  ADD_MAP(m, totalSize, "magInc", magInc, 0, DataTypeFloat, float);
1350 
1351  ASSERT_SIZE(totalSize);
1352 }
1353 
1354 // static void PopulateRtkStateMappings(map_name_to_info_t mappings[DID_COUNT])
1355 // {
1356 // typedef rtk_state_t MAP_TYPE;
1357 // map_name_to_info_t& m = mappings[DID_RTK_STATE];
1358 // uint32_t totalSize = 0;
1359 // ADD_MAP(m, totalSize, "time.time", time.time, 0, DataTypeInt64, int64_t);
1360 // ADD_MAP(m, totalSize, "time.sec", time.sec, 0, DataTypeDouble, double);
1361 // ADD_MAP(m, totalSize, "rp[0]", rp_ecef[0], 0, DataTypeDouble, double&);
1362 // ADD_MAP(m, totalSize, "rp[1]", rp_ecef[1], 0, DataTypeDouble, double&);
1363 // ADD_MAP(m, totalSize, "rp[2]", rp_ecef[2], 0, DataTypeDouble, double&);
1364 // ADD_MAP(m, totalSize, "rv[0]", rv_ecef[0], 0, DataTypeDouble, double&);
1365 // ADD_MAP(m, totalSize, "rv[1]", rv_ecef[1], 0, DataTypeDouble, double&);
1366 // ADD_MAP(m, totalSize, "rv[2]", rv_ecef[2], 0, DataTypeDouble, double&);
1367 // ADD_MAP(m, totalSize, "ra[0]", ra_ecef[0], 0, DataTypeDouble, double&);
1368 // ADD_MAP(m, totalSize, "ra[1]", ra_ecef[1], 0, DataTypeDouble, double&);
1369 // ADD_MAP(m, totalSize, "ra[2]", ra_ecef[2], 0, DataTypeDouble, double&);
1370 //
1371 // ADD_MAP(m, totalSize, "bp[0]", bp_ecef[0], 0, DataTypeDouble, double&);
1372 // ADD_MAP(m, totalSize, "bp[1]", bp_ecef[1], 0, DataTypeDouble, double&);
1373 // ADD_MAP(m, totalSize, "bp[2]", bp_ecef[2], 0, DataTypeDouble, double&);
1374 // ADD_MAP(m, totalSize, "bv[0]", bv_ecef[0], 0, DataTypeDouble, double&);
1375 // ADD_MAP(m, totalSize, "bv[1]", bv_ecef[1], 0, DataTypeDouble, double&);
1376 // ADD_MAP(m, totalSize, "bv[2]", bv_ecef[2], 0, DataTypeDouble, double&);
1377 // }
1378 
1379 static void PopulateRtkResidualMappings(map_name_to_info_t mappings[DID_COUNT], int DID)
1380 {
1381  typedef rtk_residual_t MAP_TYPE;
1382  map_name_to_info_t& m = mappings[DID];
1383  uint32_t totalSize = 0;
1384  ADD_MAP(m, totalSize, "time.time", time.time, 0, DataTypeInt64, int64_t);
1385  ADD_MAP(m, totalSize, "time.sec", time.sec, 0, DataTypeDouble, double);
1386  ADD_MAP(m, totalSize, "nv", nv, 0, DataTypeInt32, int32_t);
1387 }
1388 
1389 static void PopulateRtkDebugMappings(map_name_to_info_t mappings[DID_COUNT])
1390 {
1391  typedef rtk_debug_t MAP_TYPE;
1392  map_name_to_info_t& m = mappings[DID_RTK_DEBUG];
1393  uint32_t totalSize = 0;
1394 
1395  ADD_MAP(m, totalSize, "time.time", time.time, 0, DataTypeInt64, int64_t);
1396  ADD_MAP(m, totalSize, "time.sec", time.sec, 0, DataTypeDouble, double);
1397 
1398  ADD_MAP(m, totalSize, "rej_ovfl", rej_ovfl, 0, DataTypeUInt8, uint8_t);
1399  ADD_MAP(m, totalSize, "code_outlier", code_outlier, 0, DataTypeUInt8, uint8_t);
1400  ADD_MAP(m, totalSize, "phase_outlier", phase_outlier, 0, DataTypeUInt8, uint8_t);
1401  ADD_MAP(m, totalSize, "code_large_residual", code_large_residual, 0, DataTypeUInt8, uint8_t);
1402 
1403  ADD_MAP(m, totalSize, "phase_large_residual", phase_large_residual, 0, DataTypeUInt8, uint8_t);
1404  ADD_MAP(m, totalSize, "invalid_base_position", invalid_base_position, 0, DataTypeUInt8, uint8_t);
1405  ADD_MAP(m, totalSize, "bad_baseline_holdamb", bad_baseline_holdamb, 0, DataTypeUInt8, uint8_t);
1406  ADD_MAP(m, totalSize, "base_position_error", base_position_error, 0, DataTypeUInt8, uint8_t);
1407 
1408  ADD_MAP(m, totalSize, "outc_ovfl", outc_ovfl, 0, DataTypeUInt8, uint8_t);
1409  ADD_MAP(m, totalSize, "reset_timer", reset_timer, 0, DataTypeUInt8, uint8_t);
1410  ADD_MAP(m, totalSize, "use_ubx_position", use_ubx_position, 0, DataTypeUInt8, uint8_t);
1411  ADD_MAP(m, totalSize, "large_v2b", large_v2b, 0, DataTypeUInt8, uint8_t);
1412 
1413  ADD_MAP(m, totalSize, "base_position_update", base_position_update, 0, DataTypeUInt8, uint8_t);
1414  ADD_MAP(m, totalSize, "rover_position_error", rover_position_error, 0, DataTypeUInt8, uint8_t);
1415  ADD_MAP(m, totalSize, "reset_bias", reset_bias, 0, DataTypeUInt8, uint8_t);
1416  ADD_MAP(m, totalSize, "start_relpos", start_relpos, 0, DataTypeUInt8, uint8_t);
1417 
1418  ADD_MAP(m, totalSize, "end_relpos", end_relpos, 0, DataTypeUInt8, uint8_t);
1419  ADD_MAP(m, totalSize, "start_rtkpos", start_rtkpos, 0, DataTypeUInt8, uint8_t);
1420  ADD_MAP(m, totalSize, "pnt_pos_error", pnt_pos_error, 0, DataTypeUInt8, uint8_t);
1421  ADD_MAP(m, totalSize, "no_base_obs_data", no_base_obs_data, 0, DataTypeUInt8, uint8_t);
1422 
1423  ADD_MAP(m, totalSize, "diff_age_error", diff_age_error, 0, DataTypeUInt8, uint8_t);
1424  ADD_MAP(m, totalSize, "moveb_time_sync_error", moveb_time_sync_error, 0, DataTypeUInt8, uint8_t);
1425  ADD_MAP(m, totalSize, "waiting_for_rover_packet", waiting_for_rover_packet, 0, DataTypeUInt8, uint8_t);
1426  ADD_MAP(m, totalSize, "waiting_for_base_packet", waiting_for_base_packet, 0, DataTypeUInt8, uint8_t);
1427 
1428  ADD_MAP(m, totalSize, "lsq_error", lsq_error, 0, DataTypeUInt8, uint8_t);
1429  ADD_MAP(m, totalSize, "lack_of_valid_sats", lack_of_valid_sats, 0, DataTypeUInt8, uint8_t);
1430  ADD_MAP(m, totalSize, "divergent_pnt_pos_iteration", divergent_pnt_pos_iteration, 0, DataTypeUInt8, uint8_t);
1431  ADD_MAP(m, totalSize, "chi_square_error", chi_square_error, 0, DataTypeUInt8, uint8_t);
1432 
1433  ADD_MAP(m, totalSize, "cycle_slips", cycle_slips, 0, DataTypeUInt32, uint32_t);
1434 
1435  ADD_MAP(m, totalSize, "ubx_error", ubx_error, 0, DataTypeFloat, float);
1436 
1437  ADD_MAP(m, totalSize, "solStatus", solStatus, 0, DataTypeUInt8, uint8_t);
1438  ADD_MAP(m, totalSize, "rescode_err_marker", rescode_err_marker, 0, DataTypeUInt8, uint8_t);
1439  ADD_MAP(m, totalSize, "error_count", error_count, 0, DataTypeUInt8, uint8_t);
1440  ADD_MAP(m, totalSize, "error_code", error_code, 0, DataTypeUInt8, uint8_t);
1441 
1442  ADD_MAP(m, totalSize, "dist2base", dist2base, 0, DataTypeFloat, float);
1443 
1444  ADD_MAP(m, totalSize, "reserved1", reserved1, 0, DataTypeUInt8, uint8_t);
1445  ADD_MAP(m, totalSize, "gdop_error", gdop_error, 0, DataTypeUInt8, uint8_t);
1446  ADD_MAP(m, totalSize, "warning_code", warning_code, 0, DataTypeUInt8, uint8_t);
1447  ADD_MAP(m, totalSize, "warning_count", warning_count, 0, DataTypeUInt8, uint8_t);
1448 
1449  ADD_MAP(m, totalSize, "double_debug[0]", double_debug[0], 0, DataTypeDouble, double&);
1450  ADD_MAP(m, totalSize, "double_debug[1]", double_debug[1], 0, DataTypeDouble, double&);
1451  ADD_MAP(m, totalSize, "double_debug[2]", double_debug[2], 0, DataTypeDouble, double&);
1452  ADD_MAP(m, totalSize, "double_debug[3]", double_debug[3], 0, DataTypeDouble, double&);
1453 
1454  ADD_MAP(m, totalSize, "debug[0]", debug[0], 0, DataTypeUInt8, uint8_t&);
1455  ADD_MAP(m, totalSize, "debug[1]", debug[1], 0, DataTypeUInt8, uint8_t&);
1456  ADD_MAP(m, totalSize, "obs_count_bas", obs_count_bas, 0, DataTypeUInt8, uint8_t);
1457  ADD_MAP(m, totalSize, "obs_count_rov", obs_count_rov, 0, DataTypeUInt8, uint8_t);
1458 
1459  ADD_MAP(m, totalSize, "obs_pairs_filtered", obs_pairs_filtered, 0, DataTypeUInt8, uint8_t);
1460  ADD_MAP(m, totalSize, "obs_pairs_used", obs_pairs_used, 0, DataTypeUInt8, uint8_t);
1461  ADD_MAP(m, totalSize, "raw_ptr_queue_overrun", raw_ptr_queue_overrun, 0, DataTypeUInt8, uint8_t);
1462  ADD_MAP(m, totalSize, "raw_dat_queue_overrun", raw_dat_queue_overrun, 0, DataTypeUInt8, uint8_t);
1463 }
1464 
1465 
1466 static void PopulateRtkDebug2Mappings(map_name_to_info_t mappings[DID_COUNT])
1467 {
1468  typedef rtk_debug_2_t MAP_TYPE;
1469  map_name_to_info_t& m = mappings[DID_RTK_DEBUG_2];
1470  uint32_t totalSize = 0;
1471 
1472  ADD_MAP(m, totalSize, "time.time", time.time, 0, DataTypeInt64, int64_t);
1473  ADD_MAP(m, totalSize, "time.sec", time.sec, 0, DataTypeDouble, double);
1474 
1475 #if 0 // This doesn't work in Linux
1476 
1477  char str[50];
1478  for (int i = 0; i < NUMSATSOL; i++)
1479  {
1480  SNPRINTF(str, sizeof(str), "satBiasFloat[%d]", i);
1481  ADD_MAP(m, totalSize, str, satBiasFloat[i], 0, DataTypeFloat, float&);
1482  }
1483 
1484  for (int i = 0; i < NUMSATSOL; i++)
1485  {
1486  SNPRINTF(str, sizeof(str), "satBiasFix[%d]", i);
1487  ADD_MAP(m, totalSize, str, satBiasFix[i], 0, DataTypeFloat, float&);
1488  }
1489 
1490  for (int i = 0; i < NUMSATSOL; i++)
1491  {
1492  SNPRINTF(str, sizeof(str), "qualL[%d]", i);
1493  ADD_MAP(m, totalSize, str, qualL[i], 0, DataTypeUInt8, uint8_t&);
1494  }
1495 
1496  for (int i = 0; i < NUMSATSOL; i++)
1497  {
1498  SNPRINTF(str, sizeof(str), "sat[%d]", i);
1499  ADD_MAP(m, totalSize, str, sat[i], 0, DataTypeUInt8, uint8_t&);
1500  }
1501 
1502  for (int i = 0; i < NUMSATSOL; i++)
1503  {
1504  SNPRINTF(str, sizeof(str), "satBiasCov[%d]", i);
1505  ADD_MAP(m, totalSize, str, satBiasStd[i], 0, DataTypeFloat, float&);
1506  }
1507 
1508 #else
1509 
1510  ADD_MAP(m, totalSize, "satBiasFloat[0]", satBiasFloat[0], 0, DataTypeFloat, float&);
1511  ADD_MAP(m, totalSize, "satBiasFloat[1]", satBiasFloat[1], 0, DataTypeFloat, float&);
1512  ADD_MAP(m, totalSize, "satBiasFloat[2]", satBiasFloat[2], 0, DataTypeFloat, float&);
1513  ADD_MAP(m, totalSize, "satBiasFloat[3]", satBiasFloat[3], 0, DataTypeFloat, float&);
1514  ADD_MAP(m, totalSize, "satBiasFloat[4]", satBiasFloat[4], 0, DataTypeFloat, float&);
1515  ADD_MAP(m, totalSize, "satBiasFloat[5]", satBiasFloat[5], 0, DataTypeFloat, float&);
1516  ADD_MAP(m, totalSize, "satBiasFloat[6]", satBiasFloat[6], 0, DataTypeFloat, float&);
1517  ADD_MAP(m, totalSize, "satBiasFloat[7]", satBiasFloat[7], 0, DataTypeFloat, float&);
1518  ADD_MAP(m, totalSize, "satBiasFloat[8]", satBiasFloat[8], 0, DataTypeFloat, float&);
1519  ADD_MAP(m, totalSize, "satBiasFloat[9]", satBiasFloat[9], 0, DataTypeFloat, float&);
1520  ADD_MAP(m, totalSize, "satBiasFloat[10]", satBiasFloat[10], 0, DataTypeFloat, float&);
1521  ADD_MAP(m, totalSize, "satBiasFloat[11]", satBiasFloat[11], 0, DataTypeFloat, float&);
1522  ADD_MAP(m, totalSize, "satBiasFloat[12]", satBiasFloat[12], 0, DataTypeFloat, float&);
1523  ADD_MAP(m, totalSize, "satBiasFloat[13]", satBiasFloat[13], 0, DataTypeFloat, float&);
1524  ADD_MAP(m, totalSize, "satBiasFloat[14]", satBiasFloat[14], 0, DataTypeFloat, float&);
1525  ADD_MAP(m, totalSize, "satBiasFloat[15]", satBiasFloat[15], 0, DataTypeFloat, float&);
1526  ADD_MAP(m, totalSize, "satBiasFloat[16]", satBiasFloat[16], 0, DataTypeFloat, float&);
1527  ADD_MAP(m, totalSize, "satBiasFloat[17]", satBiasFloat[17], 0, DataTypeFloat, float&);
1528  ADD_MAP(m, totalSize, "satBiasFloat[18]", satBiasFloat[18], 0, DataTypeFloat, float&);
1529  ADD_MAP(m, totalSize, "satBiasFloat[19]", satBiasFloat[19], 0, DataTypeFloat, float&);
1530  ADD_MAP(m, totalSize, "satBiasFloat[20]", satBiasFloat[20], 0, DataTypeFloat, float&);
1531  ADD_MAP(m, totalSize, "satBiasFloat[21]", satBiasFloat[21], 0, DataTypeFloat, float&);
1532 
1533  ADD_MAP(m, totalSize, "satBiasFix[0]", satBiasFix[0], 0, DataTypeFloat, float&);
1534  ADD_MAP(m, totalSize, "satBiasFix[1]", satBiasFix[1], 0, DataTypeFloat, float&);
1535  ADD_MAP(m, totalSize, "satBiasFix[2]", satBiasFix[2], 0, DataTypeFloat, float&);
1536  ADD_MAP(m, totalSize, "satBiasFix[3]", satBiasFix[3], 0, DataTypeFloat, float&);
1537  ADD_MAP(m, totalSize, "satBiasFix[4]", satBiasFix[4], 0, DataTypeFloat, float&);
1538  ADD_MAP(m, totalSize, "satBiasFix[5]", satBiasFix[5], 0, DataTypeFloat, float&);
1539  ADD_MAP(m, totalSize, "satBiasFix[6]", satBiasFix[6], 0, DataTypeFloat, float&);
1540  ADD_MAP(m, totalSize, "satBiasFix[7]", satBiasFix[7], 0, DataTypeFloat, float&);
1541  ADD_MAP(m, totalSize, "satBiasFix[8]", satBiasFix[8], 0, DataTypeFloat, float&);
1542  ADD_MAP(m, totalSize, "satBiasFix[9]", satBiasFix[9], 0, DataTypeFloat, float&);
1543  ADD_MAP(m, totalSize, "satBiasFix[10]", satBiasFix[10], 0, DataTypeFloat, float&);
1544  ADD_MAP(m, totalSize, "satBiasFix[11]", satBiasFix[11], 0, DataTypeFloat, float&);
1545  ADD_MAP(m, totalSize, "satBiasFix[12]", satBiasFix[12], 0, DataTypeFloat, float&);
1546  ADD_MAP(m, totalSize, "satBiasFix[13]", satBiasFix[13], 0, DataTypeFloat, float&);
1547  ADD_MAP(m, totalSize, "satBiasFix[14]", satBiasFix[14], 0, DataTypeFloat, float&);
1548  ADD_MAP(m, totalSize, "satBiasFix[15]", satBiasFix[15], 0, DataTypeFloat, float&);
1549  ADD_MAP(m, totalSize, "satBiasFix[16]", satBiasFix[16], 0, DataTypeFloat, float&);
1550  ADD_MAP(m, totalSize, "satBiasFix[17]", satBiasFix[17], 0, DataTypeFloat, float&);
1551  ADD_MAP(m, totalSize, "satBiasFix[18]", satBiasFix[18], 0, DataTypeFloat, float&);
1552  ADD_MAP(m, totalSize, "satBiasFix[19]", satBiasFix[19], 0, DataTypeFloat, float&);
1553  ADD_MAP(m, totalSize, "satBiasFix[20]", satBiasFix[20], 0, DataTypeFloat, float&);
1554  ADD_MAP(m, totalSize, "satBiasFix[21]", satBiasFix[21], 0, DataTypeFloat, float&);
1555 
1556  ADD_MAP(m, totalSize, "qualL[0]", qualL[0], 0, DataTypeUInt8, uint8_t&);
1557  ADD_MAP(m, totalSize, "qualL[1]", qualL[1], 0, DataTypeUInt8, uint8_t&);
1558  ADD_MAP(m, totalSize, "qualL[2]", qualL[2], 0, DataTypeUInt8, uint8_t&);
1559  ADD_MAP(m, totalSize, "qualL[3]", qualL[3], 0, DataTypeUInt8, uint8_t&);
1560  ADD_MAP(m, totalSize, "qualL[4]", qualL[4], 0, DataTypeUInt8, uint8_t&);
1561  ADD_MAP(m, totalSize, "qualL[5]", qualL[5], 0, DataTypeUInt8, uint8_t&);
1562  ADD_MAP(m, totalSize, "qualL[6]", qualL[6], 0, DataTypeUInt8, uint8_t&);
1563  ADD_MAP(m, totalSize, "qualL[7]", qualL[7], 0, DataTypeUInt8, uint8_t&);
1564  ADD_MAP(m, totalSize, "qualL[8]", qualL[8], 0, DataTypeUInt8, uint8_t&);
1565  ADD_MAP(m, totalSize, "qualL[9]", qualL[9], 0, DataTypeUInt8, uint8_t&);
1566  ADD_MAP(m, totalSize, "qualL[10]", qualL[10], 0, DataTypeUInt8, uint8_t&);
1567  ADD_MAP(m, totalSize, "qualL[11]", qualL[11], 0, DataTypeUInt8, uint8_t&);
1568  ADD_MAP(m, totalSize, "qualL[12]", qualL[12], 0, DataTypeUInt8, uint8_t&);
1569  ADD_MAP(m, totalSize, "qualL[13]", qualL[13], 0, DataTypeUInt8, uint8_t&);
1570  ADD_MAP(m, totalSize, "qualL[14]", qualL[14], 0, DataTypeUInt8, uint8_t&);
1571  ADD_MAP(m, totalSize, "qualL[15]", qualL[15], 0, DataTypeUInt8, uint8_t&);
1572  ADD_MAP(m, totalSize, "qualL[16]", qualL[16], 0, DataTypeUInt8, uint8_t&);
1573  ADD_MAP(m, totalSize, "qualL[17]", qualL[17], 0, DataTypeUInt8, uint8_t&);
1574  ADD_MAP(m, totalSize, "qualL[18]", qualL[18], 0, DataTypeUInt8, uint8_t&);
1575  ADD_MAP(m, totalSize, "qualL[19]", qualL[19], 0, DataTypeUInt8, uint8_t&);
1576  ADD_MAP(m, totalSize, "qualL[20]", qualL[20], 0, DataTypeUInt8, uint8_t&);
1577  ADD_MAP(m, totalSize, "qualL[21]", qualL[21], 0, DataTypeUInt8, uint8_t&);
1578 
1579  ADD_MAP(m, totalSize, "sat[0]", sat[0], 0, DataTypeUInt8, uint8_t&);
1580  ADD_MAP(m, totalSize, "sat[1]", sat[1], 0, DataTypeUInt8, uint8_t&);
1581  ADD_MAP(m, totalSize, "sat[2]", sat[2], 0, DataTypeUInt8, uint8_t&);
1582  ADD_MAP(m, totalSize, "sat[3]", sat[3], 0, DataTypeUInt8, uint8_t&);
1583  ADD_MAP(m, totalSize, "sat[4]", sat[4], 0, DataTypeUInt8, uint8_t&);
1584  ADD_MAP(m, totalSize, "sat[5]", sat[5], 0, DataTypeUInt8, uint8_t&);
1585  ADD_MAP(m, totalSize, "sat[6]", sat[6], 0, DataTypeUInt8, uint8_t&);
1586  ADD_MAP(m, totalSize, "sat[7]", sat[7], 0, DataTypeUInt8, uint8_t&);
1587  ADD_MAP(m, totalSize, "sat[8]", sat[8], 0, DataTypeUInt8, uint8_t&);
1588  ADD_MAP(m, totalSize, "sat[9]", sat[9], 0, DataTypeUInt8, uint8_t&);
1589  ADD_MAP(m, totalSize, "sat[10]", sat[10], 0, DataTypeUInt8, uint8_t&);
1590  ADD_MAP(m, totalSize, "sat[11]", sat[11], 0, DataTypeUInt8, uint8_t&);
1591  ADD_MAP(m, totalSize, "sat[12]", sat[12], 0, DataTypeUInt8, uint8_t&);
1592  ADD_MAP(m, totalSize, "sat[13]", sat[13], 0, DataTypeUInt8, uint8_t&);
1593  ADD_MAP(m, totalSize, "sat[14]", sat[14], 0, DataTypeUInt8, uint8_t&);
1594  ADD_MAP(m, totalSize, "sat[15]", sat[15], 0, DataTypeUInt8, uint8_t&);
1595  ADD_MAP(m, totalSize, "sat[16]", sat[16], 0, DataTypeUInt8, uint8_t&);
1596  ADD_MAP(m, totalSize, "sat[17]", sat[17], 0, DataTypeUInt8, uint8_t&);
1597  ADD_MAP(m, totalSize, "sat[18]", sat[18], 0, DataTypeUInt8, uint8_t&);
1598  ADD_MAP(m, totalSize, "sat[19]", sat[19], 0, DataTypeUInt8, uint8_t&);
1599  ADD_MAP(m, totalSize, "sat[20]", sat[20], 0, DataTypeUInt8, uint8_t&);
1600  ADD_MAP(m, totalSize, "sat[21]", sat[21], 0, DataTypeUInt8, uint8_t&);
1601 
1602  ADD_MAP(m, totalSize, "satBiasStd[0]", satBiasStd[0], 0, DataTypeFloat, float&);
1603  ADD_MAP(m, totalSize, "satBiasStd[1]", satBiasStd[1], 0, DataTypeFloat, float&);
1604  ADD_MAP(m, totalSize, "satBiasStd[2]", satBiasStd[2], 0, DataTypeFloat, float&);
1605  ADD_MAP(m, totalSize, "satBiasStd[3]", satBiasStd[3], 0, DataTypeFloat, float&);
1606  ADD_MAP(m, totalSize, "satBiasStd[4]", satBiasStd[4], 0, DataTypeFloat, float&);
1607  ADD_MAP(m, totalSize, "satBiasStd[5]", satBiasStd[5], 0, DataTypeFloat, float&);
1608  ADD_MAP(m, totalSize, "satBiasStd[6]", satBiasStd[6], 0, DataTypeFloat, float&);
1609  ADD_MAP(m, totalSize, "satBiasStd[7]", satBiasStd[7], 0, DataTypeFloat, float&);
1610  ADD_MAP(m, totalSize, "satBiasStd[8]", satBiasStd[8], 0, DataTypeFloat, float&);
1611  ADD_MAP(m, totalSize, "satBiasStd[9]", satBiasStd[9], 0, DataTypeFloat, float&);
1612  ADD_MAP(m, totalSize, "satBiasStd[10]", satBiasStd[10], 0, DataTypeFloat, float&);
1613  ADD_MAP(m, totalSize, "satBiasStd[11]", satBiasStd[11], 0, DataTypeFloat, float&);
1614  ADD_MAP(m, totalSize, "satBiasStd[12]", satBiasStd[12], 0, DataTypeFloat, float&);
1615  ADD_MAP(m, totalSize, "satBiasStd[13]", satBiasStd[13], 0, DataTypeFloat, float&);
1616  ADD_MAP(m, totalSize, "satBiasStd[14]", satBiasStd[14], 0, DataTypeFloat, float&);
1617  ADD_MAP(m, totalSize, "satBiasStd[15]", satBiasStd[15], 0, DataTypeFloat, float&);
1618  ADD_MAP(m, totalSize, "satBiasStd[16]", satBiasStd[16], 0, DataTypeFloat, float&);
1619  ADD_MAP(m, totalSize, "satBiasStd[17]", satBiasStd[17], 0, DataTypeFloat, float&);
1620  ADD_MAP(m, totalSize, "satBiasStd[18]", satBiasStd[18], 0, DataTypeFloat, float&);
1621  ADD_MAP(m, totalSize, "satBiasStd[19]", satBiasStd[19], 0, DataTypeFloat, float&);
1622  ADD_MAP(m, totalSize, "satBiasStd[20]", satBiasStd[20], 0, DataTypeFloat, float&);
1623  ADD_MAP(m, totalSize, "satBiasStd[21]", satBiasStd[21], 0, DataTypeFloat, float&);
1624 
1625  ADD_MAP(m, totalSize, "satLockCnt[0]", satLockCnt[0], 0, DataTypeInt8, int8_t&);
1626  ADD_MAP(m, totalSize, "satLockCnt[1]", satLockCnt[1], 0, DataTypeInt8, int8_t&);
1627  ADD_MAP(m, totalSize, "satLockCnt[2]", satLockCnt[2], 0, DataTypeInt8, int8_t&);
1628  ADD_MAP(m, totalSize, "satLockCnt[3]", satLockCnt[3], 0, DataTypeInt8, int8_t&);
1629  ADD_MAP(m, totalSize, "satLockCnt[4]", satLockCnt[4], 0, DataTypeInt8, int8_t&);
1630  ADD_MAP(m, totalSize, "satLockCnt[5]", satLockCnt[5], 0, DataTypeInt8, int8_t&);
1631  ADD_MAP(m, totalSize, "satLockCnt[6]", satLockCnt[6], 0, DataTypeInt8, int8_t&);
1632  ADD_MAP(m, totalSize, "satLockCnt[7]", satLockCnt[7], 0, DataTypeInt8, int8_t&);
1633  ADD_MAP(m, totalSize, "satLockCnt[8]", satLockCnt[8], 0, DataTypeInt8, int8_t&);
1634  ADD_MAP(m, totalSize, "satLockCnt[9]", satLockCnt[9], 0, DataTypeInt8, int8_t&);
1635  ADD_MAP(m, totalSize, "satLockCnt[10]", satLockCnt[10], 0, DataTypeInt8, int8_t&);
1636  ADD_MAP(m, totalSize, "satLockCnt[11]", satLockCnt[11], 0, DataTypeInt8, int8_t&);
1637  ADD_MAP(m, totalSize, "satLockCnt[12]", satLockCnt[12], 0, DataTypeInt8, int8_t&);
1638  ADD_MAP(m, totalSize, "satLockCnt[13]", satLockCnt[13], 0, DataTypeInt8, int8_t&);
1639  ADD_MAP(m, totalSize, "satLockCnt[14]", satLockCnt[14], 0, DataTypeInt8, int8_t&);
1640  ADD_MAP(m, totalSize, "satLockCnt[15]", satLockCnt[15], 0, DataTypeInt8, int8_t&);
1641  ADD_MAP(m, totalSize, "satLockCnt[16]", satLockCnt[16], 0, DataTypeInt8, int8_t&);
1642  ADD_MAP(m, totalSize, "satLockCnt[17]", satLockCnt[17], 0, DataTypeInt8, int8_t&);
1643  ADD_MAP(m, totalSize, "satLockCnt[18]", satLockCnt[18], 0, DataTypeInt8, int8_t&);
1644  ADD_MAP(m, totalSize, "satLockCnt[19]", satLockCnt[19], 0, DataTypeInt8, int8_t&);
1645  ADD_MAP(m, totalSize, "satLockCnt[20]", satLockCnt[20], 0, DataTypeInt8, int8_t&);
1646  ADD_MAP(m, totalSize, "satLockCnt[21]", satLockCnt[21], 0, DataTypeInt8, int8_t&);
1647 
1648 #endif
1649 
1650  ADD_MAP(m, totalSize, "num_biases", num_biases, 0, DataTypeUInt8, uint8_t);
1651 }
1652 
1653 #endif // USE_IS_INTERNAL
1654 
1656 {
1673  //PopulateGPSCNOMappings(m_lookupInfo, DID_GPS1_SAT); // too much data, we don't want to log this
1674  //PopulateGPSCNOMappings(m_lookupInfo, DID_GPS2_SAT); // too much data, we don't want to log this
1688 // PopulateRtosInfoMappings(m_lookupInfo);
1691 
1692 #ifdef USE_IS_INTERNAL
1693 
1694  PopulateSensorsADCMappings(m_lookupInfo);
1695  PopulateSensorsISMappings(m_lookupInfo, DID_SENSORS_IS1);
1696  PopulateSensorsISMappings(m_lookupInfo, DID_SENSORS_IS2);
1697  PopulateSensorsTCMappings(m_lookupInfo);
1698  PopulateSensorsCompMappings(m_lookupInfo);
1699  PopulateDebugArrayMappings(m_lookupInfo);
1700  PopulateUserPage0Mappings(m_lookupInfo);
1701  PopulateUserPage1Mappings(m_lookupInfo);
1702  PopulateInl2MagObsInfo(m_lookupInfo);
1703  PopulateInl2StatesMappings(m_lookupInfo);
1704 // PopulateRtkStateMappings(m_lookupInfo);
1705 // PopulateRtkResidualMappings(m_lookupInfo, DID_RTK_CODE_RESIDUAL);
1706 // PopulateRtkResidualMappings(m_lookupInfo, DID_RTK_PHASE_RESIDUAL);
1707  PopulateRtkDebugMappings(m_lookupInfo);
1708  PopulateRtkDebug2Mappings(m_lookupInfo);
1712 
1713 #endif
1714 
1715  // this mustcome last
1716  for (uint32_t id = 0; id < DID_COUNT; id++)
1717  {
1719  }
1720 }
1721 
1722 
1724 {
1725 }
1726 
1727 
1728 const char* cISDataMappings::GetDataSetName(uint32_t dataId)
1729 {
1730  static const char* s_dataIdNames[] =
1731  {
1732  "null", // 0: DID_NULL
1733  "devInfo", // 1: DID_DEV_INFO,
1734  "sysFault", // 2: DID_SYS_FAULT
1735  "preintegratedImu", // 3: DID_PREINTEGRATED_IMU
1736  "ins1", // 4: DID_INS_1
1737  "ins2", // 5: DID_INS_2
1738  "gpsPos", // 6: DID_GPS1_POS
1739  "config", // 7: DID_SYS_CMD
1740  "ascii_msg", // 8: DID_ASCII_BCAST_PERIOD
1741  "misc", // 9: DID_INS_MISC
1742  "sysParams", // 10: DID_SYS_PARAMS
1743  "sysSensors", // 11: DID_SYS_SENSORS
1744  "flashCfg", // 12: DID_FLASH_CONFIG
1745  "gps1Pos", // 13: DID_GPS1_UBX_POS
1746  "gps2Pos", // 14: DID_GPS2_POS
1747  "gps1CNO", // 15: DID_GPS1_SAT
1748  "gps2CNO", // 16: DID_GPS2_SAT
1749  "gps1Version", // 17: DID_GPS1_VERSION
1750  "gps2Version", // 18: DID_GPS2_VERSION
1751  "magCal", // 19: DID_MAG_CAL
1752  "diagnosticInfo", // 20: DID_INTERNAL_DIAGNOSTIC
1753  "gpsRtkPosRel", // 21: DID_GPS1_RTK_POS_REL
1754  "gpsRtkPosMisc", // 22: DID_GPS1_RTK_POS_MISC
1755  "featureBits", // 23: DID_FEATURE_BITS
1756  "sensorIS1", // 24: DID_SENSORS_IS1
1757  "sensorIS2", // 25: DID_SENSORS_IS2
1758  "sensorTCbias", // 26: DID_SENSORS_TC_BIAS
1759  "ioServos", // 27: DID_IO
1760  "sensorLSB", // 28: DID_SENSORS_ADC
1761  "scomp", // 29: DID_SCOMP
1762  "gps1Vel", // 30: DID_GPS1_VEL
1763  "gps2Vel", // 31: DID_GPS2_VEL
1764  "hdwParams", // 32: DID_HDW_PARAMS
1765  "userPageNvr", // 33: DID_NVR_MANAGE_USERPAGE
1766  "userPageSn", // 34: DID_NVR_USERPAGE_SN
1767  "userpage0", // 35: DID_NVR_USERPAGE_G0
1768  "userpage1", // 36: DID_NVR_USERPAGE_G1
1769  "debugString", // 37: DID_DEBUG_STRING
1770  "rtosInfo", // 38: DID_RTOS_INFO
1771  "debugArray", // 39: DID_DEBUG_ARRAY
1772  "sensorCal1", // 40: DID_SENSORS_CAL1
1773  "sensorCal2", // 41: DID_SENSORS_CAL2
1774  "sensorCalSC", // 42: DID_CAL_SC
1775  "sensorCalSC1", // 43: DID_CAL_SC1
1776  "sensorCalSC2", // 44: DID_CAL_SC2
1777  "sensorSigma", // 45: DID_SYS_SENSORS_SIGMA
1778  "sensorAdcSigma", // 46: DID_SENSORS_ADC_SIGMA
1779  "insDev1", // 47: DID_INS_DEV_1
1780  "inl2States", // 48: DID_INL2_STATES
1781  "inl2CovarianceUD", // 49: DID_INL2_COVARIANCE_UD
1782  "inl2Status", // 50: DID_INL2_STATUS
1783  "inl2Misc", // 51: DID_INL2_MISC
1784  "magnetometer1", // 52: DID_MAGNETOMETER_1
1785  "barometer", // 53: DID_BAROMETER
1786  "gps1RtkPos", // 54: DID_GPS1_RTK_POS
1787  "magnetometer2", // 55: DID_MAGNETOMETER_2
1788  "commLoopback", // 56: DID_COMMUNICATIONS_LOOPBACK
1789  "imuDualRaw", // 57: DID_DUAL_IMU_RAW
1790  "imuDual", // 58: DID_DUAL_IMU
1791  "inl2MagObs", // 59: DID_INL2_MAG_OBS_INFO
1792  "gpsBaseRaw", // 60: DID_GPS_BASE_RAW
1793  "gpsRtkOptions", // 61: DID_GPS_RTK_OPT
1794  "userPageInternal", // 62: DID_NVR_USERPAGE_INTERNAL
1795  "manufacturingInfo", // 63: DID_MANUFACTURING_INFO
1796  "bit", // 64: DID_BIT
1797  "ins3", // 65: DID_INS_3
1798  "ins4", // 66: DID_INS_4
1799  "inl2NedSigma", // 67: DID_INL2_NED_SIGMA
1800  "strobeInTime", // 68: DID_STROBE_IN_TIME
1801  "gps1Raw", // 69: DID_GPS1_RAW
1802  "gps2Raw", // 70: DID_GPS2_RAW
1803  "wheelEncoder", // 71: DID_WHEEL_ENCODER
1804  "diagnosticMsg", // 72: DID_DIAGNOSTIC_MESSAGE
1805  "surveyIn", // 73: DID_SURVEY_IN
1806  "sensorCalSCInfo", // 74: DID_CAL_SC_INFO
1807  "portMonitor", // 75: DID_PORT_MONITOR
1808  "rtkState", // 76: DID_RTK_STATE
1809  "rtkPhaseResidual", // 77: DID_RTK_PHASE_RESIDUAL
1810  "rtkCodeResidual", // 78: DID_RTK_CODE_RESIDUAL
1811  "rtkDebug", // 79: DID_RTK_DEBUG
1812  "evbStatus", // 80: DID_EVB_STATUS
1813  "evbFlashCfg", // 81: DID_EVB_FLASH_CFG
1814  "evb2DebugArray", // 82: DID_EVB_DEBUG_ARRAY
1815  "evbRtosInfo", // 83: DID_EVB_RTOS_INFO
1816  "imu_mag_raw", // 84: DID_DUAL_IMU_RAW_MAG
1817  "imu_mag", // 85: DID_DUAL_IMU_MAG
1818  "pimu_mag", // 86: DID_PREINTEGRATED_IMU_MAG
1819  "wheelConfig", // 87: DID_WHEEL_CONFIG
1820  "positionMeasurement", // 88: DID_POSITION_MEASUREMENT
1821  "rtkDebug2", // 89: DID_RTK_DEBUG_2
1822  "canconfig", // 90:
1823  "gps2RtkCmpRel", // 91: DID_GPS2_RTK_CMP_REL
1824  "gps2RtkCmpMisc", // 92: DID_GPS2_RTK_CMP_MISC
1825  "unused_93", // 93:
1826  "unused_94", // 94:
1827  "unused_95" // 95:
1828  };
1829 
1830  STATIC_ASSERT(_ARRAY_ELEMENT_COUNT(s_dataIdNames) == DID_COUNT);
1831 
1832  if (dataId < DID_COUNT)
1833  {
1834  return s_dataIdNames[dataId];
1835  }
1836  return "unknown";
1837 }
1838 
1839 
1841 {
1842 
1843 #if PLATFORM_IS_EMBEDDED
1844 
1845  if (s_map == NULLPTR)
1846  {
1847  s_map = new cISDataMappings();
1848  }
1849 
1850 #endif
1851 
1852  if (dataId < DID_COUNT)
1853  {
1854 
1855 #if PLATFORM_IS_EMBEDDED
1856 
1857  return &s_map->m_lookupInfo[dataId];
1858 
1859 #else
1860 
1861  return &s_map.m_lookupInfo[dataId];
1862 
1863 #endif
1864 
1865  }
1866  return NULLPTR;
1867 }
1868 
1869 
1870 uint32_t cISDataMappings::GetSize(uint32_t dataId)
1871 {
1872 
1873 #if PLATFORM_IS_EMBEDDED
1874 
1875  if (s_map == NULLPTR)
1876  {
1877  s_map = new cISDataMappings();
1878  }
1879 
1880 #endif
1881 
1882 #if PLATFORM_IS_EMBEDDED
1883 
1884  return (dataId < DID_MAX_COUNT ? s_map->m_lookupSize[dataId] : 0);
1885 
1886 #else
1887 
1888  return (dataId < DID_MAX_COUNT ? s_map.m_lookupSize[dataId] : 0);
1889 
1890 #endif
1891 
1892 }
1893 
1894 
1895 bool cISDataMappings::StringToData(const char* stringBuffer, int stringLength, const p_data_hdr_t* hdr, uint8_t* dataBuffer, const data_info_t& info, int radix, bool json)
1896 {
1897  const uint8_t* ptr;
1898  if (!CanGetFieldData(info, hdr, dataBuffer, ptr))
1899  {
1900  return false;
1901  }
1902 
1903  switch (info.dataType)
1904  {
1905  case DataTypeInt8:
1906  *(int8_t*)ptr = (int8_t)strtol(stringBuffer, NULL, radix);
1907  break;
1908 
1909  case DataTypeUInt8:
1910  *(uint8_t*)ptr = (uint8_t)strtoul(stringBuffer, NULL, radix);
1911  break;
1912 
1913  case DataTypeInt16:
1914  *(int16_t*)ptr = (int16_t)strtol(stringBuffer, NULL, radix);
1915  break;
1916 
1917  case DataTypeUInt16:
1918  *(uint16_t*)ptr = (uint16_t)strtoul(stringBuffer, NULL, radix);
1919  break;
1920 
1921  case DataTypeInt32:
1922  *(int32_t*)ptr = (int32_t)strtol(stringBuffer, NULL, radix);
1923  break;
1924 
1925  case DataTypeUInt32:
1926  *(uint32_t*)ptr = (uint32_t)strtoul(stringBuffer, NULL, radix);
1927  break;
1928 
1929  case DataTypeInt64:
1930  *(int64_t*)ptr = (int64_t)strtoll(stringBuffer, NULL, radix);
1931  break;
1932 
1933  case DataTypeUInt64:
1934  *(uint64_t*)ptr = (uint64_t)strtoull(stringBuffer, NULL, radix);
1935  break;
1936 
1937  case DataTypeFloat:
1938  *(float*)ptr = strtof(stringBuffer, NULL);
1939  break;
1940 
1941  case DataTypeDouble:
1942  *(double*)ptr = strtod(stringBuffer, NULL);
1943  break;
1944 
1945  case DataTypeString:
1946  {
1947  string s2(stringBuffer);
1948  if (json)
1949  {
1950  char c;
1951  bool escaped = false;
1952  for (size_t i = 0; i < s2.size(); i++)
1953  {
1954  c = s2[i];
1955  if (c == '\\')
1956  {
1957  if (!escaped)
1958  {
1959  escaped = true;
1960  s2.erase(i);
1961  continue;
1962  }
1963  }
1964  escaped = false;
1965  }
1966  s2 = stringBuffer;
1967  }
1968  else
1969  {
1970  s2.erase(std::remove(s2.begin(), s2.end(), '"'), s2.end());
1971  }
1972  // ensure string fits with null terminator
1973  s2.resize(info.dataSize - 1);
1974  memcpy((void*)ptr, s2.data(), s2.length());
1975  memset((uint8_t*)ptr + s2.length(), 0, info.dataSize - s2.length());
1976  } break;
1977 
1978  case DataTypeBinary:
1979  {
1980  // convert hex data back to binary
1981  size_t len = _MIN(1020, stringLength);
1982  len -= (len % 2);
1983  uint8_t* ptr2 = (uint8_t*)ptr;
1984  for (size_t i = 0; i != len; i += 2)
1985  {
1986  *ptr2 = (getHexValue(stringBuffer[i + 1]) << 4) | getHexValue(stringBuffer[i + 2]);
1987  }
1988  } break;
1989 
1990  default:
1991  return false;
1992  }
1993 
1994  return true;
1995 }
1996 
1997 
1998 bool cISDataMappings::DataToString(const data_info_t& info, const p_data_hdr_t* hdr, const uint8_t* dataBuffer, data_mapping_string_t stringBuffer, bool json)
1999 {
2000  const uint8_t* ptr;
2001  if (!CanGetFieldData(info, hdr, dataBuffer, ptr))
2002  {
2003  // pick a default string
2004  if (info.dataType == DataTypeString)
2005  {
2006  stringBuffer[0] = '"';
2007  stringBuffer[1] = '"';
2008  stringBuffer[2] = '\0';
2009  }
2010  else if (info.dataType == DataTypeBinary)
2011  {
2012  if (json)
2013  {
2014  stringBuffer[0] = '"';
2015  stringBuffer[1] = '"';
2016  stringBuffer[2] = '\0';
2017  }
2018  else
2019  {
2020  stringBuffer[0] = '\0';
2021  }
2022  }
2023  else
2024  {
2025  stringBuffer[0] = '0';
2026  stringBuffer[1] = '\0';
2027  }
2028  return false;
2029  }
2030 
2031  switch (info.dataType)
2032  {
2033  case DataTypeInt8:
2034  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%d", (int)*(int8_t*)ptr);
2035  break;
2036 
2037  case DataTypeUInt8:
2038  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%u", (unsigned int)*(uint8_t*)ptr);
2039  break;
2040 
2041  case DataTypeInt16:
2042  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%d", (int)*(int16_t*)ptr);
2043  break;
2044 
2045  case DataTypeUInt16:
2046  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%u", (unsigned int)*(uint16_t*)ptr);
2047  break;
2048 
2049  case DataTypeInt32:
2050  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%d", (int)*(int32_t*)ptr);
2051  break;
2052 
2053  case DataTypeUInt32:
2054  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%u", (unsigned int)*(uint32_t*)ptr);
2055  break;
2056 
2057  case DataTypeInt64:
2058  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%lld", (long long)*(int64_t*)ptr);
2059  break;
2060 
2061  case DataTypeUInt64:
2062  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%llu", (unsigned long long)*(uint64_t*)ptr);
2063  break;
2064 
2065  case DataTypeFloat:
2066  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%.9g", *(float*)ptr);
2067  break;
2068 
2069  case DataTypeDouble:
2070  SNPRINTF(stringBuffer, IS_DATA_MAPPING_MAX_STRING_LENGTH, "%.17g", *(double*)ptr);
2071  break;
2072 
2073  case DataTypeString:
2074  {
2075  stringBuffer[0] = '"';
2076  int tempIndex = 1;
2077  char* bufPtr2 = (char*)(dataBuffer + info.dataOffset);
2078  char* bufPtrEnd = bufPtr2 + _MIN(IS_DATA_MAPPING_MAX_STRING_LENGTH, info.dataSize) - 3;
2079  for (; bufPtr2 < bufPtrEnd && *bufPtr2 != '\0'; bufPtr2++)
2080  {
2081  if (json)
2082  {
2083  if (IS_JSON_ESCAPE_CHAR(*bufPtr2))
2084  {
2085  if (bufPtr2 < bufPtrEnd - 1)
2086  {
2087  stringBuffer[tempIndex++] = '\\';
2088  }
2089  else
2090  {
2091  break;
2092  }
2093  }
2094  }
2095  stringBuffer[tempIndex++] = *bufPtr2;
2096  }
2097  stringBuffer[tempIndex++] = '"';
2098  stringBuffer[tempIndex] = '\0';
2099  } break;
2100 
2101  case DataTypeBinary:
2102  {
2103  size_t hexIndex = 1;
2104  if (json)
2105  {
2106  stringBuffer[0] = '"';
2107  }
2108  // convert to hex
2109  const unsigned char* hexTable = getHexLookupTable();
2110  for (size_t i = 0; i < info.dataSize; i++)
2111  {
2112  stringBuffer[hexIndex++] = hexTable[0x0F & (dataBuffer[i] >> 4)];
2113  stringBuffer[hexIndex++] = hexTable[0x0F & dataBuffer[i]];
2114  }
2115  if (json)
2116  {
2117  stringBuffer[hexIndex++] = '"';
2118  }
2119  stringBuffer[hexIndex] = '\0';
2120  } break;
2121 
2122  default:
2123  stringBuffer[0] = '\0';
2124  return false;
2125  }
2126  return true;
2127 }
2128 
2129 double cISDataMappings::GetTimestamp(const p_data_hdr_t* hdr, const uint8_t* buf)
2130 {
2131  if (hdr == NULL || buf == NULL || hdr->id == 0 || hdr->id >= DID_COUNT || hdr->size == 0)
2132  {
2133  return 0.0;
2134  }
2135 
2136  // raw data types with observation use a custom timestamp function
2137  if (hdr->id == DID_GPS1_RAW || hdr->id == DID_GPS2_RAW || hdr->id == DID_GPS_BASE_RAW)
2138  {
2139  gps_raw_t* raw = (gps_raw_t*)buf;
2141  {
2142  const obsd_t& obs = raw->data.obs[0];
2143  return obs.time.sec + (double)obs.time.time;
2144  }
2145  return 0.0;
2146  }
2147 
2148 #if PLATFORM_IS_EMBEDDED
2149 
2150  if (s_map == NULLPTR)
2151  {
2152  s_map = new cISDataMappings();
2153  }
2154 
2155 #endif
2156 
2157  const data_info_t* timeStampField =
2158 
2159 #if PLATFORM_IS_EMBEDDED
2160 
2161  s_map->m_timestampFields[hdr->id];
2162 
2163 #else
2164 
2165  s_map.m_timestampFields[hdr->id];
2166 
2167 #endif
2168 
2169  if (timeStampField != NULLPTR)
2170  {
2171  const uint8_t* ptr;
2172  if (CanGetFieldData(*timeStampField, hdr, (uint8_t*)buf, ptr))
2173  {
2174  if (timeStampField->dataType == DataTypeDouble)
2175  {
2176  // field is seconds, use as is
2177  return *(double*)ptr;
2178  }
2179  else if (timeStampField->dataType == DataTypeUInt32)
2180  {
2181  // field is milliseconds, convert to seconds
2182  return 0.001 * (*(uint32_t*)ptr);
2183  }
2184  }
2185  }
2186  return 0.0;
2187 }
2188 
2189 bool cISDataMappings::CanGetFieldData(const data_info_t& info, const p_data_hdr_t* hdr, const uint8_t* buf, const uint8_t*& ptr)
2190 {
2191  if (buf == NULL)
2192  {
2193  return false;
2194  }
2195  else if (hdr == NULL)
2196  {
2197  // assume buf is large enough for the full data structure
2198  ptr = buf + info.dataOffset;
2199  return true;
2200  }
2201  int32_t fullSize = (hdr->size == 0 ? GetSize(hdr->id) : hdr->size);
2202  int32_t offset = (int32_t)info.dataOffset - (int32_t)hdr->offset;
2203  if (offset >= 0 && offset <= fullSize - (int32_t)info.dataSize)
2204  {
2205  ptr = (buf + offset);
2206  return true;
2207  }
2208  ptr = NULL;
2209  return false;
2210 }
#define _MIN(a, b)
Definition: ISConstants.h:298
static bool IS_JSON_ESCAPE_CHAR(char c)
Definition: DataJSON.h:25
static void PopulateFlashConfigMappings(map_name_to_info_t mappings[DID_COUNT])
#define DID_DUAL_IMU
Definition: data_sets.h:92
struct PACKED can_config_t
static const char * GetDataSetName(uint32_t dataId)
static const map_name_to_info_t * GetMapInfo(uint32_t dataId)
static void PopulateConfigMappings(map_name_to_info_t mappings[DID_COUNT])
#define ASSERT_SIZE(s)
struct PACKED rtk_residual_t
uint32_t GetDataTypeSize(eDataType dataType)
static void PopulateGpsRawMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
static void PopulateIMUMagnetometerMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
struct PACKED debug_array_t
static void PopulateGPSCNOMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
#define DID_RTK_DEBUG_2
Definition: data_sets.h:123
struct PACKED gps_pos_t
struct PACKED gps_sat_t
float f_t
Definition: ISConstants.h:786
static void PopulateBarometerMappings(map_name_to_info_t mappings[DID_COUNT])
f
#define DEVINFO_MANUFACTURER_STRLEN
Definition: data_sets.h:149
#define DID_GPS1_VEL
Definition: data_sets.h:64
static void PopulateCanConfigMappings(map_name_to_info_t mappings[DID_COUNT])
uint32_t dataSize
Definition: DataCSV.h:50
uint32_t id
Definition: ISComm.h:375
#define DID_INS_1
Definition: data_sets.h:38
struct PACKED inl2_status_t
uint32_t size
Definition: ISComm.h:378
static void PopulateRtosInfoMappings(map_name_to_info_t mappings[DID_COUNT])
#define DEVINFO_ADDINFO_STRLEN
Definition: data_sets.h:150
CONST_EXPRESSION uint32_t s_eDataTypeSizes[DataTypeCount]
#define DID_GPS2_RTK_CMP_REL
Definition: data_sets.h:125
#define DID_SENSORS_IS2
Definition: data_sets.h:59
uint32_t dataOffset
Definition: DataCSV.h:49
obsd_t obs[MAX_OBSERVATION_COUNT_IN_RTK_MESSAGE]
Definition: data_sets.h:2766
uGpsRawData data
Definition: data_sets.h:2803
#define DID_DUAL_IMU_MAG
Definition: data_sets.h:119
#define DID_GPS1_UBX_POS
Definition: data_sets.h:40
static void PopulateRtkMiscMappings(map_name_to_info_t mappings[DID_COUNT])
size_t count(InputIterator first, InputIterator last, T const &item)
Definition: catch.hpp:3206
#define DID_SCOMP
Definition: data_sets.h:63
struct PACKED wheel_encoder_t
struct PACKED ins_1_t
#define DID_COUNT
Definition: data_sets.h:138
struct PACKED sys_params_t
#define DID_DEV_INFO
Definition: data_sets.h:35
#define DID_INS_2
Definition: data_sets.h:39
uint32_t m_lookupSize[DID_COUNT]
static void PopulateIMUDeltaThetaVelocityMappings(map_name_to_info_t mappings[DID_COUNT])
#define NULL
Definition: nm_bsp.h:52
static cISDataMappings s_map
struct PACKED rtos_info_t
struct PACKED sys_sensors_adc_t
#define DID_GPS2_VERSION
Definition: data_sets.h:52
static void PopulateSysSensorsMappings(map_name_to_info_t mappings[DID_COUNT])
#define DID_PREINTEGRATED_IMU
Definition: data_sets.h:37
struct PACKED dual_imu_t
#define DID_SYS_PARAMS
Definition: data_sets.h:44
#define DID_INL2_MISC
Definition: data_sets.h:85
#define DID_PREINTEGRATED_IMU_MAG
Definition: data_sets.h:120
struct PACKED gps_rtk_misc_t
#define DID_SENSORS_TC_BIAS
Definition: data_sets.h:60
#define DID_GPS_BASE_RAW
Definition: data_sets.h:94
#define NULLPTR
Definition: ISConstants.h:426
#define CONST_EXPRESSION
Definition: ISConstants.h:411
#define MEMBERSIZE(type, member)
Definition: ISConstants.h:334
struct PACKED strobe_in_time_t
#define DID_MAGNETOMETER_2
Definition: data_sets.h:89
const unsigned char * getHexLookupTable()
static bool StringToData(const char *stringBuffer, int stringLength, const p_data_hdr_t *hdr, uint8_t *dataBuffer, const data_info_t &info, int radix=10, bool json=false)
char data_mapping_string_t[IS_DATA_MAPPING_MAX_STRING_LENGTH]
static double GetTimestamp(const p_data_hdr_t *hdr, const uint8_t *buf)
struct PACKED inl2_mag_obs_info_t
static void PopulateDeviceInfoMappings(map_name_to_info_t mappings[DID_COUNT])
static void PopulateINS1Mappings(map_name_to_info_t mappings[DID_COUNT])
#define DID_GPS1_VERSION
Definition: data_sets.h:51
#define DID_GPS1_SAT
Definition: data_sets.h:49
def hdwStatus(hstatus)
Hardware Status #####.
static void PopulateGpsPosMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
map_name_to_info_t m_lookupInfo[DID_COUNT]
ROSLIB_DECL std::string command(const std::string &cmd)
struct PACKED inl2_states_t
#define DID_CAN_CONFIG
Definition: data_sets.h:124
#define DID_SYS_CMD
Definition: data_sets.h:41
#define DID_GPS2_RAW
Definition: data_sets.h:104
uint8_t getHexValue(unsigned char hex)
#define DID_NVR_USERPAGE_G1
Definition: data_sets.h:70
static void PopulateIMUMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t dataId)
#define DID_SENSORS_IS1
Definition: data_sets.h:58
struct PACKED ins_3_t
#define DID_GPS2_RTK_CMP_MISC
Definition: data_sets.h:126
#define DID_GPS1_RAW
Definition: data_sets.h:103
#define DID_FLASH_CONFIG
Definition: data_sets.h:46
struct PACKED gps_version_t
const unsigned char g_asciiToLowerMap[256]
static bool CanGetFieldData(const data_info_t &info, const p_data_hdr_t *hdr, const uint8_t *buf, const uint8_t *&ptr)
#define DID_RTK_DEBUG
Definition: data_sets.h:113
#define DID_GPS2_POS
Definition: data_sets.h:48
#define DID_DIAGNOSTIC_MESSAGE
Definition: data_sets.h:106
struct PACKED preintegrated_imu_t
static void PopulateStrobeInTimeMappings(map_name_to_info_t mappings[DID_COUNT])
static uint32_t GetSize(uint32_t dataId)
static void PopulateTimestampField(uint32_t id, const data_info_t **timestamps, map_name_to_info_t mappings[DID_COUNT])
static void PopulateINS2Mappings(map_name_to_info_t mappings[DID_COUNT], uint32_t did)
const data_info_t * m_timestampFields[DID_COUNT]
#define IS_DATA_MAPPING_MAX_STRING_LENGTH
Definition: DataCSV.h:24
static void PopulateMagnetometerMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
#define NUMSATSOL
Definition: data_sets.h:3654
#define DID_MAGNETOMETER_1
Definition: data_sets.h:86
#define SNPRINTF
Definition: ISConstants.h:146
#define DID_RTK_CODE_RESIDUAL
Definition: data_sets.h:112
struct PACKED barometer_t
USBInterfaceDescriptor data
def insStatus(istatus)
INS Status #####.
#define DID_DUAL_IMU_RAW_MAG
Definition: data_sets.h:118
uint16_t reserved
struct PACKED gps_rtk_rel_t
struct PACKED nvm_flash_cfg_t
#define MAX_TASK_NAME_LEN
Definition: data_sets.h:3286
#define DID_GPS1_POS
Definition: data_sets.h:47
static void PopulateWheelEncoderMappings(map_name_to_info_t mappings[DID_COUNT])
struct PACKED sys_sensors_t
static void PopulateSysParamsMappings(map_name_to_info_t mappings[DID_COUNT])
static void PopulateSizeMappings(uint32_t sizeMap[DID_COUNT])
virtual ~cISDataMappings()
#define DID_SYS_SENSORS
Definition: data_sets.h:45
static bool DataToString(const data_info_t &info, const p_data_hdr_t *hdr, const uint8_t *dataBuffer, data_mapping_string_t stringBuffer, bool json=false)
#define DID_INL2_MAG_OBS_INFO
Definition: data_sets.h:93
#define DID_GPS2_SAT
Definition: data_sets.h:50
#define DID_INS_3
Definition: data_sets.h:99
#define DID_DUAL_IMU_RAW
Definition: data_sets.h:91
#define STATIC_ASSERT(exp)
Definition: ISConstants.h:416
struct PACKED pimu_mag_t
#define DID_WHEEL_ENCODER
Definition: data_sets.h:105
#define DID_GPS1_RTK_POS
Definition: data_sets.h:88
static void PopulateDiagMsgMappings(map_name_to_info_t mappings[DID_COUNT])
struct PACKED magnetometer_t
struct PACKED system_command_t
static void PopulateRtkRelMappings(map_name_to_info_t mappings[DID_COUNT])
#define DID_STROBE_IN_TIME
Definition: data_sets.h:102
map< string, data_info_t, sCaseInsensitiveCompare > map_name_to_info_t
#define DID_INL2_STATUS
Definition: data_sets.h:84
struct PACKED gps_raw_t
static void PopulateIMUDeltaThetaVelocityMagMappings(map_name_to_info_t mappings[DID_COUNT])
eDataType dataType
Definition: DataCSV.h:51
struct PACKED ins_4_t
#define DID_NVR_USERPAGE_G0
Definition: data_sets.h:69
#define DID_GPS1_RTK_POS_REL
Definition: data_sets.h:55
struct PACKED ins_2_t
struct PACKED gps_vel_t
static void PopulateINS4Mappings(map_name_to_info_t mappings[DID_COUNT])
uint8_t obsCount
Definition: data_sets.h:2797
#define _ARRAY_ELEMENT_COUNT(a)
Definition: ISConstants.h:326
is_can_time time
Definition: CAN_comm.h:252
struct PACKED rtk_debug_t
struct PACKED dev_info_t
uint8_t dataType
Definition: data_sets.h:2794
uint32_t offset
Definition: ISComm.h:381
#define DID_DEBUG_ARRAY
Definition: data_sets.h:73
#define DID_INS_4
Definition: data_sets.h:100
eDataType
Definition: DataCSV.h:26
struct PACKED imu_mag_t
#define DID_BAROMETER
Definition: data_sets.h:87
#define DID_RTOS_INFO
Definition: data_sets.h:72
#define DID_GPS2_VEL
Definition: data_sets.h:65
#define ADD_MAP(map, totalSize, name, member, dataSize, dataType, memberType)
#define DID_INL2_STATES
Definition: data_sets.h:82
#define DID_MAX_COUNT
Definition: data_sets.h:141
static void PopulateGpsVelMappings(map_name_to_info_t mappings[DID_COUNT], uint32_t id)
#define DID_RTK_PHASE_RESIDUAL
Definition: data_sets.h:111
#define DID_GPS1_RTK_POS_MISC
Definition: data_sets.h:56
#define DID_SENSORS_ADC
Definition: data_sets.h:62


inertial_sense_ros
Author(s):
autogenerated on Sat Sep 19 2020 03:19:04