MIP SDK  0.0.1
MicroStrain Communications Library for embedded systems
data_shared.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "descriptors.h"
4 #include "../mip_result.h"
5 
6 #include <stdint.h>
7 #include <stddef.h>
8 #include <stdbool.h>
9 
10 #ifdef __cplusplus
11 namespace mip {
12 namespace C {
13 extern "C" {
14 
15 #endif // __cplusplus
16 struct mip_interface;
17 struct mip_serializer;
18 struct mip_field;
19 
26 
28 // Descriptors
30 
31 enum
32 {
34 
35 
46 };
47 
49 // Shared Type Definitions
51 
53 
55 // Mip Fields
57 
66 
68 {
69  uint8_t trigger_id;
70 
71 };
75 bool extract_mip_shared_event_source_data_from_field(const struct mip_field* field, void* ptr);
76 
87 
89 {
90  uint32_t ticks;
91 
92 };
94 void insert_mip_shared_ticks_data(struct mip_serializer* serializer, const mip_shared_ticks_data* self);
96 bool extract_mip_shared_ticks_data_from_field(const struct mip_field* field, void* ptr);
97 
109 
111 {
112  uint32_t ticks;
113 
114 };
118 bool extract_mip_shared_delta_ticks_data_from_field(const struct mip_field* field, void* ptr);
119 
130 
132 static const mip_shared_gps_timestamp_data_valid_flags MIP_SHARED_GPS_TIMESTAMP_DATA_VALID_FLAGS_NONE = 0x0000;
133 static const mip_shared_gps_timestamp_data_valid_flags MIP_SHARED_GPS_TIMESTAMP_DATA_VALID_FLAGS_TOW = 0x0001;
134 static const mip_shared_gps_timestamp_data_valid_flags MIP_SHARED_GPS_TIMESTAMP_DATA_VALID_FLAGS_WEEK_NUMBER = 0x0002;
135 static const mip_shared_gps_timestamp_data_valid_flags MIP_SHARED_GPS_TIMESTAMP_DATA_VALID_FLAGS_TIME_VALID = 0x0003;
136 
138 {
139  double tow;
140  uint16_t week_number;
142 
143 };
147 bool extract_mip_shared_gps_timestamp_data_from_field(const struct mip_field* field, void* ptr);
148 
151 
168 
170 {
171  double seconds;
172 
173 };
177 bool extract_mip_shared_delta_time_data_from_field(const struct mip_field* field, void* ptr);
178 
193 
195 {
196  uint64_t nanoseconds;
197 
198 };
203 
220 
222 {
223  uint64_t dt_nanos;
224 
225 };
230 
246 
248 static const mip_shared_external_timestamp_data_valid_flags MIP_SHARED_EXTERNAL_TIMESTAMP_DATA_VALID_FLAGS_NONE = 0x0000;
249 static const mip_shared_external_timestamp_data_valid_flags MIP_SHARED_EXTERNAL_TIMESTAMP_DATA_VALID_FLAGS_NANOSECONDS = 0x0001;
250 
252 {
253  uint64_t nanoseconds;
255 
256 };
261 
264 
284 
286 static const mip_shared_external_time_delta_data_valid_flags MIP_SHARED_EXTERNAL_TIME_DELTA_DATA_VALID_FLAGS_NONE = 0x0000;
287 static const mip_shared_external_time_delta_data_valid_flags MIP_SHARED_EXTERNAL_TIME_DELTA_DATA_VALID_FLAGS_DT_NANOS = 0x0001;
288 
290 {
291  uint64_t dt_nanos;
293 
294 };
299 
302 
305 
310 #ifdef __cplusplus
311 } // namespace C
312 } // namespace mip
313 } // extern "C"
314 #endif // __cplusplus
315 
void insert_mip_shared_delta_ticks_data(mip_serializer *serializer, const mip_shared_delta_ticks_data *self)
Definition: data_shared.c:70
void extract_mip_shared_delta_ticks_data(mip_serializer *serializer, mip_shared_delta_ticks_data *self)
Definition: data_shared.c:75
void insert_mip_shared_delta_time_data(mip_serializer *serializer, const mip_shared_delta_time_data *self)
Definition: data_shared.c:129
void extract_mip_shared_delta_time_data(mip_serializer *serializer, mip_shared_delta_time_data *self)
Definition: data_shared.c:134
void extract_mip_shared_event_source_data(mip_serializer *serializer, mip_shared_event_source_data *self)
Definition: data_shared.c:35
void insert_mip_shared_event_source_data(mip_serializer *serializer, const mip_shared_event_source_data *self)
Definition: data_shared.c:30
void extract_mip_shared_external_time_delta_data_valid_flags(struct mip_serializer *serializer, mip_shared_external_time_delta_data_valid_flags *self)
Definition: data_shared.c:252
uint16_t mip_shared_external_time_delta_data_valid_flags
Definition: data_shared.h:285
void insert_mip_shared_external_time_delta_data_valid_flags(struct mip_serializer *serializer, const mip_shared_external_time_delta_data_valid_flags self)
Definition: data_shared.c:248
void insert_mip_shared_external_time_delta_data(mip_serializer *serializer, const mip_shared_external_time_delta_data *self)
Definition: data_shared.c:224
void extract_mip_shared_external_time_delta_data(mip_serializer *serializer, mip_shared_external_time_delta_data *self)
Definition: data_shared.c:231
uint16_t mip_shared_external_timestamp_data_valid_flags
Definition: data_shared.h:247
void insert_mip_shared_external_timestamp_data(mip_serializer *serializer, const mip_shared_external_timestamp_data *self)
Definition: data_shared.c:189
void extract_mip_shared_external_timestamp_data(mip_serializer *serializer, mip_shared_external_timestamp_data *self)
Definition: data_shared.c:196
void extract_mip_shared_external_timestamp_data_valid_flags(struct mip_serializer *serializer, mip_shared_external_timestamp_data_valid_flags *self)
Definition: data_shared.c:217
void insert_mip_shared_external_timestamp_data_valid_flags(struct mip_serializer *serializer, const mip_shared_external_timestamp_data_valid_flags self)
Definition: data_shared.c:213
uint16_t mip_shared_gps_timestamp_data_valid_flags
Definition: data_shared.h:131
void extract_mip_shared_gps_timestamp_data_valid_flags(struct mip_serializer *serializer, mip_shared_gps_timestamp_data_valid_flags *self)
Definition: data_shared.c:122
void insert_mip_shared_gps_timestamp_data_valid_flags(struct mip_serializer *serializer, const mip_shared_gps_timestamp_data_valid_flags self)
Definition: data_shared.c:118
void extract_mip_shared_gps_timestamp_data(mip_serializer *serializer, mip_shared_gps_timestamp_data *self)
Definition: data_shared.c:99
void insert_mip_shared_gps_timestamp_data(mip_serializer *serializer, const mip_shared_gps_timestamp_data *self)
Definition: data_shared.c:90
void insert_mip_shared_reference_time_delta_data(mip_serializer *serializer, const mip_shared_reference_time_delta_data *self)
Definition: data_shared.c:169
void extract_mip_shared_reference_time_delta_data(mip_serializer *serializer, mip_shared_reference_time_delta_data *self)
Definition: data_shared.c:174
void extract_mip_shared_reference_timestamp_data(mip_serializer *serializer, mip_shared_reference_timestamp_data *self)
Definition: data_shared.c:154
void insert_mip_shared_reference_timestamp_data(mip_serializer *serializer, const mip_shared_reference_timestamp_data *self)
Definition: data_shared.c:149
void insert_mip_shared_ticks_data(mip_serializer *serializer, const mip_shared_ticks_data *self)
Definition: data_shared.c:50
void extract_mip_shared_ticks_data(mip_serializer *serializer, mip_shared_ticks_data *self)
Definition: data_shared.c:55
@ MIP_DATA_DESC_SHARED_DEBUG_TICKS
Definition: data_shared.h:45
@ MIP_DATA_DESC_SHARED_SYS_TIME_DELTA
Definition: data_shared.h:44
@ MIP_SHARED_DATA_DESC_SET
Definition: data_shared.h:33
@ MIP_DATA_DESC_SHARED_GPS_TIME
Definition: data_shared.h:39
@ MIP_DATA_DESC_SHARED_EVENT_SOURCE
Definition: data_shared.h:36
@ MIP_DATA_DESC_SHARED_REFERENCE_TIME
Definition: data_shared.h:41
@ MIP_DATA_DESC_SHARED_DELTA_TIME
Definition: data_shared.h:40
@ MIP_DATA_DESC_SHARED_DELTA_TICKS
Definition: data_shared.h:38
@ MIP_DATA_DESC_SHARED_REF_TIME_DELTA
Definition: data_shared.h:42
@ MIP_DATA_DESC_SHARED_TICKS
Definition: data_shared.h:37
@ MIP_DATA_DESC_SHARED_EXTERNAL_TIME
Definition: data_shared.h:43
@ MIP_DATA_DESC_SHARED_START
Definition: data_shared.h:52
bool extract_mip_shared_ticks_data_from_field(const mip_field *field, void *ptr)
Definition: data_shared.c:60
bool extract_mip_shared_gps_timestamp_data_from_field(const mip_field *field, void *ptr)
Definition: data_shared.c:108
bool extract_mip_shared_event_source_data_from_field(const mip_field *field, void *ptr)
Definition: data_shared.c:40
bool extract_mip_shared_reference_time_delta_data_from_field(const mip_field *field, void *ptr)
Definition: data_shared.c:179
bool extract_mip_shared_external_time_delta_data_from_field(const mip_field *field, void *ptr)
Definition: data_shared.c:238
bool extract_mip_shared_delta_ticks_data_from_field(const mip_field *field, void *ptr)
Definition: data_shared.c:80
bool extract_mip_shared_delta_time_data_from_field(const mip_field *field, void *ptr)
Definition: data_shared.c:139
bool extract_mip_shared_external_timestamp_data_from_field(const mip_field *field, void *ptr)
Definition: data_shared.c:203
bool extract_mip_shared_reference_timestamp_data_from_field(const mip_field *field, void *ptr)
Definition: data_shared.c:159
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
A structure representing a MIP field.
Definition: mip_field.h:53
State of the interface for communicating with a MIP device.
Definition: mip_interface.h:52
Structure used for serialization.
Definition: serialization.h:44
Definition: data_shared.h:111
uint32_t ticks
Ticks since last output.
Definition: data_shared.h:112
Definition: data_shared.h:170
double seconds
Seconds since last output.
Definition: data_shared.h:171
Definition: data_shared.h:68
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:69
Definition: data_shared.h:290
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:291
mip_shared_external_time_delta_data_valid_flags valid_flags
Definition: data_shared.h:292
Definition: data_shared.h:252
uint64_t nanoseconds
Definition: data_shared.h:253
mip_shared_external_timestamp_data_valid_flags valid_flags
Definition: data_shared.h:254
Definition: data_shared.h:138
mip_shared_gps_timestamp_data_valid_flags valid_flags
Definition: data_shared.h:141
double tow
GPS Time of Week [seconds].
Definition: data_shared.h:139
uint16_t week_number
GPS Week Number since 1980 [weeks].
Definition: data_shared.h:140
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:223
Definition: data_shared.h:195
uint64_t nanoseconds
Nanoseconds since initialization.
Definition: data_shared.h:196
Definition: data_shared.h:89
uint32_t ticks
Ticks since powerup.
Definition: data_shared.h:90