SRS-control
0.1.4
Loading...
Searching...
No Matches
Connections.cpp
Go to the documentation of this file.
1
#include <
srs/utils/Connections.hpp
>
2
#include <
srs/workflow/Handler.hpp
>
3
4
namespace
srs::connection
5
{
6
void
Starter::close
()
7
{
8
close_socket
();
9
auto
& control =
get_app
();
10
control.set_status_acq_on();
11
control.notify_status_change();
12
if
(
is_connection_ok
())
13
{
14
spdlog::info(
"Input data stream from the FEC with the IP: {} has been requested"
,
15
get_remote_endpoint
().address().to_string());
16
}
17
}
18
19
void
Stopper::acq_off
()
20
{
21
const
auto
data = std::vector<CommunicateEntryType>{ 0, 15, 0 };
22
communicate
(data,
common::NULL_ADDRESS
);
23
}
24
25
void
DataReader::close
()
26
{
27
spdlog::debug(
"Stopping the UDP data reading ..."
);
28
close_socket
();
29
auto
& control =
get_app
();
30
control.set_status_is_reading(
false
);
31
spdlog::trace(
"Reading status is not false"
);
32
control.notify_status_change();
33
spdlog::info(
"UDP Data reading has been stopped"
);
34
}
35
36
void
DataReader::read_data_handle
(std::span<BufferElementType> read_data)
37
{
38
39
workflow_handler_
->read_data_once(read_data);
40
}
41
}
// namespace srs::connection
Connections.hpp
Handler.hpp
srs::connection::Base::is_connection_ok
auto is_connection_ok() -> bool
Definition
ConnectionBase.hpp:67
srs::connection::Base::get_remote_endpoint
auto get_remote_endpoint() -> const udp::endpoint &
Definition
ConnectionBase.hpp:58
srs::connection::Base::communicate
void communicate(this auto &&self, const std::vector< CommunicateEntryType > &data, uint16_t address)
Definition
ConnectionBase.hpp:252
srs::connection::Base::get_app
auto get_app() -> App &
Definition
ConnectionBase.hpp:56
srs::connection::Base::close_socket
void close_socket()
Definition
ConnectionBase.hpp:276
srs::connection::DataReader::close
void close()
Definition
Connections.cpp:25
srs::connection::DataReader::workflow_handler_
gsl::not_null< workflow::Handler * > workflow_handler_
Definition
Connections.hpp:136
srs::connection::DataReader::read_data_handle
void read_data_handle(std::span< BufferElementType > read_data)
Definition
Connections.cpp:36
srs::connection::Starter::close
void close()
Definition
Connections.cpp:6
srs::connection::Stopper::acq_off
void acq_off()
Turn off the data acquisition from SRS system.
Definition
Connections.cpp:19
srs::common::NULL_ADDRESS
constexpr auto NULL_ADDRESS
Definition
CommonDefitions.hpp:31
srs::connection
Definition
Application.hpp:23
backend
srs
utils
Connections.cpp
Impressum
Datenschutzerklärung
Generated by
1.14.0