Provide configuration of symbol unstuffing.

This commit is contained in:
Jared Boone
2015-09-26 14:37:59 -07:00
parent a00fcbaa8f
commit e9f28f9ef3
5 changed files with 25 additions and 4 deletions

View File

@@ -21,11 +21,18 @@
#include "packet_builder.hpp"
void PacketBuilder::configure(size_t new_payload_length) {
void PacketBuilder::configure(
uint32_t unstuffing_pattern,
size_t unstuffing_length,
size_t new_payload_length
) {
unstuff.configure(unstuffing_pattern, unstuffing_length);
if( new_payload_length <= payload.size() ) {
payload_length = new_payload_length;
reset_state();
}
reset_state();
}
void PacketBuilder::reset_state() {

View File

@@ -30,7 +30,11 @@
class PacketBuilder {
public:
void configure(size_t new_payload_length);
void configure(
uint32_t unstuffing_pattern,
size_t unstuffing_length,
size_t new_payload_length
);
template<typename PayloadHandler>
void execute(

View File

@@ -50,7 +50,11 @@ void FSKProcessor::configure(const FSKConfiguration new_configuration) {
new_configuration.access_code_length,
new_configuration.access_code_tolerance
);
packet_builder.configure(new_configuration.packet_length);
packet_builder.configure(
new_configuration.unstuffing_pattern,
new_configuration.unstuffing_length,
new_configuration.packet_length
);
}
void FSKProcessor::execute(buffer_c8_t buffer) {