mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-29 01:29:03 -04:00
Refactor bit pattern matching.
Remove AccessCodeCorrelator, Unstuff classes.
This commit is contained in:
parent
f918a774b7
commit
36689f5c45
10 changed files with 116 additions and 150 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue