mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-19 06:37:36 +00:00
Refactor bit pattern matching.
Remove AccessCodeCorrelator, Unstuff classes.
This commit is contained in:
@@ -22,11 +22,12 @@
|
||||
#include "packet_builder.hpp"
|
||||
|
||||
void PacketBuilder::configure(
|
||||
uint32_t unstuffing_pattern,
|
||||
size_t unstuffing_length,
|
||||
const BitPattern preamble,
|
||||
const BitPattern unstuff,
|
||||
size_t new_payload_length
|
||||
) {
|
||||
unstuff.configure(unstuffing_pattern, unstuffing_length);
|
||||
preamble_pattern = preamble;
|
||||
unstuff_pattern = unstuff;
|
||||
|
||||
if( new_payload_length <= payload.size() ) {
|
||||
payload_length = new_payload_length;
|
||||
@@ -37,6 +38,5 @@ void PacketBuilder::configure(
|
||||
|
||||
void PacketBuilder::reset_state() {
|
||||
bits_received = 0;
|
||||
unstuff.reset();
|
||||
state = State::AccessCodeSearch;
|
||||
state = State::Preamble;
|
||||
}
|
||||
|
Reference in New Issue
Block a user