Rename ::Packet to baseband::Packet. Remove IPC packet types.

This commit is contained in:
Jared Boone
2015-12-08 15:15:51 -08:00
parent 280acfd227
commit d0d97e92cb
15 changed files with 69 additions and 76 deletions

View File

@@ -28,7 +28,7 @@
#include <functional>
#include "bit_pattern.hpp"
#include "packet.hpp"
#include "baseband_packet.hpp"
struct NeverMatch {
bool operator()(const BitHistory&, const size_t) const {
@@ -47,7 +47,7 @@ struct FixedLength {
template<typename PreambleMatcher, typename UnstuffMatcher, typename EndMatcher>
class PacketBuilder {
public:
using PayloadHandlerFunc = std::function<void(const ::Packet& packet)>;
using PayloadHandlerFunc = std::function<void(const baseband::Packet& packet)>;
PacketBuilder(
const PreambleMatcher preamble_matcher,
@@ -122,7 +122,7 @@ private:
EndMatcher end;
State state { State::Preamble };
::Packet packet;
baseband::Packet packet;
void reset_state() {
packet.clear();

View File

@@ -60,9 +60,9 @@ void AISProcessor::consume_symbol(
}
void AISProcessor::payload_handler(
const ::Packet& packet
const baseband::Packet& packet
) {
AISPacketMessage message;
message.packet.packet = packet;
message.packet = packet;
shared_memory.application_queue.push(message);
}

View File

@@ -30,7 +30,7 @@
#include "clock_recovery.hpp"
#include "symbol_coding.hpp"
#include "packet_builder.hpp"
#include "packet.hpp"
#include "baseband_packet.hpp"
#include "message.hpp"
@@ -57,13 +57,13 @@ private:
{ 0b0101010101111110, 16, 1 },
{ 0b111110, 6 },
{ 0b01111110, 8 },
[this](const ::Packet& packet) {
[this](const baseband::Packet& packet) {
this->payload_handler(packet);
}
};
void consume_symbol(const float symbol);
void payload_handler(const ::Packet& packet);
void payload_handler(const baseband::Packet& packet);
};
#endif/*__PROC_AIS_H__*/

View File

@@ -95,19 +95,19 @@ void ERTProcessor::consume_symbol(
}
void ERTProcessor::scm_handler(
const ::Packet& packet
const baseband::Packet& packet
) {
ERTPacketMessage message;
message.packet.type = ERTPacket::Type::SCM;
message.packet.packet = packet;
message.type = ERTPacketMessage::Type::SCM;
message.packet = packet;
shared_memory.application_queue.push(message);
}
void ERTProcessor::idm_handler(
const ::Packet& packet
const baseband::Packet& packet
) {
ERTPacketMessage message;
message.packet.type = ERTPacket::Type::IDM;
message.packet.packet = packet;
message.type = ERTPacketMessage::Type::IDM;
message.packet = packet;
shared_memory.application_queue.push(message);
}

View File

@@ -29,7 +29,7 @@
#include "clock_recovery.hpp"
#include "symbol_coding.hpp"
#include "packet_builder.hpp"
#include "packet.hpp"
#include "baseband_packet.hpp"
#include "message.hpp"
@@ -72,7 +72,7 @@ private:
{ scm_preamble_and_sync_manchester, scm_preamble_and_sync_length, 1 },
{ },
{ scm_payload_length_max },
[this](const ::Packet& packet) {
[this](const baseband::Packet& packet) {
this->scm_handler(packet);
}
};
@@ -81,14 +81,14 @@ private:
{ idm_preamble_and_sync_manchester, idm_preamble_and_sync_length, 1 },
{ },
{ idm_payload_length_max },
[this](const ::Packet& packet) {
[this](const baseband::Packet& packet) {
this->idm_handler(packet);
}
};
void consume_symbol(const float symbol);
void scm_handler(const ::Packet& packet);
void idm_handler(const ::Packet& packet);
void scm_handler(const baseband::Packet& packet);
void idm_handler(const baseband::Packet& packet);
float sum_half_period[2];
float sum_period[3];

View File

@@ -58,9 +58,9 @@ void TPMSProcessor::consume_symbol(
}
void TPMSProcessor::payload_handler(
const ::Packet& packet
const baseband::Packet& packet
) {
TPMSPacketMessage message;
message.packet.packet = packet;
message.packet = packet;
shared_memory.application_queue.push(message);
}

View File

@@ -30,7 +30,7 @@
#include "clock_recovery.hpp"
#include "symbol_coding.hpp"
#include "packet_builder.hpp"
#include "packet.hpp"
#include "baseband_packet.hpp"
#include "message.hpp"
@@ -64,13 +64,13 @@ private:
{ 0b010101010101010101010101010110, 30, 1 },
{ },
{ 256 },
[this](const ::Packet& packet) {
[this](const baseband::Packet& packet) {
this->payload_handler(packet);
}
};
void consume_symbol(const float symbol);
void payload_handler(const ::Packet& packet);
void payload_handler(const baseband::Packet& packet);
};
#endif/*__PROC_TPMS_H__*/