SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
N200Control.hxx
Go to the documentation of this file.
1/*
2 Copyright (c) 2015, 2025 Matthew H. Reilly (kb1vc)
3 All rights reserved.
4
5 Redistribution and use in source and binary forms, with or without
6 modification, are permitted provided that the following conditions are
7 met:
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
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27*/
28
29#pragma once
30
31#include "USRPTRControl.hxx"
32#include "IPSockets.hxx"
33#include <string>
34#include <list>
35#include <iostream>
36#include <uhd/usrp/multi_usrp.hpp>
37#include <memory>
38
39
40namespace SoDa {
41
46 class N200Control : public USRPTRControl {
47 public:
56 N200Control(uhd::usrp::multi_usrp::sptr usrp,
57 int mboard,
58 std::string ip_addr_str,
59 unsigned int portnum = 49172
60 );
65 bool setTXOn();
66
71 bool setTXOff();
72
77 bool getTX();
78
87 bool setBand(unsigned int band, bool state);
88
95 bool getBand(unsigned int band);
96
97 private:
98 bool sendCommand(const std::string & cmd, int retry_count);
99
100 std::shared_ptr<IP::ClientSocket> skt;
101
102 // For N200's that don't connect to an external serial widget
103 // (that is, if we find that the GPSDO is present, or that
104 // there is no answer on the TR switch,
105 uhd::usrp::multi_usrp::sptr usrp;
106 int mboard;
107 };
108}
std::shared_ptr< IP::ClientSocket > skt
bool sendCommand(const std::string &cmd, int retry_count)
bool getTX()
report state of transmit-enable.
bool setBand(unsigned int band, bool state)
turn on/off signal path for selected band note that multiple bands can be enabled at one time(!...
bool setTXOn()
activate external controls to enable transmit mode.
uhd::usrp::multi_usrp::sptr usrp
N200Control(uhd::usrp::multi_usrp::sptr usrp, int mboard, std::string ip_addr_str, unsigned int portnum=49172)
constructor
bool getBand(unsigned int band)
query state of signal path for selected band
bool setTXOff()
activate external controls to disable transmit mode.