SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
RadioRX.hxx
Go to the documentation of this file.
1/*
2Copyright (c) 2026 Matthew H. Reilly (kb1vc)
3All rights reserved.
4
5Redistribution and use in source and binary forms, with or without
6modification, are permitted provided that the following conditions are
7met:
8
9 Redistributions of source code must retain the above copyright
10 notice, this list of conditions and the following disclaimer.
11 Redistributions in binary form must reproduce the above copyright
12 notice, this list of conditions and the following disclaimer in
13 the documentation and/or other materials provided with the
14 distribution.
15
16THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*/
28
44#pragma once
45#include "SoDaBase.hxx"
46#include "SoDaThread.hxx"
47#include "Command.hxx"
48#include "Params.hxx"
49
50#include <SoDa/MailBox.hxx>
51
52namespace SoDa {
67 class RadioRX : public SoDa::Thread {
68 public:
76
83 void run() final;
84
88 virtual void init() { }
89
90 protected:
100 virtual void execGetCommand(CommandPtr cmd) final;
101
110 virtual void execSetCommand(CommandPtr cmd) final;
111
120 virtual void execRepCommand(CommandPtr cmd) final;
121
124 double getTime();
125
126
132 virtual void subscribeToMailBoxes(const std::vector<MailBoxBasePtr> & mailboxes) final;
133
134
135 private:
136 // These are the command handlers. They call virtual methods provided
137 // by specific radio modules. They can't be over-ridden.
138
141 virtual void subExecCommand(CommandPtr cmd) { }
142 virtual void subExecGetCommand(CommandPtr cmd) { }
143 virtual void subExecSetCommand(CommandPtr cmd) { }
144 virtual void subExecRepCommand(CommandPtr cmd) { }
145
147 public:
157 virtual void setNCOFreq(double freq) = 0;
158
167 virtual bool downConvert() = 0;
168
172 virtual void startStream() = 0;
173
177 virtual void stopStream() = 0;
178
183 virtual bool streamEnabled() = 0;
184
191 virtual void enableIFStreamer(bool enable) = 0;
192
193 protected:
194
198 CmdMBox::Subscription cmd_subs;
199
201 };
202}
The Baseclass for all SoDa objects, and useful commonly used classes.
The Baseclass for all SoDa thread objects.
virtual void setNCOFreq(double freq)=0
Methods that ALL radios must implement.
double current_IF_tuning
current IF NCO frequency
Definition RadioRX.hxx:200
double getTime()
get the number of seconds since the "Epoch"
CmdMBoxPtr cmd_stream
Definition RadioRX.hxx:197
CmdMBox::Subscription cmd_subs
Definition RadioRX.hxx:198
virtual void subExecCommand(CommandPtr cmd)
Methods that a radio MAY implement (see above)
Definition RadioRX.hxx:141
RadioRX(ParamsPtr params)
Constructor Build a RadioRX thread.
virtual void execRepCommand(CommandPtr cmd) final
Parse an incoming REPort command and dispatch.
virtual void subExecSetCommand(CommandPtr cmd)
Definition RadioRX.hxx:143
virtual void subExecGetCommand(CommandPtr cmd)
Definition RadioRX.hxx:142
virtual bool streamEnabled()=0
test the processing stream flag
void run() final
start the thread
virtual bool downConvert()=0
A receiver must accept input data from the rx_stream and beat it against its NCO to produce output on...
virtual void enableIFStreamer(bool enable)=0
Enable IF streamer - This passes the incoming RF sample buffer onto the IF stream where it can be con...
virtual void execGetCommand(CommandPtr cmd) final
Parse an incoming GET command and dispatch.
virtual void execSetCommand(CommandPtr cmd) final
Parse an incoming SET command and dispatch.
virtual void init()
perform initialization.
Definition RadioRX.hxx:88
CDatMBoxPtr rx_stream
Definition RadioRX.hxx:195
ParamsPtr params
Definition RadioRX.hxx:91
virtual void subExecRepCommand(CommandPtr cmd)
Definition RadioRX.hxx:144
virtual void stopStream()=0
flush the input rx data stream and set the stream_processing flag to off
virtual void subscribeToMailBoxes(const std::vector< MailBoxBasePtr > &mailboxes) final
SoDa Threads must subscribe to at least the control mailbox.
virtual void startStream()=0
flush the input rx data stream and set the stream_processing flag to on.
CDatMBoxPtr if_stream
Definition RadioRX.hxx:196
The Thread baseclass for all SoDa thread objects.
std::shared_ptr< Params > ParamsPtr
Definition Params.hxx:42
std::shared_ptr< Command > CommandPtr
Definition Command.hxx:41
std::shared_ptr< CmdMBox > CmdMBoxPtr
Definition SoDaBase.hxx:79
std::shared_ptr< CDatMBox > CDatMBoxPtr
Definition SoDaBase.hxx:91