1pub mod tof_packet_type;
5pub mod tof_packet;
6pub mod telemetry_packet_type;
7pub mod telemetry_packet_header;
8pub mod telemetry_packet;
9pub mod tracker_header;
10pub use tracker_header::TrackerHeader;
11pub mod bfsw_ack_packet;
12pub use bfsw_ack_packet::AckBfsw;
13pub mod gps_packet;
14pub use gps_packet::GPSPacket;
15pub mod tracker;
16pub use tracker::{
17 TrackerEventIDEchoPacket,
18 TrackerTempLeakPacket,
19 TrackerDAQTempPacket,
20 TrackerDAQHSKPacket
21};
22pub mod magnetometer;
23pub use magnetometer::MagnetoMeter;
24
25
26pub use telemetry_packet_type::TelemetryPacketType;
28pub use telemetry_packet::TelemetryPacket;
29pub use telemetry_packet_header::TelemetryPacketHeader;
30pub use tof_packet_type::TofPacketType;
31pub use tof_packet::TofPacket;
32
33use crate::io::serialization::Serialization;
34
35#[cfg(feature="pybindings")]
36use pyo3::prelude::*;
37
38#[cfg_attr(feature="pybindings", pyfunction)]
40pub fn make_systime(lower : u32, upper : u16) -> u64 {
41 (upper as u64) << 32 | lower as u64
42}
43
44
45pub trait TofPackable {
48 const TOF_PACKET_TYPE : TofPacketType;
49 const TOF_PACKET_TYPE_ALT : TofPacketType = TofPacketType::Unknown;
52
53 fn pack(&self) -> TofPacket
55 where Self: Serialization {
56 let mut tp = TofPacket::new();
57 tp.payload = self.to_bytestream();
58 tp.packet_type = Self::TOF_PACKET_TYPE;
59 tp
60 }
61}
62
63pub trait TelemetryPackable {
66 const TEL_PACKET_TYPE : TelemetryPacketType = TelemetryPacketType::Unknown;
69 const TEL_PACKET_TYPES_EVENT : [TelemetryPacketType;4] = [
71 TelemetryPacketType::NoGapsTriggerEvent,
72 TelemetryPacketType::BoringEvent,
73 TelemetryPacketType::InterestingEvent,
74 TelemetryPacketType::NoTofDataEvent];
75}
76