mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2026-09-10 08:39:29 +00:00
Push packet timestamping earlier in packet handling.
Ideally, it'd get pushed back into baseband, and baseband would correct for the length of the packet (based on preamble/access code match timestamp minus preamble/access code duration) to give the exact time the packet started.
This commit is contained in:
@@ -27,6 +27,9 @@
|
||||
#include "log_file.hpp"
|
||||
#include "field_reader.hpp"
|
||||
|
||||
#include "lpc43xx_cpp.hpp"
|
||||
using namespace lpc43xx;
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
@@ -61,10 +64,12 @@ using MMSI = uint32_t;
|
||||
class Packet {
|
||||
public:
|
||||
constexpr Packet(
|
||||
const rtc::RTC& received_at,
|
||||
const std::bitset<1024>& payload,
|
||||
const size_t payload_length
|
||||
) : payload_ { payload },
|
||||
payload_length_ { payload_length },
|
||||
received_at_ { received_at },
|
||||
field_ { payload_ }
|
||||
{
|
||||
}
|
||||
@@ -73,6 +78,8 @@ public:
|
||||
|
||||
bool is_valid() const;
|
||||
|
||||
rtc::RTC received_at() const;
|
||||
|
||||
uint32_t message_id() const;
|
||||
MMSI user_id() const;
|
||||
MMSI source_id() const;
|
||||
@@ -89,6 +96,7 @@ public:
|
||||
private:
|
||||
const std::bitset<1024> payload_;
|
||||
const size_t payload_length_;
|
||||
const rtc::RTC received_at_;
|
||||
const FieldReader field_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user