1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
use bitflags::bitflags;
#[cfg(feature = "serde")]
use super::SerializeUbxPacketFields;
#[cfg(feature = "serde")]
use crate::serde::ser::SerializeMap;
use crate::{
error::ParserError, ubx_checksum, ubx_packets::packets::ScaleBack, MemWriter, MemWriterError,
UbxPacketCreator, UbxPacketMeta,
};
use ublox_derive::{ubx_extend_bitflags, ubx_packet_recv_send};
/// Time MODE3 Config Frame (32.10.37.1)
/// only available on `timing` receivers
#[ubx_packet_recv_send]
#[ubx(
class = 0x06,
id = 0x71,
fixed_payload_len = 40,
flags = "default_for_builder"
)]
struct CfgTmode3 {
version: u8,
reserved1: u8,
/// Receiver mode, see [CfgTmode3RcvrMode] enum
#[ubx(map_type = CfgTmode3RcvrMode)]
rcvr_mode: u8,
#[ubx(map_type = CfgTmode3Flags)]
flags: u8,
/// WGS84 ECEF.x coordinate in [m] or latitude in [deg° *1E-5],
/// depending on `flags` field
#[ubx(map_type = f64, scale = 1e-2)]
ecef_x_or_lat: i32,
/// WGS84 ECEF.y coordinate in [m] or longitude in [deg° *1E-5],
/// depending on `flags` field
#[ubx(map_type = f64, scale = 1e-2)]
ecef_y_or_lon: i32,
/// WGS84 ECEF.z coordinate or altitude, both in [m],
/// depending on `flags` field
#[ubx(map_type = f64, scale = 1e-2)]
ecef_z_or_alt: i32,
/// High precision WGS84 ECEF.x coordinate in [tenths of mm],
/// or high precision latitude, in nano degrees,
/// depending on `flags` field.
#[ubx(map_type = f32, scale = 1.0)]
ecef_x_or_lat_hp: i8,
/// High precision WGS84 ECEF.y coordinate in [tenths of mm]
/// or high precision longitude, in nano degrees,
/// depending on `flags` field.
#[ubx(map_type = f32, scale = 1.0)]
ecef_y_or_lon_hp: i8,
/// High precision WGS84 ECEF.z coordinate or altitude,
/// both if tenths of [mm],
/// depending on `flags` field.
#[ubx(map_type = f32, scale = 1.0)]
ecef_z_or_alt_hp: i8,
reserved2: u8,
/// Fixed position 3D accuracy [0.1 mm]
#[ubx(map_type = f64, scale = 1e-4)]
fixed_pos_acc: u32,
/// Survey in minimum duration [s]
sv_in_min_duration: u32,
/// Survey in position accuracy limit [0.1 mm]
#[ubx(map_type = f64, scale = 1e-4)]
sv_in_accur_limit: u32,
reserved3: [u8; 8],
}
#[ubx_extend_bitflags]
#[ubx(from, into_raw, rest_reserved)]
bitflags! {
#[derive(Default, Debug)]
pub struct CfgTmode3RcvrMode: u8 {
const DISABLED = 0x01;
const SURVEY_IN = 0x02;
/// True Antenna Reference Point (ARP) position information required
const FIXED_MODE = 0x04;
}
}
#[ubx_extend_bitflags]
#[ubx(from, into_raw, rest_reserved)]
bitflags! {
#[derive(Default, Debug)]
pub struct CfgTmode3Flags: u8 {
/// Set if position is given in Lat/Lon/Alt,
/// ECEF coordinates being used otherwise
const LLA = 0x01;
}
}