SoDaRadio-12.2.0-cut_dependencies:6c82803
Loading...
Searching...
No Matches
IFServer.hxx
Go to the documentation of this file.
1/*
2 Copyright (c) 2020 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#ifndef SODA_IF_SERVER_HDR
30#define SODA_IF_SERVER_HDR
31
32#include <SoDaRadio/SoDaBase.hxx>
33#include <SoDaRadio/SoDaThread.hxx>
34#include <SoDaRadio/UDSockets.hxx>
65
66
81class IFServer : public SoDa::Thread {
82public:
83
93 IFServer(const std::string & name);
94
109 void subscribeToMailBox(const std::string & mbox_name, SoDa::BaseMBox * mbox_p);
110
117 void run();
118
125 void shutDown();
126
146
147protected:
157 bool sendBuffer(SoDa::Buf * rxbuf);
158
159 unsigned int cmd_subs;
161 unsigned int rx_subs;
162 SoDa::DatMBox * rx_stream;
163
170
172};
173
174#endif
SoDa::DatMBox * rx_stream
mailbox producing command stream from user
Definition IFServer.hxx:162
unsigned int rx_subs
mailbox subscription ID for command stream
Definition IFServer.hxx:161
IFServer(const std::string &name)
create the plugin thread instance.
void shutDown()
Each thread must implement this method.
void execRepCommand(SoDa::Command *cmd)
A thread may implement any or all of the command execution methods (execRepCommand,...
bool sendBuffer(SoDa::Buf *rxbuf)
send a buffer of complex samples to clients connected to the socket.
double current_rx_center_freq
Definition IFServer.hxx:171
void subscribeToMailBox(const std::string &mbox_name, SoDa::BaseMBox *mbox_p)
connect to useful mailboxes.
SoDa::CmdMBox * cmd_stream
mailbox producing command stream from user
Definition IFServer.hxx:160
SoDa::UD::ServerSocket * server_socket
unix domain server socket object.
Definition IFServer.hxx:169
void run()
This is the method that does the actual work.
unsigned int cmd_subs
mailbox subscription ID for command stream
Definition IFServer.hxx:159
The Buffer Class.
Definition SoDaBase.hxx:248
This is a list of all the commands that can "do something" to one or more components in the SoDa radi...
Definition Command.hxx:52
The Thread baseclass for all SoDa thread objects.
SoDa::MailBox< CommandPtr > CmdMBox
Mailboxes that carry commands only are of type CmdMBox.
Definition SoDaBase.hxx:78