From 37b1d7cf2f618a23caef60ac3efc1aa625da3059 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 2 Oct 2015 17:43:02 -0700 Subject: [PATCH] Remove payload_length from PacketBuilder, etc. --- firmware/application/receiver_model.cpp | 2 -- firmware/baseband/packet_builder.cpp | 7 +------ firmware/baseband/packet_builder.hpp | 4 +--- firmware/baseband/proc_fsk.cpp | 3 +-- firmware/common/message.hpp | 1 - 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/firmware/application/receiver_model.cpp b/firmware/application/receiver_model.cpp index a3bef104..014d6339 100644 --- a/firmware/application/receiver_model.cpp +++ b/firmware/application/receiver_model.cpp @@ -201,7 +201,6 @@ static constexpr FSKConfiguration fsk_configuration_ais = { .access_code_tolerance = 1, .unstuffing_pattern = 0b111110, .unstuffing_length = 6, - .packet_length = 168 + 16 + 8, }; static constexpr FSKConfiguration fsk_configuration_tpms_a = { @@ -211,7 +210,6 @@ static constexpr FSKConfiguration fsk_configuration_tpms_a = { .access_code_tolerance = 1, .unstuffing_pattern = 0, .unstuffing_length = 0, - .packet_length = 160, }; void ReceiverModel::update_fsk_configuration() { diff --git a/firmware/baseband/packet_builder.cpp b/firmware/baseband/packet_builder.cpp index cacfb72d..f759707b 100644 --- a/firmware/baseband/packet_builder.cpp +++ b/firmware/baseband/packet_builder.cpp @@ -23,16 +23,11 @@ void PacketBuilder::configure( const BitPattern preamble, - const BitPattern unstuff, - size_t new_payload_length + const BitPattern unstuff ) { preamble_pattern = preamble; unstuff_pattern = unstuff; - if( new_payload_length <= payload.size() ) { - payload_length = new_payload_length; - } - reset_state(); } diff --git a/firmware/baseband/packet_builder.hpp b/firmware/baseband/packet_builder.hpp index 16678c10..f5744327 100644 --- a/firmware/baseband/packet_builder.hpp +++ b/firmware/baseband/packet_builder.hpp @@ -42,8 +42,7 @@ public: void configure( const BitPattern preamble, - const BitPattern unstuffing, - size_t new_payload_length + const BitPattern unstuffing ); void execute( @@ -104,7 +103,6 @@ private: BitPattern unstuff_pattern { 0b111110, 6 }; BitPattern end_flag_pattern { 0b01111110, 8 }; - size_t payload_length { 0 }; size_t bits_received { 0 }; State state { State::Preamble }; PayloadType payload; diff --git a/firmware/baseband/proc_fsk.cpp b/firmware/baseband/proc_fsk.cpp index c9f2c403..5c62d033 100644 --- a/firmware/baseband/proc_fsk.cpp +++ b/firmware/baseband/proc_fsk.cpp @@ -47,8 +47,7 @@ void FSKProcessor::configure(const FSKConfiguration new_configuration) { clock_recovery.configure(sampling_rate / 4, new_configuration.symbol_rate); packet_builder.configure( { new_configuration.access_code, new_configuration.access_code_length, new_configuration.access_code_tolerance }, - { new_configuration.unstuffing_pattern, new_configuration.unstuffing_length }, - new_configuration.packet_length + { new_configuration.unstuffing_pattern, new_configuration.unstuffing_length } ); } diff --git a/firmware/common/message.hpp b/firmware/common/message.hpp index a7993b27..532ce7c2 100644 --- a/firmware/common/message.hpp +++ b/firmware/common/message.hpp @@ -200,7 +200,6 @@ struct FSKConfiguration { size_t access_code_tolerance; uint32_t unstuffing_pattern; size_t unstuffing_length; - size_t packet_length; }; class FSKConfigurationMessage : public Message {