mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-25 18:01:10 -04:00
More consistent use of pass-by-ref, const in baseband code.
This commit is contained in:
parent
82f367dfea
commit
a7afc58cf8
6 changed files with 22 additions and 20 deletions
|
@ -63,7 +63,7 @@ void BasebandProcessor::feed_channel_stats(const buffer_c16_t& channel) {
|
||||||
channel_stats.feed(
|
channel_stats.feed(
|
||||||
channel,
|
channel,
|
||||||
[](const ChannelStatistics& statistics) {
|
[](const ChannelStatistics& statistics) {
|
||||||
ChannelStatisticsMessage channel_stats_message { statistics };
|
const ChannelStatisticsMessage channel_stats_message { statistics };
|
||||||
shared_memory.application_queue.push(channel_stats_message);
|
shared_memory.application_queue.push(channel_stats_message);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
@ -107,7 +107,7 @@ void BasebandProcessor::feed_audio_stats(const buffer_s16_t& audio) {
|
||||||
audio_stats.feed(
|
audio_stats.feed(
|
||||||
audio,
|
audio,
|
||||||
[this](const AudioStatistics& statistics) {
|
[this](const AudioStatistics& statistics) {
|
||||||
AudioStatisticsMessage audio_stats_message { statistics };
|
const AudioStatisticsMessage audio_stats_message { statistics };
|
||||||
shared_memory.application_queue.push(audio_stats_message);
|
shared_memory.application_queue.push(audio_stats_message);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -163,7 +163,7 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
stats.process(buffer,
|
stats.process(buffer,
|
||||||
[](const BasebandStatistics statistics) {
|
[](const BasebandStatistics& statistics) {
|
||||||
const BasebandStatisticsMessage message { statistics };
|
const BasebandStatisticsMessage message { statistics };
|
||||||
shared_memory.application_queue.push(message);
|
shared_memory.application_queue.push(message);
|
||||||
}
|
}
|
||||||
|
@ -233,7 +233,7 @@ private:
|
||||||
|
|
||||||
stats.process(
|
stats.process(
|
||||||
buffer,
|
buffer,
|
||||||
[](const RSSIStatistics statistics) {
|
[](const RSSIStatistics& statistics) {
|
||||||
const RSSIStatisticsMessage message { statistics };
|
const RSSIStatisticsMessage message { statistics };
|
||||||
shared_memory.application_queue.push(message);
|
shared_memory.application_queue.push(message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,6 @@ void AISProcessor::consume_symbol(
|
||||||
void AISProcessor::payload_handler(
|
void AISProcessor::payload_handler(
|
||||||
const baseband::Packet& packet
|
const baseband::Packet& packet
|
||||||
) {
|
) {
|
||||||
AISPacketMessage message;
|
const AISPacketMessage message { packet };
|
||||||
message.packet = packet;
|
|
||||||
shared_memory.application_queue.push(message);
|
shared_memory.application_queue.push(message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -97,17 +97,13 @@ void ERTProcessor::consume_symbol(
|
||||||
void ERTProcessor::scm_handler(
|
void ERTProcessor::scm_handler(
|
||||||
const baseband::Packet& packet
|
const baseband::Packet& packet
|
||||||
) {
|
) {
|
||||||
ERTPacketMessage message;
|
const ERTPacketMessage message { ert::Packet::Type::SCM, packet };
|
||||||
message.type = ert::Packet::Type::SCM;
|
|
||||||
message.packet = packet;
|
|
||||||
shared_memory.application_queue.push(message);
|
shared_memory.application_queue.push(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ERTProcessor::idm_handler(
|
void ERTProcessor::idm_handler(
|
||||||
const baseband::Packet& packet
|
const baseband::Packet& packet
|
||||||
) {
|
) {
|
||||||
ERTPacketMessage message;
|
const ERTPacketMessage message { ert::Packet::Type::IDM, packet };
|
||||||
message.type = ert::Packet::Type::IDM;
|
|
||||||
message.packet = packet;
|
|
||||||
shared_memory.application_queue.push(message);
|
shared_memory.application_queue.push(message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,6 @@ void TPMSProcessor::consume_symbol(
|
||||||
void TPMSProcessor::payload_handler(
|
void TPMSProcessor::payload_handler(
|
||||||
const baseband::Packet& packet
|
const baseband::Packet& packet
|
||||||
) {
|
) {
|
||||||
TPMSPacketMessage message;
|
const TPMSPacketMessage message { packet };
|
||||||
message.packet = packet;
|
|
||||||
shared_memory.application_queue.push(message);
|
shared_memory.application_queue.push(message);
|
||||||
}
|
}
|
||||||
|
|
|
@ -185,9 +185,9 @@ struct BasebandConfiguration {
|
||||||
class BasebandConfigurationMessage : public Message {
|
class BasebandConfigurationMessage : public Message {
|
||||||
public:
|
public:
|
||||||
constexpr BasebandConfigurationMessage(
|
constexpr BasebandConfigurationMessage(
|
||||||
BasebandConfiguration configuration
|
const BasebandConfiguration& configuration
|
||||||
) : Message { ID::BasebandConfiguration },
|
) : Message { ID::BasebandConfiguration },
|
||||||
configuration(configuration)
|
configuration { configuration }
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,9 @@ public:
|
||||||
class AISPacketMessage : public Message {
|
class AISPacketMessage : public Message {
|
||||||
public:
|
public:
|
||||||
constexpr AISPacketMessage(
|
constexpr AISPacketMessage(
|
||||||
) : Message { ID::AISPacket }
|
const baseband::Packet& packet
|
||||||
|
) : Message { ID::AISPacket },
|
||||||
|
packet { packet }
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,7 +227,9 @@ public:
|
||||||
class TPMSPacketMessage : public Message {
|
class TPMSPacketMessage : public Message {
|
||||||
public:
|
public:
|
||||||
constexpr TPMSPacketMessage(
|
constexpr TPMSPacketMessage(
|
||||||
) : Message { ID::TPMSPacket }
|
const baseband::Packet& packet
|
||||||
|
) : Message { ID::TPMSPacket },
|
||||||
|
packet { packet }
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,11 +247,15 @@ public:
|
||||||
class ERTPacketMessage : public Message {
|
class ERTPacketMessage : public Message {
|
||||||
public:
|
public:
|
||||||
constexpr ERTPacketMessage(
|
constexpr ERTPacketMessage(
|
||||||
) : Message { ID::ERTPacket }
|
const ert::Packet::Type type,
|
||||||
|
const baseband::Packet& packet
|
||||||
|
) : Message { ID::ERTPacket },
|
||||||
|
type { type },
|
||||||
|
packet { packet }
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
ert::Packet::Type type { ert::Packet::Type::Unknown };
|
ert::Packet::Type type;
|
||||||
|
|
||||||
baseband::Packet packet;
|
baseband::Packet packet;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue