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:
Jared Boone
2015-12-03 14:04:20 -08:00
parent 0909cdb31e
commit bb3cb6f080
6 changed files with 35 additions and 8 deletions
+8
View File
@@ -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_;
};