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
+7 -1
View File
@@ -26,6 +26,9 @@ using namespace portapack;
#include "string_format.hpp"
#include "lpc43xx_cpp.hpp"
using namespace lpc43xx;
TPMSModel::TPMSModel() {
receiver_model.set_baseband_configuration({
.mode = 5,
@@ -38,6 +41,9 @@ TPMSModel::TPMSModel() {
}
ManchesterFormatted TPMSModel::on_packet(const TPMSPacketMessage& message) {
rtc::RTC received_at;
rtcGetTime(&RTCD1, &received_at);
const ManchesterDecoder decoder(message.packet.payload, message.packet.bits_received, 1);
const auto hex_formatted = format_manchester(decoder);
@@ -47,7 +53,7 @@ ManchesterFormatted TPMSModel::on_packet(const TPMSPacketMessage& message) {
const auto tuning_frequency_str = to_string_dec_uint(tuning_frequency, 10);
std::string entry = tuning_frequency_str + " FSK 38.4 19.2 " + hex_formatted.data + "/" + hex_formatted.errors;
log_file.write_entry(entry);
log_file.write_entry(received_at, entry);
}
return hex_formatted;