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 pdu_packet;
16pub use pdu_packet::{
17 PduChannel,
18 Pac1934,
19 PduHKPacket,
20};
21pub mod tracker;
22pub use tracker::{
23 TrackerEventIDEchoPacket,
24 TrackerTempLeakPacket,
25 TrackerDAQTempPacket,
26 TrackerDAQHSKPacket
27};
28pub mod magnetometer;
29pub use magnetometer::MagnetoMeter;
30
31
32pub use telemetry_packet_type::TelemetryPacketType;
34pub use telemetry_packet::TelemetryPacket;
35pub use telemetry_packet_header::TelemetryPacketHeader;
36pub use tof_packet_type::TofPacketType;
37pub use tof_packet::TofPacket;
38
39use crate::io::serialization::Serialization;
40
41#[cfg(feature="pybindings")]
42use pyo3::prelude::*;
43
44#[cfg_attr(feature="pybindings", pyfunction)]
46pub fn make_systime(lower : u32, upper : u16) -> u64 {
47 (upper as u64) << 32 | lower as u64
48}
49
50
51pub trait TofPackable {
54 const TOF_PACKET_TYPE : TofPacketType;
55 const TOF_PACKET_TYPE_ALT : TofPacketType = TofPacketType::Unknown;
58
59 fn pack(&self) -> TofPacket
61 where Self: Serialization {
62 let mut tp = TofPacket::new();
63 tp.payload = self.to_bytestream();
64 tp.packet_type = Self::TOF_PACKET_TYPE;
65 tp
66 }
67}
68
69pub trait TelemetryPackable {
72 const TEL_PACKET_TYPE : TelemetryPacketType = TelemetryPacketType::Unknown;
75 const TEL_PACKET_TYPES_EVENT : [TelemetryPacketType;4] = [
77 TelemetryPacketType::NoGapsTriggerEvent,
78 TelemetryPacketType::BoringEvent,
79 TelemetryPacketType::InterestingEvent,
80 TelemetryPacketType::NoTofDataEvent];
81}
82