SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
RTLSDRTX.hxx
Go to the documentation of this file.
1#pragma once
2/*
3Copyright (c) 2026 Matthew H. Reilly (kb1vc)
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are
8met:
9
10 Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in
14 the documentation and/or other materials provided with the
15 distribution.
16
17THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*/
29
42
43#include "RadioTX.hxx"
44#include "Params.hxx"
45#include <memory>
46
47namespace SoDa {
48
49 class RTLSDRTX;
50 using RTLSDRTXPtr = std::shared_ptr<RTLSDRTX>;
51
52 class RTLSDRTX : public RadioTX {
53 protected:
54 RTLSDRTX(ParamsPtr params) : RadioTX(params, "RTLSDRTX") { }
55
56 public:
57 ~RTLSDRTX() = default;
58
59 static RTLSDRTXPtr make(ParamsPtr params) {
60 auto ret = std::shared_ptr<RTLSDRTX>(new RTLSDRTX(params));
61 ret->self = ret;
62 ret->registerThread(ret);
63 return ret;
64 }
65
66 void init() override { }
67
69 bool transmitSwitch(bool) override { return false; }
70
72 bool put(CBufPtr) override { return true; }
73
74 RadioTXPtr getSelfPtr() override { return self.lock(); }
75
76 private:
77 std::weak_ptr<RTLSDRTX> self;
78 };
79
80} // namespace SoDa
std::weak_ptr< RTLSDRTX > self
Definition RTLSDRTX.hxx:77
RTLSDRTX(ParamsPtr params)
Definition RTLSDRTX.hxx:54
~RTLSDRTX()=default
void init() override
Some initialization must occurr after all the components are created.
Definition RTLSDRTX.hxx:66
static RTLSDRTXPtr make(ParamsPtr params)
Definition RTLSDRTX.hxx:59
bool put(CBufPtr) override
Accept but discard all TX sample buffers.
Definition RTLSDRTX.hxx:72
bool transmitSwitch(bool) override
RTL-SDR cannot transmit — always report TX off.
Definition RTLSDRTX.hxx:69
RadioTXPtr getSelfPtr() override
Definition RTLSDRTX.hxx:74
RadioTX(ParamsPtr params, const std::string &name)
Constructor for RF Transmit/modulator process.
std::shared_ptr< Params > ParamsPtr
Definition Params.hxx:42
std::shared_ptr< CBuf > CBufPtr
Definition SoDaBase.hxx:64
std::shared_ptr< RadioTX > RadioTXPtr
Definition RadioTX.hxx:57
std::shared_ptr< RTLSDRTX > RTLSDRTXPtr
Definition RTLSDRTX.hxx:50