компилируемая версия для модема, ее нельзя собрать на компе из-за различий в библиотеке boost::asio
This commit is contained in:
parent
e313027759
commit
90c02eb63a
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "dependencies/control_system_client"]
|
||||
path = dependencies/control_system_client
|
||||
url = http://192.168.88.14/mf-tdma/protocol_processing/control_system_client.git
|
@ -30,7 +30,7 @@ add_compile_options(-Wall -Wextra -Wsign-conversion)
|
||||
# максимальный размер тела запроса 200mb
|
||||
add_definitions(-DHTTP_MAX_PAYLOAD=200000000)
|
||||
|
||||
add_subdirectory(dependencies/control_system)
|
||||
add_subdirectory(dependencies/control_system_client)
|
||||
|
||||
add_executable(terminal-web-server
|
||||
src/server/mime_types.hpp
|
||||
|
36
dependencies/control_system/CMakeLists.txt
vendored
36
dependencies/control_system/CMakeLists.txt
vendored
@ -1,36 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
project(terminal)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
if (CMAKE_VERSION VERSION_LESS 3.2)
|
||||
set(UPDATE_DISCONNECTED_IF_AVAILABLE "")
|
||||
else()
|
||||
set(UPDATE_DISCONNECTED_IF_AVAILABLE "UPDATE_DISCONNECTED 1")
|
||||
endif()
|
||||
|
||||
include(CheckCXXCompilerFlag)
|
||||
set(CMAKE_CXX_FLAGS -fPIC)
|
||||
|
||||
set(default_build_type "Release")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-ggdb -O0")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -s -DNDEBUG ")
|
||||
message(${CMAKE_CXX_FLAGS})
|
||||
message("CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE})
|
||||
|
||||
message(${CMAKE_CXX_FLAGS})
|
||||
|
||||
add_library(terminal-client-api STATIC
|
||||
client/main.cpp
|
||||
client/sock_client.cpp
|
||||
client/system_client.cpp
|
||||
)
|
||||
|
||||
target_include_directories(terminal-client-api PUBLIC "include/")
|
||||
|
||||
find_package(Boost 1.53.0 COMPONENTS system log log_setup REQUIRED)
|
||||
find_package(cereal REQUIRED)
|
||||
target_link_libraries(terminal-client-api ${Boost_LIBRARIES} ${OPENSSL_LIBRARIES} cereal::cereal)
|
||||
target_include_directories(terminal-client-api PRIVATE ${Boost_INCLUDE_DIR})
|
1497
dependencies/control_system/client/main.cpp
vendored
1497
dependencies/control_system/client/main.cpp
vendored
File diff suppressed because it is too large
Load Diff
@ -1,51 +0,0 @@
|
||||
#include "sock_client.h"
|
||||
|
||||
client::client(boost::asio::io_context & io_context, const std::string & unix_file, std::function<void(const std::vector<uint8_t>&)> func_cb)
|
||||
: socket_(io_context)
|
||||
, callback_func(func_cb)
|
||||
{
|
||||
socket_.async_connect(seq_packet::seqpacket_protocol::endpoint(unix_file),
|
||||
std::bind(&client::handle_connect, this,
|
||||
std::placeholders::_1));
|
||||
}
|
||||
|
||||
client::~client()
|
||||
{
|
||||
do_close();
|
||||
}
|
||||
|
||||
void client::write(const std::vector<uint8_t> & data)
|
||||
{
|
||||
boost::asio::write(socket_, boost::asio::buffer(data));
|
||||
}
|
||||
|
||||
void client::do_close()
|
||||
{
|
||||
socket_.close();
|
||||
}
|
||||
|
||||
void client::start()
|
||||
{
|
||||
seq_packet::seqpacket_protocol::socket::message_flags in_flags { MSG_WAITALL };
|
||||
socket_.async_receive(boost::asio::buffer(data_), in_flags,
|
||||
std::bind(&client::handle_read, this,
|
||||
std::placeholders::_1,
|
||||
std::placeholders::_2));
|
||||
}
|
||||
|
||||
void client::handle_connect(const boost::system::error_code & error)
|
||||
{
|
||||
if (!error)
|
||||
start();
|
||||
}
|
||||
|
||||
void client::handle_read(const boost::system::error_code & error, size_t bytes_transferred)
|
||||
{
|
||||
if (!error && callback_func && bytes_transferred)
|
||||
{
|
||||
callback_func(std::vector<uint8_t>(std::begin(data_), std::begin(data_) + bytes_transferred));
|
||||
start();
|
||||
}
|
||||
//else
|
||||
// do_close();
|
||||
}
|
24
dependencies/control_system/client/sock_client.h
vendored
24
dependencies/control_system/client/sock_client.h
vendored
@ -1,24 +0,0 @@
|
||||
#pragma once
|
||||
#include "../common/seq_packet.h"
|
||||
|
||||
class client
|
||||
{
|
||||
public:
|
||||
client(boost::asio::io_context & io_context, const std::string & unix_file, std::function<void(const std::vector<uint8_t>&)> func_cb = nullptr);
|
||||
~client();
|
||||
|
||||
void write(const std::vector<uint8_t> & data);
|
||||
void do_close();
|
||||
|
||||
private:
|
||||
client(const client&) = delete;
|
||||
const client& operator=(const client&) = delete;
|
||||
|
||||
seq_packet::seqpacket_protocol::socket socket_;
|
||||
std::array<uint8_t, 2000> data_;
|
||||
std::function<void(const std::vector<uint8_t>&)> callback_func;
|
||||
|
||||
void handle_connect(const boost::system::error_code & error);
|
||||
void handle_read(const boost::system::error_code & error, size_t bytes_transferred);
|
||||
void start();
|
||||
};
|
1041
dependencies/control_system/client/system_client.cpp
vendored
1041
dependencies/control_system/client/system_client.cpp
vendored
File diff suppressed because it is too large
Load Diff
121
dependencies/control_system/client/system_client.h
vendored
121
dependencies/control_system/client/system_client.h
vendored
@ -1,121 +0,0 @@
|
||||
#pragma once
|
||||
#include <map>
|
||||
#include <queue>
|
||||
#include <any>
|
||||
#include "sock_client.h"
|
||||
#include "../common/protocol_commands.h"
|
||||
|
||||
enum class state
|
||||
{
|
||||
disconnected,
|
||||
connected,
|
||||
logged_in
|
||||
};
|
||||
|
||||
class system_client
|
||||
{
|
||||
public:
|
||||
system_client(const std::string & unix_file, std::function<void(const std::string&)> log_func = nullptr);
|
||||
~system_client();
|
||||
|
||||
state get_current_state() const;
|
||||
|
||||
response_type send_login_cmd (const std::string & username, const std::string & pass, access_rights & access);
|
||||
response_type send_logout_cmd ();
|
||||
response_type send_ping_cmd (const std::string & ip, size_t count);
|
||||
response_type send_traceroute_cmd (const std::string & ip);
|
||||
response_type send_show_interface_cmd(const interface_value & interface);
|
||||
response_type send_copy_cmd (const fm::side_description & src, const fm::side_description & dst);
|
||||
|
||||
response_type send_set_dem_freq_cmd(uint32_t freq);
|
||||
response_type send_get_dem_freq_cmd(uint32_t & freq);
|
||||
|
||||
response_type send_set_gain_param (const gain_value & interface_gain, double gain);
|
||||
response_type send_get_gain_param (const gain_value & interface_gain, double & gain);
|
||||
response_type send_radio_enable (const cmd_radio & enable_choice, bool enbl_);
|
||||
response_type send_modulator_param(const modulator_value & mod_val, uint32_t value);
|
||||
response_type send_get_modulator_param(const modulator_value & mod_val, uint32_t &value);
|
||||
response_type send_set_demodulator_param(const demodulator_value & demod_val, uint32_t value);
|
||||
response_type send_get_demodulator_param(const getdemodulator_value & demod_val, uint32_t &value);
|
||||
response_type send_zynq_cmd(const zynq_value & zynq_val, double & value);
|
||||
response_type send_network_settings(const network_value & cmd_netw, const std::string & value);
|
||||
response_type send_get_network_settings(const network_value & cmd_netw, std::string & value);
|
||||
response_type send_rollof_and_baudrate(double & rollof, double &baudrate);
|
||||
response_type send_get_level_dem(const cmd_level_dem & lvl_dem_val, double &value);
|
||||
response_type send_get_dma_debug(const cmd_get_dma_debugg_enum & dma_debug, std::string &value);
|
||||
response_type send_set_10g_config(const cmd_10g_config & _10g_config, std::string &value);
|
||||
response_type send_set_dma_debug(const cmd_dma_debugg & dma_debugg, std::string &value);
|
||||
response_type send_set_acm_params(const ACM_parameters_serv &acm_params);
|
||||
response_type send_get_acm_params(cmd_get_acm_param &acm_params);
|
||||
|
||||
response_type send_get_demodulator_state(demodulator_state_com &demodulator_state);
|
||||
response_type send_get_modulator_state(modulator_state_com &modulator_state);
|
||||
|
||||
response_type send_get_device_state(device_state_com &device_state);
|
||||
response_type send_get_cinc_state(CinC_state_com &cinc_state);
|
||||
|
||||
response_type send_set_modulator_settings(modulator_settings_com &settings);
|
||||
response_type send_set_demodulator_settings(demodulator_settings_com &settings);
|
||||
response_type send_get_modulator_settings(modulator_settings_com &settings);
|
||||
response_type send_get_demodulator_settings(demodulator_settings_com &settings);
|
||||
|
||||
response_type send_set_buc_lnb_settings(buc_lnb_settings_com &settings);
|
||||
response_type send_get_buc_lnb_settings(buc_lnb_settings_com &settings);
|
||||
|
||||
response_type send_set_dpdi_params(dpdi_parameters &dpdi_params);
|
||||
response_type send_get_dpdi_params(dpdi_parameters &dpdi_params);
|
||||
|
||||
response_type send_set_lbq_params(const uint32_t & tick_ms, const uint32_t & bucket_size);
|
||||
|
||||
response_type send_set_qos_params(const std::string &node, const name_classes_qos & class_qos);
|
||||
response_type send_get_qos_params(std::string &node, const name_classes_qos & class_qos);
|
||||
|
||||
response_type send_set_qos_settings_json(const std::string &json_string, bool is_enable);
|
||||
response_type send_get_qos_settings_json(std::string &json_string, bool &is_enable);
|
||||
|
||||
void set_stdout_callback(std::function<void(const char *, uint32_t)> cb);
|
||||
void abort();
|
||||
|
||||
private:
|
||||
system_client(const system_client&) = delete;
|
||||
const system_client& operator=(const system_client&) = delete;
|
||||
|
||||
boost::asio::io_context io_context;
|
||||
client clt;
|
||||
std::function<void(const std::string&)> log;
|
||||
std::thread ctx_thread;
|
||||
std::atomic<uint32_t> cmd_id;
|
||||
|
||||
std::mutex cb_mtx;
|
||||
std::function<void(const char *, uint32_t len)> stdout_cb;
|
||||
|
||||
std::mutex responses_mtx;
|
||||
std::map<uint32_t, std::queue<response_type>> responses;
|
||||
std::map<uint32_t, std::queue<std::any>> responses_data;
|
||||
std::condition_variable cv_resp;
|
||||
|
||||
state current_state;
|
||||
|
||||
std::mutex cmd_in_progress_mtx;
|
||||
|
||||
response_type wait_for_response (uint32_t id, const cmd_type & type, std::any & data);
|
||||
response_type wait_for_progressing_response(uint32_t c_id, const cmd_type & cmd_t);
|
||||
void process_response (uint32_t id, response_type resp, std::any && data);
|
||||
void data_received (const std::vector<uint8_t> & data);
|
||||
void send_abort (uint32_t id);
|
||||
|
||||
template<typename... Args>
|
||||
void send_to_socket(Args&&... args)
|
||||
{
|
||||
//TO-DO: need case for empty parameter pack?
|
||||
std::stringstream s;
|
||||
s << std::noskipws;
|
||||
{
|
||||
cereal::BinaryOutputArchive oarchive(s);
|
||||
oarchive(std::forward<Args>(args)...);
|
||||
}
|
||||
std::vector<uint8_t> data((std::istream_iterator<uint8_t>(s)), std::istream_iterator<uint8_t>());
|
||||
clt.write(data);
|
||||
|
||||
}
|
||||
};
|
@ -1,871 +0,0 @@
|
||||
#pragma once
|
||||
#include <cereal/archives/binary.hpp>
|
||||
#include <cereal/types/vector.hpp>
|
||||
#include <cereal/types/string.hpp>
|
||||
|
||||
namespace fm
|
||||
{
|
||||
enum class side_type
|
||||
{
|
||||
local = 0,
|
||||
tftp = 1,
|
||||
config = 2
|
||||
};
|
||||
|
||||
struct side_description
|
||||
{
|
||||
side_type s_type;
|
||||
std::string filepath;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(s_type, filepath);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
enum class cmd_dma_debugg
|
||||
{
|
||||
start = 0,
|
||||
stop = 1,
|
||||
reset = 2,
|
||||
reinit = 3,
|
||||
modcod = 4,
|
||||
log_bool = 5,
|
||||
data_mode = 6,
|
||||
default_params = 7,
|
||||
buc_voltage = 8,
|
||||
lnb_voltage = 9,
|
||||
_10mhz_tx = 10,
|
||||
_10mhz_rx = 11,
|
||||
powerdown_plata = 12,
|
||||
_10MHz_out = 13,
|
||||
current_state_tx = 14,
|
||||
current_state_oib = 15,
|
||||
save_config = 16,
|
||||
begin_save_config = 17
|
||||
};
|
||||
|
||||
struct modulator_settings_com{
|
||||
uint32_t baudrate;
|
||||
double central_freq_in_kGz;
|
||||
double rollof;
|
||||
double attenuation;
|
||||
bool is_test_data;
|
||||
bool is_save_current_state;
|
||||
bool is_carrier;
|
||||
bool tx_is_on;
|
||||
bool is_cinc;
|
||||
uint32_t modcod_tx;
|
||||
bool qold_seq_is_active;
|
||||
};
|
||||
|
||||
struct modulator_state_com{
|
||||
bool is_tx_on;
|
||||
float snr_remote;
|
||||
uint16_t modcod;
|
||||
bool is_short;
|
||||
bool is_pilots;
|
||||
uint32_t speed_in_bytes_tx;
|
||||
uint32_t speed_in_bytes_tx_iface;
|
||||
};
|
||||
|
||||
struct demodulator_locks_com{
|
||||
bool pkt_sync;
|
||||
bool afc_lock;
|
||||
bool freq_lock;
|
||||
bool sym_sync_lock;
|
||||
};
|
||||
|
||||
struct demodulator_settings_com
|
||||
{
|
||||
uint32_t baudrate;
|
||||
double central_freq_in_kGz;
|
||||
double rollof;
|
||||
bool is_aru_on;
|
||||
bool is_rvt_iq;
|
||||
double gain;
|
||||
bool qold_seq_is_active;
|
||||
};
|
||||
|
||||
struct demodulator_state_com{
|
||||
float snr;
|
||||
uint16_t modcod;
|
||||
bool is_short;
|
||||
bool is_pilots;
|
||||
float rssi;
|
||||
double afc_err;
|
||||
double crs_freq_err;
|
||||
double sym_err;
|
||||
double fine_freq_err;
|
||||
double if_overload;
|
||||
uint32_t packet_ok_cnt;
|
||||
uint32_t packet_bad_cnt;;
|
||||
uint32_t dummy_cnt;
|
||||
uint32_t speed_in_bytes_rx;
|
||||
uint32_t speed_in_bytes_rx_iface;
|
||||
demodulator_locks_com locks;
|
||||
};
|
||||
|
||||
struct CinC_state_com{
|
||||
float ratio_signal_signal;
|
||||
bool carrier_lock;
|
||||
int32_t freq_error_offset;
|
||||
float delay_dpdi;
|
||||
int32_t freq_fine_estimate;
|
||||
uint32_t cnt_bad_lock;
|
||||
};
|
||||
|
||||
struct device_state_com{
|
||||
double adrv_temp;
|
||||
double zynq_temp;
|
||||
double pl_temp;
|
||||
};
|
||||
|
||||
enum class voltage_lnb_com{
|
||||
DISABLE = 0, _13V, _18V, _24V
|
||||
};
|
||||
enum class voltage_buc_com{
|
||||
DISABLE = 0, _24V, _48V
|
||||
};
|
||||
struct buc_lnb_settings_com
|
||||
{
|
||||
voltage_lnb_com lnb;
|
||||
bool is_ref_10MHz_lnb = false;
|
||||
voltage_buc_com buc;
|
||||
bool is_ref_10MHz_buc = false;
|
||||
bool is_ref_10MHz_output = false;
|
||||
bool is_save_current_state = false;
|
||||
};
|
||||
enum class name_classes_qos
|
||||
{
|
||||
realtime1 = 0,
|
||||
realtime2,
|
||||
realtime3,
|
||||
critical1,
|
||||
critical2,
|
||||
critical3,
|
||||
cir,
|
||||
pir,
|
||||
wcr1,
|
||||
wcr2,
|
||||
wcr3,
|
||||
enable,
|
||||
ful_node
|
||||
};
|
||||
|
||||
enum class cmd_get_dma_debugg_enum
|
||||
{
|
||||
speed_tx = 0,
|
||||
speed_rx = 1,
|
||||
modcod = 2,
|
||||
drop_bad_rx = 3,
|
||||
drop_full_rx = 4,
|
||||
packet_ok_rx = 5,
|
||||
packet_little_tx = 6,
|
||||
packet_big_tx = 7,
|
||||
bad_modcod_tx = 8,
|
||||
bad_length_tx = 9,
|
||||
reset_cnt_rx = 10,
|
||||
data_mode = 11,
|
||||
buc_voltage = 12,
|
||||
lnb_voltage = 13,
|
||||
_10mhz_tx = 14,
|
||||
_10mhz_rx = 15,
|
||||
powerdown_plata = 16,
|
||||
_10MHz_out = 17,
|
||||
current_state_tx = 18,
|
||||
real_dpdi_shift = 19,
|
||||
freq_error_offset = 20,
|
||||
freq_fine_estimate = 21,
|
||||
speed_tx_iface = 22,
|
||||
speed_rx_iface = 23,
|
||||
current_state_oib = 24,
|
||||
ratio_signal_signal = 25,
|
||||
status_init = 26
|
||||
};
|
||||
|
||||
enum class cmd_10g_config
|
||||
{
|
||||
udp_payload_lenght = 0,
|
||||
local_ip = 1,
|
||||
dest_ip = 2,
|
||||
gateway_ip = 3,
|
||||
subnet_mask = 4,
|
||||
udp_source_port = 5,
|
||||
udp_dest_port = 6,
|
||||
local_mac_31_0 = 7,
|
||||
local_mac_32_47 = 8,
|
||||
mtx_chan0 = 9,
|
||||
mtx_chan1 = 10
|
||||
};
|
||||
|
||||
enum class cmd_level_dem
|
||||
{
|
||||
//! ОСШ на входе
|
||||
snr = 0,
|
||||
//! RSSI на входе
|
||||
rssi = 1,
|
||||
sym_sync_lock = 2,
|
||||
freq_search_lock = 3,
|
||||
afc_lock = 4,
|
||||
pkt_sync = 5,
|
||||
phase_inv = 6,
|
||||
afc_error = 7,
|
||||
sym_error = 8,
|
||||
fine_freq_error = 9,
|
||||
crs_freq_error = 10,
|
||||
gc_gain_aru = 11,
|
||||
rollof = 12,
|
||||
carrier_lock = 13,
|
||||
filt_adapt_lock = 14,
|
||||
snr_acm = 15,
|
||||
modcod_tx = 16
|
||||
};
|
||||
|
||||
enum class interface_value
|
||||
{
|
||||
all = 0,
|
||||
sat0 = 1,
|
||||
gigabit = 2,
|
||||
modulator = 3,
|
||||
demodulator = 4
|
||||
};
|
||||
|
||||
enum class zynq_value
|
||||
{
|
||||
ps_volt = 0,
|
||||
pl_volt = 1,
|
||||
adrv_temp = 2,
|
||||
pl_temp = 3,
|
||||
ps_temp = 4,
|
||||
adrv_temp2 = 5
|
||||
};
|
||||
|
||||
enum class modulator_value
|
||||
{
|
||||
lo_freaquency = 0,
|
||||
baud_rate = 1,
|
||||
temp_treshold = 2,
|
||||
mod_reset = 3,
|
||||
modcod = 4,
|
||||
rollof = 5,
|
||||
mode_transmitt = 6,
|
||||
if_overload = 7,
|
||||
gold_seq = 8
|
||||
};
|
||||
|
||||
enum class demodulator_value
|
||||
{
|
||||
lo_freaquency = 0,
|
||||
baud_rate = 1,
|
||||
freq_search = 2,
|
||||
demod_reset = 3,
|
||||
fec_frame_size = 4,
|
||||
rvt = 5,
|
||||
mode_gain_control = 6,
|
||||
sig_min = 7,
|
||||
sig_max = 8,
|
||||
afc_rst = 9,
|
||||
mode_demod = 10,
|
||||
gold_seq = 11,
|
||||
attitude_signals = 12,
|
||||
is_reset_CinC = 13,
|
||||
is_pilots_insert = 14
|
||||
};
|
||||
enum class getdemodulator_value
|
||||
{
|
||||
lo_freaquency = 0,
|
||||
baud_rate = 1,
|
||||
dummy_counter = 2,
|
||||
modcod = 3,
|
||||
mode_gain_control = 4,
|
||||
sig_min = 5,
|
||||
sig_max = 6,
|
||||
rvt = 7,
|
||||
fec_size = 8,
|
||||
mode_demod = 9,
|
||||
cnt_bad_lock_cinc = 10,
|
||||
gold_seq = 11,
|
||||
attitude_signals = 12,
|
||||
cnt_dem_time_sinc = 13,
|
||||
cnt_dem_lock_afc = 14,
|
||||
cnt_dem_sync_pack = 15,
|
||||
cnt_dem_sinc_frec_corse = 16,
|
||||
freq_lock_estimate = 17,
|
||||
freq_fine_estimate = 18,
|
||||
is_reset_CinC = 19,
|
||||
type_pack = 20,
|
||||
is_pilots = 21,
|
||||
is_pilots_insert = 22
|
||||
};
|
||||
|
||||
enum class gain_value
|
||||
{
|
||||
tx1 = 0,
|
||||
tx2 = 1,
|
||||
rx1 = 2,
|
||||
rx2 = 3,
|
||||
txpwd = 4,
|
||||
rxpwd = 5
|
||||
};
|
||||
|
||||
enum class acm_value
|
||||
{
|
||||
enable = 0,
|
||||
modcod_min = 1,
|
||||
modcod_max = 2,
|
||||
attenuation_min = 3,
|
||||
attenuatin_max = 4,
|
||||
required_snr = 5
|
||||
};
|
||||
|
||||
enum class cmd_radio
|
||||
{
|
||||
tx1 = 0,
|
||||
tx2 = 1,
|
||||
rx1 = 2,
|
||||
rx2 = 3,
|
||||
global = 4,
|
||||
global2 = 5
|
||||
};
|
||||
|
||||
enum class network_value
|
||||
{
|
||||
network = 0,
|
||||
mode_interface = 1,
|
||||
version = 2,
|
||||
mask = 3,
|
||||
gateway = 4,
|
||||
dhcp_on = 5,
|
||||
dhcp_range = 6,
|
||||
network_data = 7,
|
||||
chip_id = 8,
|
||||
serial = 9,
|
||||
mac_eth0 = 10,
|
||||
mac_eth1 = 11,
|
||||
name_serv = 12,
|
||||
network_debug_send = 13,
|
||||
network_port_metric = 14,
|
||||
network_port_data = 15,
|
||||
periodic_send_metrics = 16,
|
||||
if_debug_mode = 17
|
||||
};
|
||||
|
||||
enum class cmd_type
|
||||
{
|
||||
login = 0,
|
||||
exit = 1,
|
||||
ping = 2,
|
||||
tracert = 3,
|
||||
interface = 4,
|
||||
copy = 5,
|
||||
abort = 6,
|
||||
set_demodulator_frequency = 7,
|
||||
get_demodulator_frequency = 8,
|
||||
set_gain_param = 9,
|
||||
get_gain_param = 10,
|
||||
radio_on_of = 11,
|
||||
modulator_param = 12,
|
||||
zynq_param = 13,
|
||||
set_demodulator_param = 14,
|
||||
get_demodulator_param = 15,
|
||||
get_modulator_param = 16,
|
||||
set_network = 17,
|
||||
get_level_dmd = 18,
|
||||
set_10g_config = 19,
|
||||
set_dma_debugg = 20,
|
||||
get_dma_debugg = 21,
|
||||
set_baudrate_rollof_dmd = 22,
|
||||
set_acm_params = 23,
|
||||
get_acm_params = 24,
|
||||
set_params_dpdi = 25,
|
||||
get_params_dpdi = 26,
|
||||
get_network = 27,
|
||||
set_qos_settings = 28,
|
||||
get_qos_settings = 29,
|
||||
set_lbq_params = 30,
|
||||
get_demodulator_state = 31,
|
||||
get_modulator_state = 32,
|
||||
get_cinc_state = 33,
|
||||
get_device_state = 34,
|
||||
set_modulator_settings = 35,
|
||||
set_demodulator_settings = 36,
|
||||
get_modulator_settings = 37,
|
||||
get_demodulator_settings = 38,
|
||||
set_lnb_buc_settings = 39,
|
||||
get_lnb_buc_settings = 40,
|
||||
set_qos_settings_json = 41,
|
||||
get_qos_settings_json = 42
|
||||
};
|
||||
|
||||
struct cmd_lbq_params
|
||||
{
|
||||
uint32_t tick_ms;
|
||||
uint32_t bucket_size;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(tick_ms, bucket_size);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_lnb_buc_settings{
|
||||
buc_lnb_settings_com buc_lnb;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(buc_lnb.buc, buc_lnb.is_ref_10MHz_buc, buc_lnb.lnb,buc_lnb.is_ref_10MHz_lnb, buc_lnb.is_ref_10MHz_output, buc_lnb.is_save_current_state);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_get_cinc_state
|
||||
{
|
||||
CinC_state_com cinc_state;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(cinc_state.carrier_lock, cinc_state.cnt_bad_lock,
|
||||
cinc_state.delay_dpdi, cinc_state.freq_error_offset,
|
||||
cinc_state.freq_fine_estimate,
|
||||
cinc_state.ratio_signal_signal);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_get_device_state
|
||||
{
|
||||
device_state_com device_state;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(device_state.adrv_temp, device_state.pl_temp, device_state.zynq_temp);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_demodulator_settings
|
||||
{
|
||||
demodulator_settings_com demodulator_settings;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(demodulator_settings.baudrate,demodulator_settings.central_freq_in_kGz,
|
||||
demodulator_settings.gain, demodulator_settings.is_aru_on,
|
||||
demodulator_settings.is_rvt_iq, demodulator_settings.rollof, demodulator_settings.qold_seq_is_active);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_get_demodulator_state
|
||||
{
|
||||
demodulator_state_com demodulator_state;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(demodulator_state.snr, demodulator_state.modcod, demodulator_state.is_short, demodulator_state.is_pilots,
|
||||
demodulator_state.rssi, demodulator_state.afc_err, demodulator_state.crs_freq_err,
|
||||
demodulator_state.sym_err, demodulator_state.fine_freq_err, demodulator_state.if_overload,
|
||||
demodulator_state.packet_ok_cnt, demodulator_state.packet_bad_cnt, demodulator_state.dummy_cnt,
|
||||
demodulator_state.speed_in_bytes_rx, demodulator_state.speed_in_bytes_rx_iface,
|
||||
demodulator_state.locks.afc_lock, demodulator_state.locks.freq_lock, demodulator_state.locks.pkt_sync, demodulator_state.locks.sym_sync_lock );
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_modulator_settings
|
||||
{
|
||||
modulator_settings_com modulator_settings;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(modulator_settings.attenuation,modulator_settings.baudrate, modulator_settings.central_freq_in_kGz,
|
||||
modulator_settings.is_carrier, modulator_settings.is_cinc,
|
||||
modulator_settings.is_save_current_state, modulator_settings.is_test_data,
|
||||
modulator_settings.rollof, modulator_settings.tx_is_on, modulator_settings.modcod_tx, modulator_settings.qold_seq_is_active);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
struct cmd_get_modulator_state{
|
||||
modulator_state_com modulator_state;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(modulator_state.snr_remote, modulator_state.modcod, modulator_state.is_short, modulator_state.is_pilots,
|
||||
modulator_state.is_tx_on, modulator_state.speed_in_bytes_tx, modulator_state.speed_in_bytes_tx_iface);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct cmd_get_network
|
||||
{
|
||||
std::string network;
|
||||
network_value net_val;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(net_val, network);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_set_network
|
||||
{
|
||||
std::string network;
|
||||
network_value net_val;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(net_val, network);
|
||||
}
|
||||
};
|
||||
|
||||
struct dpdi_parameters
|
||||
{
|
||||
uint8_t latitude_station_grad = 0;
|
||||
uint8_t latitude_station_minute = 0;
|
||||
uint8_t longitude_station_grad = 0;
|
||||
uint8_t longitude_station_minute = 0;
|
||||
uint8_t longitude_sattelite_grad = 0;
|
||||
uint8_t longitude_sattelite_minute = 0;
|
||||
bool is_delay_window = 0;
|
||||
uint32_t max_delay = 1;
|
||||
uint32_t min_delay = 0;
|
||||
uint32_t freq_offset = 0;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(latitude_station_grad, latitude_station_minute,
|
||||
longitude_station_grad, longitude_station_minute,
|
||||
longitude_sattelite_grad, longitude_sattelite_minute,
|
||||
is_delay_window, max_delay, min_delay, freq_offset);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct ACM_parameters_serv
|
||||
{
|
||||
double snr_treashold = 0;
|
||||
double snr_treashold_acm = 0.5;
|
||||
uint32_t period_pack = 15;
|
||||
uint8_t max_modcod = 4;
|
||||
uint8_t min_modcod = 4;
|
||||
int max_attenuation = 0;
|
||||
int min_attenuation = 0;
|
||||
bool enable = false;
|
||||
bool enable_auto_atten = false;
|
||||
};
|
||||
|
||||
struct cmd_get_acm_param
|
||||
{
|
||||
double snr_treashold = 0;
|
||||
double snr_treashold_acm = 0.5;
|
||||
uint32_t period_pack = 15;
|
||||
uint8_t max_modcod = 4;
|
||||
uint8_t min_modcod = 4;
|
||||
int max_attenuation = 0;
|
||||
int min_attenuation = 0;
|
||||
bool enable = false;
|
||||
bool enable_auto_atten = false;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(enable, max_attenuation, max_modcod, min_attenuation, min_modcod, snr_treashold, enable_auto_atten, snr_treashold_acm, period_pack);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_qos_settings{
|
||||
std::string json_string;
|
||||
bool is_enable;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(json_string, is_enable);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_set_qos_settings
|
||||
{
|
||||
std::string node;
|
||||
name_classes_qos class_qos;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(node, class_qos);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_get_qos_settings
|
||||
{
|
||||
std::string node;
|
||||
name_classes_qos class_qos;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(node, class_qos);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_set_acm_param
|
||||
{
|
||||
ACM_parameters_serv acm_params;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(acm_params.enable, acm_params.max_attenuation, acm_params.max_modcod, acm_params.min_attenuation, acm_params.min_modcod, acm_params.snr_treashold, acm_params.enable_auto_atten, acm_params.snr_treashold_acm, acm_params.period_pack);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct cmd_get_dma_debug
|
||||
{
|
||||
std::string value;
|
||||
cmd_get_dma_debugg_enum dma_debugg;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(dma_debugg, value);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_set_dma_debug
|
||||
{
|
||||
std::string value;
|
||||
cmd_dma_debugg dma_debugg;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(dma_debugg, value);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_set_10g_config
|
||||
{
|
||||
std::string value;
|
||||
cmd_10g_config _10g_config;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(_10g_config, value);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_get_level_dem
|
||||
{
|
||||
double value;
|
||||
cmd_level_dem lvl_dem;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(lvl_dem, value);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_zynq_param
|
||||
{
|
||||
zynq_value cmd_zynq;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(cmd_zynq);
|
||||
}
|
||||
};
|
||||
|
||||
struct radio_enable
|
||||
{
|
||||
cmd_radio cmd_radio_;
|
||||
bool enbl;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(cmd_radio_, enbl);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_set_modulator_param
|
||||
{
|
||||
modulator_value mod_val;
|
||||
long long value;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(mod_val,value);
|
||||
}
|
||||
};
|
||||
struct cmd_get_modulator_param
|
||||
{
|
||||
modulator_value mod_val;
|
||||
uint32_t value;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(mod_val,value);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_set_rollof_and_demod
|
||||
{
|
||||
double baudrate;
|
||||
double rollof;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(baudrate,rollof);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct cmd_set_demodulator_param
|
||||
{
|
||||
demodulator_value demod_val;
|
||||
uint32_t value;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(demod_val,value);
|
||||
}
|
||||
};
|
||||
|
||||
struct cmd_get_demodulator_param
|
||||
{
|
||||
getdemodulator_value demod_val;
|
||||
uint32_t value;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(demod_val,value);
|
||||
}
|
||||
};
|
||||
|
||||
struct set_gain_par
|
||||
{
|
||||
gain_value g_val;
|
||||
double _gain;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(g_val,_gain);
|
||||
}
|
||||
};
|
||||
|
||||
struct get_gain_par
|
||||
{
|
||||
gain_value g_val;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(g_val);
|
||||
}
|
||||
};
|
||||
|
||||
struct set_dem_freq_cmd
|
||||
{
|
||||
uint32_t frequency;
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(frequency);
|
||||
}
|
||||
};
|
||||
|
||||
enum class response_type
|
||||
{
|
||||
ok = 0,
|
||||
error = 1,
|
||||
in_progress = 3,
|
||||
abort = 4,
|
||||
busy = 5
|
||||
};
|
||||
|
||||
enum class access_rights
|
||||
{
|
||||
not_allowed = 0,
|
||||
user = 1,
|
||||
admin = 2
|
||||
};
|
||||
|
||||
struct cmd_header
|
||||
{
|
||||
uint32_t id;
|
||||
cmd_type cmd;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(id, cmd);
|
||||
}
|
||||
};
|
||||
|
||||
struct login_cmd
|
||||
{
|
||||
std::string username;
|
||||
std::string pass;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(username, pass);
|
||||
}
|
||||
};
|
||||
|
||||
struct ping_cmd
|
||||
{
|
||||
std::string ip_address;
|
||||
size_t count;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(ip_address, count);
|
||||
}
|
||||
};
|
||||
|
||||
struct tracert_cmd
|
||||
{
|
||||
std::string ip_address;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(ip_address);
|
||||
}
|
||||
};
|
||||
|
||||
struct interface_cmd
|
||||
{
|
||||
interface_value val;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(val);
|
||||
}
|
||||
};
|
||||
|
||||
struct copy_cmd
|
||||
{
|
||||
fm::side_description src;
|
||||
fm::side_description dst;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(src, dst);
|
||||
}
|
||||
};
|
||||
|
||||
struct response_header
|
||||
{
|
||||
uint32_t id;
|
||||
cmd_type cmd;
|
||||
response_type rsp;
|
||||
|
||||
template<class Archive>
|
||||
void serialize(Archive & archive)
|
||||
{
|
||||
archive(id, cmd, rsp);
|
||||
}
|
||||
};
|
23
dependencies/control_system/common/seq_packet.h
vendored
23
dependencies/control_system/common/seq_packet.h
vendored
@ -1,23 +0,0 @@
|
||||
#pragma once
|
||||
#include <boost/asio.hpp>
|
||||
|
||||
namespace seq_packet
|
||||
{
|
||||
using namespace boost::asio::local;
|
||||
|
||||
struct seqpacket_protocol
|
||||
{
|
||||
int type() const { return SOCK_SEQPACKET; }
|
||||
int protocol() const { return 0; }
|
||||
int family() const { return AF_UNIX; }
|
||||
|
||||
using endpoint = basic_endpoint<seqpacket_protocol>;
|
||||
using socket = boost::asio::basic_stream_socket<seqpacket_protocol>;
|
||||
using acceptor = boost::asio::basic_socket_acceptor<seqpacket_protocol>;
|
||||
|
||||
#if !defined(BOOST_ASIO_NO_IOSTREAM)
|
||||
/// The UNIX domain iostream type.
|
||||
typedef boost::asio::basic_socket_iostream<seqpacket_protocol> iostream;
|
||||
#endif // !defined(BOOST_ASIO_NO_IOSTREAM)
|
||||
};
|
||||
}
|
@ -1,330 +0,0 @@
|
||||
#ifndef __CONTROL_PROTO_COMMANDS__
|
||||
#define __CONTROL_PROTO_COMMANDS__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERNC extern "C"
|
||||
#else
|
||||
#define EXTERNC extern
|
||||
#endif
|
||||
|
||||
typedef unsigned int TSID;
|
||||
|
||||
typedef enum CP_Res {
|
||||
OK = 0,
|
||||
TIMEOUT,
|
||||
ERROR,
|
||||
ABORT,
|
||||
BUSY
|
||||
} CP_Result;
|
||||
|
||||
typedef void (*CP_cmd_stdout_cb)(const char * str, uint32_t len);
|
||||
|
||||
/*
|
||||
cb - callback for receive stdout of command
|
||||
*/
|
||||
EXTERNC void CP_SetCmdStdoutCallback(TSID sid, CP_cmd_stdout_cb cb);
|
||||
/*
|
||||
sid -- current session ID
|
||||
*/
|
||||
EXTERNC void CP_CmdAbort(TSID sid);
|
||||
/*
|
||||
host -- host name
|
||||
user -- user name
|
||||
pwd -- password hash
|
||||
sid -- output session ID (used for all requests)
|
||||
access -- output type of privilegies {admin|operator|...etc}
|
||||
*/
|
||||
EXTERNC CP_Result CP_Login(const char * user, const char * pwd, TSID * sid, unsigned int * access);
|
||||
/*
|
||||
sid -- current session ID
|
||||
*/
|
||||
EXTERNC CP_Result CP_Logout(TSID sid);
|
||||
/*
|
||||
sid -- current session ID
|
||||
ip_address -- IP address of the host
|
||||
packet_count -- count of packets to send
|
||||
*/
|
||||
EXTERNC CP_Result CP_GetDmaDebug(TSID sid, const char *command, std::string *val);
|
||||
|
||||
EXTERNC CP_Result CP_SetDemFreq(TSID sid, uint32_t freq);
|
||||
|
||||
EXTERNC CP_Result CP_GetDemFreq(TSID sid, uint32_t * freq);
|
||||
|
||||
EXTERNC CP_Result CP_SetDmaDebug(TSID sid, const char *command, std::string val);
|
||||
|
||||
EXTERNC CP_Result CP_Set10gConfig(TSID sid, const char *parameter, std::string val);
|
||||
|
||||
EXTERNC CP_Result CP_SetRollofBaudrate(TSID sid, double rollof,double baudrate);
|
||||
|
||||
//interfaces<TX1><TX2><RX1><RX2>
|
||||
EXTERNC CP_Result CP_GetGain(TSID sid, const char *gain_interface, double *gain);
|
||||
//interfaces<TX1><TX2><RX1><RX2>
|
||||
EXTERNC CP_Result CP_SetGain(TSID sid, const char *gain_interface, double gain);
|
||||
//interfaces<TX1><TX2><RX1><RX2>
|
||||
EXTERNC CP_Result CP_RadioEnable(TSID sid, const char *radio_interface, bool on_of);
|
||||
//interfaces<TX1><TX2><RX1><RX2>
|
||||
/*
|
||||
BOD -- baud_rate
|
||||
SPREAD -- koef spread
|
||||
LO -- lo frequency
|
||||
*/
|
||||
EXTERNC CP_Result CP_ModulatorParams(TSID sid, const char *modulator_param, uint32_t value);
|
||||
|
||||
struct modulator_state{
|
||||
bool is_tx_on;
|
||||
float snr_remote;
|
||||
uint16_t modcod;
|
||||
bool is_short;
|
||||
bool is_pilots;
|
||||
uint32_t speed_in_bytes_tx;
|
||||
uint32_t speed_in_bytes_tx_iface;
|
||||
};
|
||||
EXTERNC CP_Result CP_GetModulatorState(TSID sid, modulator_state &state);
|
||||
|
||||
struct demodulator_locks{
|
||||
bool pkt_sync;
|
||||
bool afc_lock;
|
||||
bool freq_lock;
|
||||
bool sym_sync_lock;
|
||||
};
|
||||
struct demodulator_state{
|
||||
float snr;
|
||||
uint16_t modcod;
|
||||
bool is_short;
|
||||
bool is_pilots;
|
||||
float rssi;
|
||||
double afc_err;
|
||||
double crs_freq_err;
|
||||
double sym_err;
|
||||
double fine_freq_err;
|
||||
double if_overload;
|
||||
uint32_t packet_ok_cnt;
|
||||
uint32_t packet_bad_cnt;
|
||||
uint32_t dummy_cnt;
|
||||
uint32_t speed_in_bytes_rx;
|
||||
uint32_t speed_in_bytes_rx_iface;
|
||||
demodulator_locks locks;
|
||||
};
|
||||
EXTERNC CP_Result CP_GetDemodulatorState(TSID sid, demodulator_state &state);
|
||||
|
||||
struct CinC_state{
|
||||
float ratio_signal_signal;
|
||||
bool carrier_lock;
|
||||
int32_t freq_error_offset;
|
||||
float delay_dpdi;
|
||||
int32_t freq_fine_estimate;
|
||||
uint32_t cnt_bad_lock;
|
||||
};
|
||||
EXTERNC CP_Result CP_GetCinCState(TSID sid, CinC_state &state);
|
||||
|
||||
struct device_state{
|
||||
double adrv_temp;
|
||||
double zynq_temp;
|
||||
double pl_temp;
|
||||
};
|
||||
EXTERNC CP_Result CP_GetDeviceState(TSID sid, device_state &state);
|
||||
|
||||
struct modulator_settings{
|
||||
uint32_t baudrate;
|
||||
double central_freq_in_kGz;
|
||||
double rollof;
|
||||
double attenuation;
|
||||
bool is_test_data;
|
||||
bool is_save_current_state;
|
||||
bool is_carrier;
|
||||
bool tx_is_on;
|
||||
bool is_cinc;
|
||||
uint32_t modcod_tx;
|
||||
bool qold_seq_is_active;
|
||||
};
|
||||
|
||||
EXTERNC CP_Result CP_SetModulatorSettings(TSID sid, modulator_settings& settings);
|
||||
EXTERNC CP_Result CP_GetModulatorSettings(TSID sid, modulator_settings& settings);
|
||||
|
||||
struct demodulator_settings
|
||||
{
|
||||
uint32_t baudrate;
|
||||
double central_freq_in_kGz;
|
||||
double rollof;
|
||||
bool is_aru_on;
|
||||
bool is_rvt_iq;
|
||||
double gain;
|
||||
bool qold_seq_is_active;
|
||||
};
|
||||
|
||||
EXTERNC CP_Result CP_SetDemodulatorSettings(TSID sid, demodulator_settings& settings);
|
||||
EXTERNC CP_Result CP_GetDemodulatorSettings(TSID sid, demodulator_settings& settings);
|
||||
|
||||
enum class voltage_lnb{
|
||||
DISABLE = 0, _13V, _18V, _24V
|
||||
};
|
||||
enum class voltage_buc{
|
||||
DISABLE = 0, _24V, _48V
|
||||
};
|
||||
struct buc_lnb_settings
|
||||
{
|
||||
voltage_lnb lnb;
|
||||
bool is_ref_10MHz_lnb = false;
|
||||
voltage_buc buc;
|
||||
bool is_ref_10MHz_buc = false;
|
||||
bool is_ref_10MHz_output = false;
|
||||
bool is_save_current_state = false;
|
||||
};
|
||||
|
||||
EXTERNC CP_Result CP_SetBUC_LNB_settings(TSID sid, buc_lnb_settings &settings);
|
||||
EXTERNC CP_Result CP_GetBUC_LNB_settings(TSID sid, buc_lnb_settings &settings);
|
||||
|
||||
EXTERNC CP_Result CP_SetQoSSettings(TSID sid, const std::string &qos_settings_json, bool is_enable);
|
||||
EXTERNC CP_Result CP_GetQoSSettings(TSID sid, std::string &qos_settings_json, bool &is_enable);
|
||||
|
||||
EXTERNC CP_Result CP_GetModulatorParams(TSID sid, const char *modulator_param, uint32_t *value);
|
||||
|
||||
EXTERNC CP_Result CP_GetDemodulatorParams(TSID sid, const char *demodulator_param, uint32_t *value);
|
||||
|
||||
EXTERNC CP_Result CP_GetLevelDemod(TSID sid, const char * param ,double *value);
|
||||
|
||||
EXTERNC CP_Result CP_DemodulatorParams(TSID sid, const char *demodulator_param, uint32_t value);
|
||||
|
||||
EXTERNC CP_Result CP_SetLBQParams(TSID sid, const uint32_t &tick_ms, const uint32_t &bucket_size);
|
||||
|
||||
EXTERNC CP_Result CP_SetQoSParams(TSID sid, const std::string &type_node, const std::string & node);
|
||||
|
||||
EXTERNC CP_Result CP_GetQoSParams(TSID sid, const std::string &type_node, std::string * node);
|
||||
|
||||
struct ACM_parameters_serv_
|
||||
{
|
||||
double snr_treashold = 0;
|
||||
double snr_treashold_acm = 0.5;
|
||||
uint32_t period_pack = 15;
|
||||
uint8_t max_modcod = 4;
|
||||
uint8_t min_modcod = 4;
|
||||
int max_attenuation = 0;
|
||||
int min_attenuation = 0;
|
||||
bool enable = false;
|
||||
bool enable_auto_atten = false;
|
||||
};
|
||||
|
||||
struct DPDI_parmeters
|
||||
{
|
||||
uint8_t latitude_station_grad = 0;
|
||||
uint8_t latitude_station_minute = 0;
|
||||
uint8_t longitude_station_grad = 0;
|
||||
uint8_t longitude_station_minute = 0;
|
||||
uint8_t longitude_sattelite_grad = 0;
|
||||
uint8_t longitude_sattelite_minute = 0;
|
||||
bool is_delay_window = 0;
|
||||
uint32_t max_delay = 1;
|
||||
uint32_t min_delay = 0;
|
||||
uint32_t freq_offset = 0;
|
||||
};
|
||||
|
||||
EXTERNC CP_Result CP_SetAcmParams(TSID sid, ACM_parameters_serv_ acm_params);
|
||||
EXTERNC CP_Result CP_GetAcmParams(TSID sid, ACM_parameters_serv_ *acm_params);
|
||||
|
||||
EXTERNC CP_Result CP_SetDpdiParams(TSID sid, DPDI_parmeters dpdi_params);
|
||||
EXTERNC CP_Result CP_GetDpdiParams(TSID sid, DPDI_parmeters *dpdi_pars_get);
|
||||
|
||||
/*
|
||||
PSV
|
||||
PLV
|
||||
PST
|
||||
PLT
|
||||
ADRVT
|
||||
*/
|
||||
EXTERNC CP_Result CP_ZynqParams(TSID sid, const char *zynq_param, double *value);
|
||||
|
||||
EXTERNC CP_Result CP_SetNetwork(TSID sid, const char *param_name, const char *val);
|
||||
EXTERNC CP_Result CP_GetNetwork(TSID sid, const char *param_name, std::string *val);
|
||||
/*
|
||||
ip_address -- new IP address fot the host
|
||||
*/
|
||||
|
||||
EXTERNC CP_Result CP_Ping(TSID sid, const char * ip_address, int packet_count);
|
||||
/*
|
||||
sid -- current session ID
|
||||
ip_address -- IP address of the host
|
||||
*/
|
||||
EXTERNC CP_Result CP_Traceroute(TSID sid, const char * ip_address);
|
||||
/*
|
||||
sid -- current session ID
|
||||
src -- {"running-config"|"startup-config"|host_address}
|
||||
dst -- {"running-config"|"startup-config"|host_address}
|
||||
NOTE:
|
||||
src and dst both must be different
|
||||
*/
|
||||
EXTERNC CP_Result CP_Copy(TSID sid, const char * src, const char * dst);
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"all"|"sat0"|"gigabit"|"modulator"|"demodulator"}
|
||||
output data goes to callback
|
||||
*/
|
||||
EXTERNC CP_Result CP_ShowInterface(TSID sid, const char * interface);
|
||||
/*
|
||||
sid -- current session ID
|
||||
out_startup_config -- received information about startup config
|
||||
*/
|
||||
EXTERNC CP_Result CP_ShowStartupConfig(TSID sid, char ** out_startup_config);
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"all"|"sat0"|"gigabit"|"modulator"|"demodulator"}
|
||||
out_startup_config -- received information about startup config
|
||||
*/
|
||||
EXTERNC CP_Result CP_ShowStartupConfigInterface(TSID sid, const char * interface, char ** out_startup_config);
|
||||
|
||||
// Demodulator
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"SAT"|"Ethernet"|"Loopback"}
|
||||
rate -- symbol rate
|
||||
*/
|
||||
EXTERNC CP_Result CP_SetDemodSymrate(TSID sid, const char * interface, uint32_t rate);
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"SAT"|"Ethernet"|"Loopback"}
|
||||
rate -- frequency value in Hertz
|
||||
*/
|
||||
EXTERNC CP_Result CP_SetDemodFrequency(TSID sid, const char * interface, uint32_t freq);
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"SAT"|"Ethernet"|"Loopback"}
|
||||
mode -- {"on"|"off"|"auto"}
|
||||
*/
|
||||
EXTERNC CP_Result CP_SetDemodSpectrum(TSID sid, const char * interface, const char * mode);
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"SAT"|"Ethernet"|"Loopback"}
|
||||
mode -- {"on"|"off"}
|
||||
*/
|
||||
EXTERNC CP_Result CP_SetDemodReference(TSID sid, const char * interface, const char * mode);
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"SAT"|"Ethernet"|"Loopback"}
|
||||
rate -- frequency value in Hertz
|
||||
*/
|
||||
EXTERNC CP_Result CP_SetDemodSearch(TSID sid, const char * interface, uint32_t freq);
|
||||
|
||||
// Modulator
|
||||
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"SAT"|"Ethernet"|"Loopback"}
|
||||
rate -- symbol rate
|
||||
*/
|
||||
EXTERNC CP_Result CP_SetModSymrate(TSID sid, const char * interface, uint32_t rate);
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"SAT"|"Ethernet"|"Loopback"}
|
||||
rate -- frequency value in Hertz
|
||||
*/
|
||||
EXTERNC CP_Result CP_SetModSymFrequency(TSID sid, const char * interface, uint32_t freq);
|
||||
/*
|
||||
sid -- current session ID
|
||||
interface -- {"SAT"|"Ethernet"|"Loopback"}
|
||||
mode -- {"on"|"off"}
|
||||
*/
|
||||
EXTERNC CP_Result CP_SetModReference(TSID sid, const char * interface, const char * mode);
|
||||
#endif
|
1
dependencies/control_system_client
vendored
Submodule
1
dependencies/control_system_client
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit c7dec65f5d131a5bcfb831273916ba3e36337248
|
@ -880,28 +880,28 @@ std::string api_driver::ApiDriver::loadSettings() const {
|
||||
result << ",\"txBaudrate\":" << modSettings.baudrate;
|
||||
result << ",\"txRolloff\":" << static_cast<int>(modSettings.rollof * 100);
|
||||
#ifdef MODEM_IS_SCPC
|
||||
result << ",\"txGoldan\":" << static_cast<int>(modSettings.qold_seq_is_active);
|
||||
result << ",\"txGoldan\":" << static_cast<int>(modSettings.gold_seq_is_active);
|
||||
#endif
|
||||
result << ",\"txAttenuation\":"; writeDouble(result, modSettings.attenuation);
|
||||
|
||||
#ifdef MODEM_IS_SCPC
|
||||
result << ",\n\"isCinC\":" << boolAsStr(modSettings.is_cinc);
|
||||
result << ",\n\"dvbServicePacketPeriod\":" << acmSettings.period_pack;
|
||||
result << ",\"dvbIsAcm\":" << boolAsStr(acmSettings.enable);
|
||||
result << ",\n\"dvbServicePacketPeriod\":" << acmSettings.period_pack_acm;
|
||||
result << ",\"dvbIsAcm\":" << boolAsStr(acmSettings.enable_acm);
|
||||
result << ",\"txFrameSizeNormal\":" << boolAsStr((modSettings.modcod_tx & 2) == 0);
|
||||
|
||||
result << R"(,"dvbCcmModulation":")" << extractModcodModulation(modSettings.modcod_tx) << "\"";
|
||||
result << R"(,"dvbCcmSpeed":")" << extractModcodSpeed(modSettings.modcod_tx) << "\"";
|
||||
result << R"(,"dvbAcmMinModulation":")" << extractModcodModulation(acmSettings.min_modcod) << "\"";
|
||||
result << R"(,"dvbAcmMinSpeed":")" << extractModcodSpeed(acmSettings.min_modcod) << "\"";
|
||||
result << R"(,"dvbAcmMaxModulation":")" << extractModcodModulation(acmSettings.max_modcod) << "\"";
|
||||
result << R"(,"dvbAcmMaxSpeed":")" << extractModcodSpeed(acmSettings.max_modcod) << "\"";
|
||||
result << ",\"dvbSnrReserve\":"; writeDouble(result, acmSettings.snr_treashold_acm);
|
||||
result << R"(,"dvbAcmMinModulation":")" << extractModcodModulation(acmSettings.min_modcod_acm) << "\"";
|
||||
result << R"(,"dvbAcmMinSpeed":")" << extractModcodSpeed(acmSettings.min_modcod_acm) << "\"";
|
||||
result << R"(,"dvbAcmMaxModulation":")" << extractModcodModulation(acmSettings.max_modcod_acm) << "\"";
|
||||
result << R"(,"dvbAcmMaxSpeed":")" << extractModcodSpeed(acmSettings.max_modcod_acm) << "\"";
|
||||
result << ",\"dvbSnrReserve\":"; writeDouble(result, acmSettings.snr_threashold_acm);
|
||||
|
||||
result << ",\n\"aupcEn\":" << boolAsStr(acmSettings.enable_auto_atten);
|
||||
result << ",\"aupcMinAttenuation\":"; writeDouble(result, acmSettings.min_attenuation);
|
||||
result << ",\"aupcMaxAttenuation\":"; writeDouble(result, acmSettings.max_attenuation);
|
||||
result << ",\"aupcRequiredSnr\":"; writeDouble(result, acmSettings.snr_treashold);
|
||||
result << ",\n\"aupcEn\":" << boolAsStr(acmSettings.enable_aupc);
|
||||
result << ",\"aupcMinAttenuation\":"; writeDouble(result, acmSettings.min_attenuation_aupc);
|
||||
result << ",\"aupcMaxAttenuation\":"; writeDouble(result, acmSettings.max_attenuation_aupc);
|
||||
result << ",\"aupcRequiredSnr\":"; writeDouble(result, acmSettings.snr_threashold_aupc);
|
||||
|
||||
result << ",\n\"cincIsPositional\":" << boolAsStr(!dpdiSettings.is_delay_window);
|
||||
result << ",\"cincSearchBandwidth\":" << dpdiSettings.freq_offset; // полоса поиска в кГц
|
||||
@ -919,7 +919,7 @@ std::string api_driver::ApiDriver::loadSettings() const {
|
||||
result << ",\"rxBaudrate\":" << demodSettings.baudrate;
|
||||
result << ",\"rxRolloff\":" << static_cast<int>(demodSettings.rollof * 100);
|
||||
#ifdef MODEM_IS_SCPC
|
||||
result << ",\"txGoldan\":" << static_cast<int>(demodSettings.qold_seq_is_active);
|
||||
result << ",\"txGoldan\":" << static_cast<int>(demodSettings.gold_seq_is_active);
|
||||
#endif
|
||||
|
||||
// BUC LNB
|
||||
@ -1022,7 +1022,7 @@ void api_driver::ApiDriver::setRxTxSettings(boost::property_tree::ptree &pt) {
|
||||
mod.baudrate = pt.get<uint32_t>("txBaudrate");
|
||||
mod.rollof = pt.get<int>("txRolloff") / 100.0;
|
||||
#ifdef MODEM_IS_SCPC
|
||||
mod.qold_seq_is_active = pt.get<bool>("txGoldan");
|
||||
mod.gold_seq_is_active = pt.get<bool>("txGoldan");
|
||||
#endif
|
||||
mod.attenuation = pt.get<double>("txAttenuation");
|
||||
|
||||
@ -1039,20 +1039,20 @@ void api_driver::ApiDriver::setRxTxSettings(boost::property_tree::ptree &pt) {
|
||||
demod.baudrate = pt.get<uint32_t>("rxBaudrate");
|
||||
demod.rollof = pt.get<int>("rxRolloff") / 100.0;
|
||||
#ifdef MODEM_IS_SCPC
|
||||
demod.qold_seq_is_active = pt.get<bool>("rxGoldan");
|
||||
demod.gold_seq_is_active = pt.get<bool>("rxGoldan");
|
||||
#endif
|
||||
|
||||
#ifdef MODEM_IS_SCPC
|
||||
// ACM
|
||||
acm.period_pack = pt.get<uint32_t>("dvbServicePacketPeriod");
|
||||
acm.enable = pt.get<bool>("rxAgcEn");
|
||||
acm.min_modcod = buildModcodFromPt(pt, "dvbAcmMin", acmIsShortFrame);
|
||||
acm.max_modcod = buildModcodFromPt(pt, "dvbAcmMax", acmIsShortFrame);
|
||||
acm.snr_treashold_acm = pt.get<double>("dvbSnrReserve"); // запас ОСШ
|
||||
acm.enable_auto_atten = pt.get<bool>(json_path("aupcEn", '/'));
|
||||
acm.min_attenuation = pt.get<int>("aupcMinAttenuation");
|
||||
acm.max_attenuation = pt.get<int>("aupcMaxAttenuation");
|
||||
acm.snr_treashold = pt.get<double>("aupcRequiredSnr");
|
||||
acm.period_pack_acm = pt.get<uint32_t>("dvbServicePacketPeriod");
|
||||
acm.enable_acm = pt.get<bool>("rxAgcEn");
|
||||
acm.min_modcod_acm = buildModcodFromPt(pt, "dvbAcmMin", acmIsShortFrame);
|
||||
acm.max_modcod_acm = buildModcodFromPt(pt, "dvbAcmMax", acmIsShortFrame);
|
||||
acm.snr_threashold_acm = pt.get<double>("dvbSnrReserve"); // запас ОСШ
|
||||
acm.enable_aupc = pt.get<bool>(json_path("aupcEn", '/'));
|
||||
acm.min_attenuation_aupc = pt.get<int>("aupcMinAttenuation");
|
||||
acm.max_attenuation_aupc = pt.get<int>("aupcMaxAttenuation");
|
||||
acm.snr_threashold_aupc= pt.get<double>("aupcRequiredSnr");
|
||||
|
||||
daemon->setSettingsRxTx(mod, demod, acm);
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user