MIP_SDK  latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
data_shared.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <mip/mip_descriptors.h>
5 #include <mip/mip_result.h>
6 #include <mip/mip_interface.h>
7 
8 #include <stdint.h>
9 #include <stddef.h>
10 #include <stdbool.h>
11 
12 #ifdef __cplusplus
13 namespace mip {
14 namespace C {
15 extern "C" {
16 
17 #endif // __cplusplus
18 
25 
27 // Descriptors
29 
30 enum
31 {
33 
34 
45 };
46 
48 // Shared Type Definitions
50 
52 
54 // Mip Fields
56 
65 
67 {
68  uint8_t trigger_id;
69 };
71 
75 
76 
87 
89 {
90  uint32_t ticks;
91 };
93 
96 bool extract_mip_shared_ticks_data_from_field(const mip_field_view* field, void* ptr);
97 
98 
110 
112 {
113  uint32_t ticks;
114 };
116 
120 
121 
132 
134 static const mip_shared_gps_timestamp_data_valid_flags MIP_SHARED_GPS_TIMESTAMP_DATA_VALID_FLAGS_NONE = 0x0000;
135 static const mip_shared_gps_timestamp_data_valid_flags MIP_SHARED_GPS_TIMESTAMP_DATA_VALID_FLAGS_TOW = 0x0001;
136 static const mip_shared_gps_timestamp_data_valid_flags MIP_SHARED_GPS_TIMESTAMP_DATA_VALID_FLAGS_WEEK_NUMBER = 0x0002;
137 static const mip_shared_gps_timestamp_data_valid_flags MIP_SHARED_GPS_TIMESTAMP_DATA_VALID_FLAGS_TIME_VALID = 0x0003;
138 static const mip_shared_gps_timestamp_data_valid_flags MIP_SHARED_GPS_TIMESTAMP_DATA_VALID_FLAGS_ALL = 0x0003;
139 static inline void insert_mip_shared_gps_timestamp_data_valid_flags(microstrain_serializer* serializer, const mip_shared_gps_timestamp_data_valid_flags self)
140 {
141  microstrain_insert_u16(serializer, (uint16_t)(self));
142 }
143 static inline void extract_mip_shared_gps_timestamp_data_valid_flags(microstrain_serializer* serializer, mip_shared_gps_timestamp_data_valid_flags* self)
144 {
145  uint16_t tmp = 0;
146  microstrain_extract_u16(serializer, &tmp);
147  *self = tmp;
148 }
149 
150 
152 {
153  double tow;
154  uint16_t week_number;
156 };
158 
162 
163 
180 
182 {
183  double seconds;
184 };
186 
190 
191 
206 
208 {
209  uint64_t nanoseconds;
210 };
212 
216 
217 
234 
236 {
237  uint64_t dt_nanos;
238 };
240 
244 
245 
261 
263 static const mip_shared_external_timestamp_data_valid_flags MIP_SHARED_EXTERNAL_TIMESTAMP_DATA_VALID_FLAGS_NONE = 0x0000;
264 static const mip_shared_external_timestamp_data_valid_flags MIP_SHARED_EXTERNAL_TIMESTAMP_DATA_VALID_FLAGS_NANOSECONDS = 0x0001;
265 static const mip_shared_external_timestamp_data_valid_flags MIP_SHARED_EXTERNAL_TIMESTAMP_DATA_VALID_FLAGS_ALL = 0x0001;
266 static inline void insert_mip_shared_external_timestamp_data_valid_flags(microstrain_serializer* serializer, const mip_shared_external_timestamp_data_valid_flags self)
267 {
268  microstrain_insert_u16(serializer, (uint16_t)(self));
269 }
270 static inline void extract_mip_shared_external_timestamp_data_valid_flags(microstrain_serializer* serializer, mip_shared_external_timestamp_data_valid_flags* self)
271 {
272  uint16_t tmp = 0;
273  microstrain_extract_u16(serializer, &tmp);
274  *self = tmp;
275 }
276 
277 
279 {
280  uint64_t nanoseconds;
282 };
284 
288 
289 
309 
311 static const mip_shared_external_time_delta_data_valid_flags MIP_SHARED_EXTERNAL_TIME_DELTA_DATA_VALID_FLAGS_NONE = 0x0000;
312 static const mip_shared_external_time_delta_data_valid_flags MIP_SHARED_EXTERNAL_TIME_DELTA_DATA_VALID_FLAGS_DT_NANOS = 0x0001;
313 static const mip_shared_external_time_delta_data_valid_flags MIP_SHARED_EXTERNAL_TIME_DELTA_DATA_VALID_FLAGS_ALL = 0x0001;
314 static inline void insert_mip_shared_external_time_delta_data_valid_flags(microstrain_serializer* serializer, const mip_shared_external_time_delta_data_valid_flags self)
315 {
316  microstrain_insert_u16(serializer, (uint16_t)(self));
317 }
318 static inline void extract_mip_shared_external_time_delta_data_valid_flags(microstrain_serializer* serializer, mip_shared_external_time_delta_data_valid_flags* self)
319 {
320  uint16_t tmp = 0;
321  microstrain_extract_u16(serializer, &tmp);
322  *self = tmp;
323 }
324 
325 
327 {
328  uint64_t dt_nanos;
330 };
332 
336 
337 
340 
345 #ifdef __cplusplus
346 } // extern "C"
347 } // namespace C
348 } // namespace mip
349 #endif // __cplusplus
350 
mip::C::extract_mip_shared_ticks_data
void extract_mip_shared_ticks_data(microstrain_serializer *serializer, mip_shared_ticks_data *self)
Definition: data_shared.c:47
mip::C::mip_shared_gps_timestamp_data::valid_flags
mip_shared_gps_timestamp_data_valid_flags valid_flags
Definition: data_shared.h:155
mip::C::MIP_DATA_DESC_SHARED_GPS_TIME
@ MIP_DATA_DESC_SHARED_GPS_TIME
Definition: data_shared.h:38
mip::C::insert_mip_shared_reference_timestamp_data
void insert_mip_shared_reference_timestamp_data(microstrain_serializer *serializer, const mip_shared_reference_timestamp_data *self)
Definition: data_shared.c:130
mip::C::insert_mip_shared_reference_time_delta_data
void insert_mip_shared_reference_time_delta_data(microstrain_serializer *serializer, const mip_shared_reference_time_delta_data *self)
Definition: data_shared.c:150
mip::C::extract_mip_shared_delta_time_data
void extract_mip_shared_delta_time_data(microstrain_serializer *serializer, mip_shared_delta_time_data *self)
Definition: data_shared.c:115
mip
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
mip::C::insert_mip_shared_ticks_data
void insert_mip_shared_ticks_data(microstrain_serializer *serializer, const mip_shared_ticks_data *self)
Definition: data_shared.c:42
mip::C::insert_mip_shared_delta_time_data
void insert_mip_shared_delta_time_data(microstrain_serializer *serializer, const mip_shared_delta_time_data *self)
Definition: data_shared.c:110
mip::C::extract_mip_shared_external_timestamp_data
void extract_mip_shared_external_timestamp_data(microstrain_serializer *serializer, mip_shared_external_timestamp_data *self)
Definition: data_shared.c:177
mip::C::mip_shared_reference_time_delta_data
Definition: data_shared.h:235
mip::C::mip_shared_external_time_delta_data::valid_flags
mip_shared_external_time_delta_data_valid_flags valid_flags
Definition: data_shared.h:329
mip::C::mip_shared_delta_ticks_data
Definition: data_shared.h:111
mip::C::mip_shared_event_source_data
Definition: data_shared.h:66
microstrain::C::microstrain_extract_u16
void microstrain_extract_u16(microstrain_serializer *serializer, uint16_t *value)
mip::C::mip_shared_external_time_delta_data
Definition: data_shared.h:326
mip::C::extract_mip_shared_reference_timestamp_data
void extract_mip_shared_reference_timestamp_data(microstrain_serializer *serializer, mip_shared_reference_timestamp_data *self)
Definition: data_shared.c:135
mip::C::MIP_DATA_DESC_SHARED_DELTA_TIME
@ MIP_DATA_DESC_SHARED_DELTA_TIME
Definition: data_shared.h:39
mip::C::mip_shared_delta_ticks_data::ticks
uint32_t ticks
Ticks since last output.
Definition: data_shared.h:113
mip::C::insert_mip_shared_external_time_delta_data
void insert_mip_shared_external_time_delta_data(microstrain_serializer *serializer, const mip_shared_external_time_delta_data *self)
Definition: data_shared.c:194
mip::C::mip_shared_reference_timestamp_data
Definition: data_shared.h:207
mip::C::mip_shared_gps_timestamp_data_valid_flags
uint16_t mip_shared_gps_timestamp_data_valid_flags
Definition: data_shared.h:133
microstrain::C::microstrain_serializer
struct microstrain::C::microstrain_serializer microstrain_serializer
Structure used for serialization.
mip::C::MIP_SHARED_DATA_DESC_SET
@ MIP_SHARED_DATA_DESC_SET
Definition: data_shared.h:32
mip::C::extract_mip_shared_external_time_delta_data
void extract_mip_shared_external_time_delta_data(microstrain_serializer *serializer, mip_shared_external_time_delta_data *self)
Definition: data_shared.c:201
mip_result.h
mip::C::mip_shared_delta_time_data
Definition: data_shared.h:181
mip::C::insert_mip_shared_gps_timestamp_data
void insert_mip_shared_gps_timestamp_data(microstrain_serializer *serializer, const mip_shared_gps_timestamp_data *self)
Definition: data_shared.c:82
mip::C::extract_mip_shared_reference_time_delta_data
void extract_mip_shared_reference_time_delta_data(microstrain_serializer *serializer, mip_shared_reference_time_delta_data *self)
Definition: data_shared.c:155
mip::C::extract_mip_shared_ticks_data_from_field
bool extract_mip_shared_ticks_data_from_field(const mip_field_view *field, void *ptr)
Definition: data_shared.c:52
mip::C::MIP_DATA_DESC_SHARED_REF_TIME_DELTA
@ MIP_DATA_DESC_SHARED_REF_TIME_DELTA
Definition: data_shared.h:41
mip::C::mip_shared_external_time_delta_data::dt_nanos
uint64_t dt_nanos
Nanoseconds since the last occurrence of this field in a packet of the same descriptor set and event ...
Definition: data_shared.h:328
mip::C::extract_mip_shared_reference_time_delta_data_from_field
bool extract_mip_shared_reference_time_delta_data_from_field(const mip_field_view *field, void *ptr)
Definition: data_shared.c:160
microstrain::C::microstrain_serializer
Structure used for serialization.
Definition: serialization.h:42
mip::C::extract_mip_shared_delta_ticks_data
void extract_mip_shared_delta_ticks_data(microstrain_serializer *serializer, mip_shared_delta_ticks_data *self)
Definition: data_shared.c:67
mip::C::MIP_DATA_DESC_SHARED_EXTERNAL_TIME
@ MIP_DATA_DESC_SHARED_EXTERNAL_TIME
Definition: data_shared.h:42
mip::C::mip_field_view
A structure representing a MIP field.
Definition: mip_field.h:52
mip::C::mip_shared_gps_timestamp_data::tow
double tow
GPS Time of Week [seconds].
Definition: data_shared.h:153
mip::C::extract_mip_shared_event_source_data
void extract_mip_shared_event_source_data(microstrain_serializer *serializer, mip_shared_event_source_data *self)
Definition: data_shared.c:27
mip::C::insert_mip_shared_external_timestamp_data
void insert_mip_shared_external_timestamp_data(microstrain_serializer *serializer, const mip_shared_external_timestamp_data *self)
Definition: data_shared.c:170
mip::C::MIP_DATA_DESC_SHARED_DELTA_TICKS
@ MIP_DATA_DESC_SHARED_DELTA_TICKS
Definition: data_shared.h:37
mip::C::insert_mip_shared_event_source_data
void insert_mip_shared_event_source_data(microstrain_serializer *serializer, const mip_shared_event_source_data *self)
Definition: data_shared.c:22
mip::C::mip_shared_gps_timestamp_data::week_number
uint16_t week_number
GPS Week Number since 1980 [weeks].
Definition: data_shared.h:154
mip::C::extract_mip_shared_external_timestamp_data_from_field
bool extract_mip_shared_external_timestamp_data_from_field(const mip_field_view *field, void *ptr)
Definition: data_shared.c:184
mip::C::MIP_DATA_DESC_SHARED_TICKS
@ MIP_DATA_DESC_SHARED_TICKS
Definition: data_shared.h:36
mip::C::extract_mip_shared_external_time_delta_data_from_field
bool extract_mip_shared_external_time_delta_data_from_field(const mip_field_view *field, void *ptr)
Definition: data_shared.c:208
mip_interface.h
mip::C::mip_shared_external_timestamp_data::nanoseconds
uint64_t nanoseconds
Definition: data_shared.h:280
mip::C::mip_shared_external_timestamp_data::valid_flags
mip_shared_external_timestamp_data_valid_flags valid_flags
Definition: data_shared.h:281
mip::C::mip_shared_delta_time_data::seconds
double seconds
Seconds since last output.
Definition: data_shared.h:183
mip::C::extract_mip_shared_delta_ticks_data_from_field
bool extract_mip_shared_delta_ticks_data_from_field(const mip_field_view *field, void *ptr)
Definition: data_shared.c:72
common.h
mip_descriptors.h
mip::C::mip_shared_event_source_data::trigger_id
uint8_t trigger_id
Trigger ID number. If 0, this message was emitted due to being scheduled in the 3DM Message Format Co...
Definition: data_shared.h:68
mip::C::MIP_DATA_DESC_SHARED_EVENT_SOURCE
@ MIP_DATA_DESC_SHARED_EVENT_SOURCE
Definition: data_shared.h:35
mip::C::extract_mip_shared_gps_timestamp_data_from_field
bool extract_mip_shared_gps_timestamp_data_from_field(const mip_field_view *field, void *ptr)
Definition: data_shared.c:100
mip::C::mip_shared_external_timestamp_data
Definition: data_shared.h:278
mip::C::mip_shared_ticks_data
Definition: data_shared.h:88
mip::C::extract_mip_shared_gps_timestamp_data
void extract_mip_shared_gps_timestamp_data(microstrain_serializer *serializer, mip_shared_gps_timestamp_data *self)
Definition: data_shared.c:91
mip::C::extract_mip_shared_event_source_data_from_field
bool extract_mip_shared_event_source_data_from_field(const mip_field_view *field, void *ptr)
Definition: data_shared.c:32
mip::C::insert_mip_shared_delta_ticks_data
void insert_mip_shared_delta_ticks_data(microstrain_serializer *serializer, const mip_shared_delta_ticks_data *self)
Definition: data_shared.c:62
microstrain::C::microstrain_insert_u16
void microstrain_insert_u16(microstrain_serializer *serializer, uint16_t value)
mip::C::extract_mip_shared_delta_time_data_from_field
bool extract_mip_shared_delta_time_data_from_field(const mip_field_view *field, void *ptr)
Definition: data_shared.c:120
mip::C::MIP_DATA_DESC_SHARED_REFERENCE_TIME
@ MIP_DATA_DESC_SHARED_REFERENCE_TIME
Definition: data_shared.h:40
mip::C::mip_shared_ticks_data::ticks
uint32_t ticks
Ticks since powerup.
Definition: data_shared.h:90
mip::C::mip_shared_gps_timestamp_data
Definition: data_shared.h:151
mip::C::extract_mip_shared_reference_timestamp_data_from_field
bool extract_mip_shared_reference_timestamp_data_from_field(const mip_field_view *field, void *ptr)
Definition: data_shared.c:140
mip::C::mip_shared_reference_timestamp_data::nanoseconds
uint64_t nanoseconds
Nanoseconds since initialization.
Definition: data_shared.h:209
mip::C::MIP_DATA_DESC_SHARED_DEBUG_TICKS
@ MIP_DATA_DESC_SHARED_DEBUG_TICKS
Definition: data_shared.h:44
mip::C::mip_shared_external_time_delta_data_valid_flags
uint16_t mip_shared_external_time_delta_data_valid_flags
Definition: data_shared.h:310
mip::C::MIP_DATA_DESC_SHARED_SYS_TIME_DELTA
@ MIP_DATA_DESC_SHARED_SYS_TIME_DELTA
Definition: data_shared.h:43
mip::C::mip_shared_external_timestamp_data_valid_flags
uint16_t mip_shared_external_timestamp_data_valid_flags
Definition: data_shared.h:262
mip::C::mip_shared_reference_time_delta_data::dt_nanos
uint64_t dt_nanos
Nanoseconds since the last occurrence of this field in a packet of the same descriptor set and event ...
Definition: data_shared.h:237
mip::C::MIP_DATA_DESC_SHARED_START
@ MIP_DATA_DESC_SHARED_START
Definition: data_shared.h:51