/**
 * @file comms_sband_sim.c
 *
 * @brief This file has the functions of all S-Band simulations
 *
 * @copyright Copyright 2023 Antaris, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
#ifdef S_BAND_SIM_CB

#include <stdio.h>
#include"comms_csw.h"
#include"comms_sband_sim.h"
#include"comms_sband_init.h"
#include "logger.h"

f32 rssi_lut[52] = {-93,-94,-70.25,-82.25,-90.75,-94.25,-71,-82,-90.75,-94.5,-71.25,-82.5,-90.75,-95,-92.25,-94.5,-94.75,-94.75,-92.5,-94.75,-95,-95,-93.25,-95.25,-95.5,-95.5,-69,-78.75,-89.75,-95.25,-68.75,-80.25,-89.5,-95.75,-69,-80.5,-89.75,-96,-92.25,-95.75,-96.25,-96.25,-93.25,-96.25,-96.75,-96.75,-94.25,-96.75,-97.5,-97.25,-93,-94};

/** S-Band simulator TX configuration */
s_comms_tx_cfg PLACE_IN_EXT_RAM_MEM tx_cfg_sim;
/** S-Band simulator RX configuration */  
s_comms_rx_cfg PLACE_IN_EXT_RAM_MEM rx_cfg_sim;
/** S-Band simulator system configuration */
s_comms_sys_cfg PLACE_IN_EXT_RAM_MEM sys_cfg_sim;
/** S-Band simulator calibration configuration */
s_comms_cal_cfg PLACE_IN_EXT_RAM_MEM cal_cfg_sim;
/** S-Band simulator telemetry properties */
s_comms_tm_prop PLACE_IN_EXT_RAM_MEM tm_prop_sim;

extern s_comms_tx_cfg PLACE_IN_EXT_RAM_MEM tx_cfg_rb;
extern s_comms_rx_cfg PLACE_IN_EXT_RAM_MEM rx_cfg_rb;
extern s_comms_sys_cfg PLACE_IN_EXT_RAM_MEM sys_cfg_rb;
extern s_comms_cal_cfg PLACE_IN_EXT_RAM_MEM cal_cfg_global;
extern s_comms_tm_prop PLACE_IN_EXT_RAM_MEM tm_prop_global;

/**
 * @brief Updates SRS-4 TM properties without TX.
 *
 * This function updates the SRS-4 telemetry properties 
 * for S-Band simulator without TX enabled.
 */
void sdr_sim_upd_srs4_tm_prop_wo_tx(void)
{
    tm_prop_sim.temp_psu = 2825;
    tm_prop_sim.temp_mcu = 2893;
    tm_prop_sim.temp_fpga = 3187;
    tm_prop_sim.temp_xcvr = 2925;
    tm_prop_sim.temp_lna = 2887;
    tm_prop_sim.temp_pa = 2831;
    tm_prop_sim.volt_vin = 6070;
    tm_prop_sim.volt_3v3 = 3337;
    tm_prop_sim.volt_1v8 = 1805;
    tm_prop_sim.volt_1v0 = 963;
    tm_prop_sim.volt_pa = 0;
    tm_prop_sim.cur_vin = 226;
    tm_prop_sim.cur_3v3 = 382;
    tm_prop_sim.cur_1v8 = 279;
    tm_prop_sim.cur_1v0 = 341;
    tm_prop_sim.cur_pa = 0;
    tm_prop_sim.power_vin = 1374;
    tm_prop_sim.power_3v3 = 1274;
    tm_prop_sim.power_1v8 = 504;
    tm_prop_sim.power_1v0 = 329;
    tm_prop_sim.power_pa = 0;

    rx_cfg_sim.rx_cfg_frames             = 0;
    rx_cfg_sim.rx_cfg_detected           = 0;
    rx_cfg_sim.rx_cfg_rssi               = -98.75;
    rx_cfg_sim.rx_cfg_freqerr            = 14511.9336;
    rx_cfg_sim.rx_cfg_symerr             = 108.987091;
    rx_cfg_sim.rx_cfg_ebn0               = -87.1339874;
    rx_cfg_sim.rx_cfg_carrier_lock       = 0;
    rx_cfg_sim.rx_frame_lock             = 0;

    tx_cfg_sim.tx_cfg_frames  = 0;
    tx_cfg_sim.tx_cfg_pwr_fwd = 0;
    tx_cfg_sim.tx_cfg_pwr_rfl = 0;
}

uint8  PLACE_IN_EXT_RAM_MEM tmrand = 0;
uint8 PLACE_IN_EXT_RAM_MEM rssi_lut_id = 0;

/**
 * @brief Updates SRS-4 TM properties with TX enabled.
 * 
 * This function updates the SRS-4 telemetry properties
 * for S-Band simulator with TX enabled. 
 */
void sdr_sim_upd_srs4_tm_prop_with_tx(void)
{
    if(tmrand)
    {
        tm_prop_sim.temp_mcu = 3062;
        tm_prop_sim.temp_psu = 3231;
        tm_prop_sim.temp_fpga = 3256;
        tm_prop_sim.temp_xcvr = 2993;
        tm_prop_sim.temp_lna = 2993;
        tm_prop_sim.temp_pa = 4093;
        tm_prop_sim.volt_vin = 5955;
        tm_prop_sim.volt_3v3 = 3342;
        tm_prop_sim.volt_1v8 = 1808;
        tm_prop_sim.volt_1v0 = 963;
        tm_prop_sim.volt_pa = 27703;
        tm_prop_sim.cur_vin = 2061;
        tm_prop_sim.cur_3v3 = 699;
        tm_prop_sim.cur_1v8 = 472;
        tm_prop_sim.cur_1v0 = 317;
        tm_prop_sim.cur_pa = 308;
        tm_prop_sim.power_vin = 12273;
        tm_prop_sim.power_3v3 = 2340;
        tm_prop_sim.power_1v8 = 855 ;
        tm_prop_sim.power_1v0 =  306;
        tm_prop_sim.power_pa = 8535;
    }
    else
    {
        tm_prop_sim.temp_mcu  = 3831;
        tm_prop_sim.temp_psu  = 3775;
        tm_prop_sim.temp_fpga = 3968;
        tm_prop_sim.temp_xcvr = 3675;
        tm_prop_sim.temp_lna  = 3687;
        tm_prop_sim.temp_pa   = 4156;
        tm_prop_sim.volt_vin  = 6070;
        tm_prop_sim.volt_3v3  = 3335;
        tm_prop_sim.volt_1v8  = 1805;
        tm_prop_sim.volt_1v0  = 965 ;
        tm_prop_sim.volt_pa   = 10  ;
        tm_prop_sim.cur_vin   = 228 ;
        tm_prop_sim.cur_3v3   = 386 ;
        tm_prop_sim.cur_1v8   = 281 ;
        tm_prop_sim.cur_1v0   = 346 ;
        tm_prop_sim.cur_pa    = 0   ;
        tm_prop_sim.power_vin = 1385;
        tm_prop_sim.power_3v3 = 1287;
        tm_prop_sim.power_1v8 = 507 ;
        tm_prop_sim.power_1v0 = 335 ;
        tm_prop_sim.power_pa  = 0   ;
    }

    tmrand = (tmrand + 1)&0x01;

    tx_cfg_sim.tx_cfg_frames ++;
    tx_cfg_sim.tx_cfg_pwr_fwd = tx_cfg_sim.tx_cfg_pout + 2.841999;
    tx_cfg_sim.tx_cfg_pwr_rfl = tx_cfg_sim.tx_cfg_pout - 5.045 ;

    rx_cfg_sim.rx_cfg_rssi               = rssi_lut[rssi_lut_id];
    rx_cfg_sim.rx_cfg_freqerr            = 14799.44824;
    rx_cfg_sim.rx_cfg_symerr             = -(rx_cfg_sim.rx_cfg_rssi/1.75);
    rx_cfg_sim.rx_cfg_ebn0               = -(82.549942/1.1);

    rssi_lut_id = (rssi_lut_id+1)%52;
}

/**
 * @brief This function is used for getting the configurable params from the S-Band Module 
 * @brief Gets S-Band simulator configuration.
 *
 * @param[in] prop_id Property ID to get.
 * @param[out] value Pointer to value buffer.
 * @param[in] size Buffer size.
 * @return Execution status.
 *
 * This function handles getting the specified configuration property 
 * value for the S-Band simulator.
 */
int32_t sdr_sband_sim_get_cfg(uint16_t prop_id, void *value, uint32_t size)
{
    int32_t ret = 0;

    return ret;

}

/**
 * @brief This function is used for setting the configurable paraams of the S-Band module
 * @brief Sets S-Band simulator configuration.
 *
 * @param[in] prop_id Property ID to set.
 * @param[in] value Pointer to value to set.
 * @param[in] size Value size. 
 * @return Execution status.
 *
 * This function handles setting the specified configuration property
 * value for the S-Band simulator.
 */
int32_t sdr_sband_sim_set_cfg(uint16_t prop_id, void *value, uint32_t size)
{
    int32_t ret = 0;

    return ret;
}

/**
 * @brief  This function is used for getting the transmission config of the S-Band Module
 * @brief Gets S-Band simulator TX configuration.
 * 
 * @param[out] tx_cfg TX configuration structure.
 * @return Execution status.
 */
int32_t sdr_sband_sim_get_tx_cfg(s_comms_tx_cfg *tx_cfg)
{
    int32_t ret = 0;
    memcpy(&tx_cfg->crypto_cfg,&tx_cfg_sim.crypto_cfg, sizeof(s_comms_tx_crypto_cfg ));

    tx_cfg->tx_cfg_freq         = tx_cfg_sim.tx_cfg_freq        ;
    tx_cfg->tx_cfg_type         = tx_cfg_sim.tx_cfg_type        ;
    tx_cfg->tx_cfg_rate         = tx_cfg_sim.tx_cfg_rate        ;
    tx_cfg->tx_cfg_rolloff      = tx_cfg_sim.tx_cfg_rolloff     ;
    tx_cfg->tx_cfg_pout         = tx_cfg_sim.tx_cfg_pout        ;
    tx_cfg->tx_cfg_alc_mode     = tx_cfg_sim.tx_cfg_alc_mode    ;
    tx_cfg->tx_cfg_rs           = tx_cfg_sim.tx_cfg_rs          ;
    tx_cfg->tx_cfg_cc           = tx_cfg_sim.tx_cfg_cc          ;
    tx_cfg->tx_cfg_rand         = tx_cfg_sim.tx_cfg_rand        ;
    tx_cfg->tx_cfg_crc          = tx_cfg_sim.tx_cfg_crc         ;
    tx_cfg->tx_cfg_idletime     = tx_cfg_sim.tx_cfg_idletime    ;
    tx_cfg->tx_cfg_size         = tx_cfg_sim.tx_cfg_size        ;
    tx_cfg->tx_cfg_id           = tx_cfg_sim.tx_cfg_id          ;
    tx_cfg->tx_cfg_pa_templimit = tx_cfg_sim.tx_cfg_pa_templimit;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX Frequency %lu\r\n", tx_cfg->tx_cfg_freq));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_FREQUENCY_IS__u32_,tx_cfg->tx_cfg_freq);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX modulation type %hu\r\n", tx_cfg->tx_cfg_type));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_MODULATION_TYPE_IS__u8_,tx_cfg->tx_cfg_type);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX baud rate %lu\r\n", tx_cfg->tx_cfg_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_BAUD_RATE_IS__u32_,tx_cfg->tx_cfg_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX roll off %hu\r\n", tx_cfg->tx_cfg_rolloff));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_ROLL_OFF_IS__u8_,tx_cfg->tx_cfg_rolloff);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX pout %f\r\n", tx_cfg->tx_cfg_pout));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_THE_TX_POUT_IS__u32_,tx_cfg->tx_cfg_pout);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX ALC mode %hu\r\n", tx_cfg->tx_cfg_alc_mode));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_ALC_MODE_IS__u8_,tx_cfg->tx_cfg_alc_mode);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX RS enable %hu\r\n", tx_cfg->tx_cfg_rs));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_RS_ENABLE_IS__u8_,tx_cfg->tx_cfg_rs);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX CC enable %hu\r\n", tx_cfg->tx_cfg_cc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CC_ENABLE_IS__u8_,tx_cfg->tx_cfg_cc);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX randomisation enable %hu\r\n", tx_cfg->tx_cfg_rand));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_RANDOMISATION_ENABLE_IS__u8_,tx_cfg->tx_cfg_rand);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX CRC checksum enable %hu\r\n", tx_cfg->tx_cfg_crc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRC_CHECKSUM_ENABLE_IS__u8_,tx_cfg->tx_cfg_crc);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX idletime %hi\r\n", tx_cfg->tx_cfg_idletime));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_IDLETIME_IS__u16_,tx_cfg->tx_cfg_idletime);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX payload size %hi\r\n", tx_cfg->tx_cfg_size));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_PAYLOAD_SIZE_IS__u16_,tx_cfg->tx_cfg_size);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX satellite ID %hi\r\n", tx_cfg->tx_cfg_id));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_SATELLITE_ID_IS__u16_,tx_cfg->tx_cfg_id);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto key %s\r\n", tx_cfg->crypto_cfg.crypto_key));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_The TX crypto key is");
    log_string(LOG_INFO_L1,LOG_COMMS,(char *)tx_cfg->crypto_cfg.crypto_key);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto encrypt %hu\r\n", tx_cfg->crypto_cfg.crypto_encrypt));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRYPTO_ENCRYPT_IS__u8_,tx_cfg->crypto_cfg.crypto_encrypt);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto Auth %hu\r\n", tx_cfg->crypto_cfg.crypto_auth));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRYPTO_AUTH_IS__u8_,tx_cfg->crypto_cfg.crypto_auth);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX PA temp limit %hhd\r\n", tx_cfg->tx_cfg_pa_templimit));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_PA_TEMP_LIMIT_IS__u8_,tx_cfg->tx_cfg_pa_templimit);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] Transmitted frames %lu\r\n", tx_cfg->tx_cfg_frames));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TRANSMITTED_FRAMES_ARE__u32_,tx_cfg->tx_cfg_frames);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX measured forward power %.2f\r\n", tx_cfg->tx_cfg_pwr_fwd));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_MEASURED_FORWARD_POWER_IS__u16_pt_u16_,tx_cfg->tx_cfg_pwr_fwd);
    return ret;
}

/**
 * @brief  This function is used for getting the receive config from the S-Band Module
 * @brief Gets S-Band simulator RX configuration.
 *
 * @param[out] rx_cfg RX configuration structure.
 * @return Execution status.
 */
int32_t sdr_sband_sim_get_rx_cfg(s_comms_rx_cfg *rx_cfg)
{
    int32_t ret = 0;
    memcpy(&rx_cfg->crypto_cfg,&rx_cfg_sim.crypto_cfg,sizeof(rx_cfg->crypto_cfg));

    rx_cfg->rx_cfg_freq               = rx_cfg_sim.rx_cfg_freq              ;
    rx_cfg->rx_cfg_type               = rx_cfg_sim.rx_cfg_type              ;
    rx_cfg->rx_cfg_rate               = rx_cfg_sim.rx_cfg_rate              ;
    rx_cfg->rx_cfg_rolloff            = rx_cfg_sim.rx_cfg_rolloff           ;
    rx_cfg->afc_cfg.rx_cfg_afc_enable = rx_cfg_sim.afc_cfg.rx_cfg_afc_enable;
    rx_cfg->afc_cfg.rx_cfg_afc_range  = rx_cfg_sim.afc_cfg.rx_cfg_afc_range ;
   // rx_cfg->rx_cfg_rs;
    rx_cfg->rx_cfg_cc                 = rx_cfg_sim.rx_cfg_cc                ;
    rx_cfg->rx_cfg_rand               = rx_cfg_sim.rx_cfg_rand              ;
    rx_cfg->rx_cfg_crc                = rx_cfg_sim.rx_cfg_crc               ;
    rx_cfg->rx_cfg_size               = rx_cfg_sim.rx_cfg_size              ;
    rx_cfg->rx_cfg_id                 = rx_cfg_sim.rx_cfg_id                ;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX frequency %lu\r\n", rx_cfg->rx_cfg_freq));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FREQUENCY_IS__u32_,rx_cfg->rx_cfg_freq);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX type %hu\r\n", rx_cfg->rx_cfg_type));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_TYPE_IS__u8_,rx_cfg->rx_cfg_type);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX RATE %lu\r\n", rx_cfg->rx_cfg_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RATE_IS__u32_,rx_cfg->rx_cfg_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Roll off %hu\r\n", rx_cfg->rx_cfg_rolloff));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_ROLL_OFF_IS__u8_,rx_cfg->rx_cfg_rolloff);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX AFC enable %hu\r\n", rx_cfg->afc_cfg.rx_cfg_afc_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_AFC_ENABLE_IS__u8_,rx_cfg->afc_cfg.rx_cfg_afc_enable);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] AFC Range %lu\r\n", rx_cfg->afc_cfg.rx_cfg_afc_range));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_AFC_RANGE_IS__u32_,rx_cfg->afc_cfg.rx_cfg_afc_range);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX RS config %hu\r\n", rx_cfg->rx_cfg_rs));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RS_CONFIG_IS__u8_,rx_cfg->rx_cfg_rs);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX CC enable %hu\r\n", rx_cfg->rx_cfg_cc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CC_ENABLE_IS__u8_,rx_cfg->rx_cfg_cc);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX randomisation enable %hu\r\n", rx_cfg->rx_cfg_rand));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RANDOMISATION_ENABLE_IS__u8_,rx_cfg->rx_cfg_rand);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX CRC checksum enable %hu\r\n", rx_cfg->rx_cfg_crc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRC_CHECKSUM_ENABLE_IS__u8_,rx_cfg->rx_cfg_crc);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX payload size %hu\r\n", rx_cfg->rx_cfg_size));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_PAYLOAD_SIZE_IS__u8_,rx_cfg->rx_cfg_size);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] Satellite ID %hu\r\n", rx_cfg->rx_cfg_id));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SATELLITE_ID_IS__u16_,rx_cfg->rx_cfg_id);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto Key %s\r\n", rx_cfg->crypto_cfg.crypto_key));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_RX crypto key is");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)rx_cfg->crypto_cfg.crypto_key);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto decrypt %hu\r\n", rx_cfg->crypto_cfg.crypto_decrypt));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRYPTO_DECRYPT_IS__u8_,rx_cfg->crypto_cfg.crypto_decrypt);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto Auth %hu\r\n", rx_cfg->crypto_cfg.crypto_auth));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRYPTO_AUTH_IS__u8_,rx_cfg->crypto_cfg.crypto_auth);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frames received  %lu\r\n", rx_cfg->rx_cfg_frames));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAMES_RECEIVED_IS__u32_, rx_cfg->rx_cfg_frames);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frames detected %lu\r\n", rx_cfg->rx_cfg_detected));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAMES_DETECTED_IS__u32_,rx_cfg->rx_cfg_detected);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RSSI %lf\r\n", rx_cfg->rx_cfg_rssi));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RSSI_IS__u16_pt_u16_,rx_cfg->rx_cfg_rssi);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frquency deviation %lf\r\n", rx_cfg->rx_cfg_freqerr));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FREQUENCY_DEVIATION_IS__u16_pt_u16_,rx_cfg->rx_cfg_freqerr);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Symbol deviation %lf\r\n", rx_cfg->rx_cfg_symerr));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_SYMBOL_DEVIATION_IS__u16_pt_u16_,rx_cfg->rx_cfg_symerr);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX EBN0 %lf\r\n", rx_cfg->rx_cfg_ebn0));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_EBN0__u16_pt_u16_,rx_cfg->rx_cfg_ebn0);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Carrier lock %d\r\n", rx_cfg->rx_cfg_carrier_lock));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CARRIER_LOCK_IS__u8_,rx_cfg->rx_cfg_carrier_lock);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frame Lock %d\r\n", rx_cfg->rx_frame_lock));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAME_LOCK_IS__u8_,rx_cfg->rx_frame_lock);
    return ret;
}

/**
 * @brief  This function is used for setting the transmit config of the S-Band module
 * @brief Sets S-Band simulator TX configuration.
 *
 * @param[in] tx_cfg TX configuration structure.  
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg(s_comms_tx_cfg *tx_cfg)
{
    int32_t ret = 0;
    memcpy(&tx_cfg_sim.crypto_cfg,&tx_cfg->crypto_cfg, sizeof(s_comms_tx_crypto_cfg ));

    tx_cfg_sim.tx_cfg_freq         = tx_cfg->tx_cfg_freq         ;
    tx_cfg_sim.tx_cfg_type         = tx_cfg->tx_cfg_type         ;
    tx_cfg_sim.tx_cfg_rate         = tx_cfg->tx_cfg_rate         ;
    tx_cfg_sim.tx_cfg_rolloff      = tx_cfg->tx_cfg_rolloff      ;
    tx_cfg_sim.tx_cfg_pout         = tx_cfg->tx_cfg_pout         ;
    tx_cfg_sim.tx_cfg_alc_mode     = tx_cfg->tx_cfg_alc_mode     ;
    tx_cfg_sim.tx_cfg_rs           = tx_cfg->tx_cfg_rs           ;
    tx_cfg_sim.tx_cfg_cc           = tx_cfg->tx_cfg_cc           ;
    tx_cfg_sim.tx_cfg_rand         = tx_cfg->tx_cfg_rand         ;
    tx_cfg_sim.tx_cfg_crc          = tx_cfg->tx_cfg_crc          ;
    tx_cfg_sim.tx_cfg_idletime     = tx_cfg->tx_cfg_idletime     ;
    tx_cfg_sim.tx_cfg_size         = tx_cfg->tx_cfg_size         ;
    tx_cfg_sim.tx_cfg_id           = tx_cfg->tx_cfg_id           ;
    tx_cfg_sim.tx_cfg_pa_templimit = tx_cfg->tx_cfg_pa_templimit ;
    tx_cfg_sim.tx_cfg_frames  = 0;
    tx_cfg_sim.tx_cfg_pwr_fwd = 0;
    tx_cfg_sim.tx_cfg_pwr_rfl = 0;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX Frequency %lu\r\n", tx_cfg->tx_cfg_freq));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_FREQUENCY_IS__u32_,tx_cfg->tx_cfg_freq);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX modulation type %hu\r\n", tx_cfg->tx_cfg_type));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_MODULATION_TYPE_IS__u8_,tx_cfg->tx_cfg_type);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX baud rate %lu\r\n", tx_cfg->tx_cfg_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_BAUD_RATE_IS__u32_,tx_cfg->tx_cfg_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX roll off %hu\r\n", tx_cfg->tx_cfg_rolloff));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_ROLL_OFF_IS__u8_,tx_cfg->tx_cfg_rolloff);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX pout %f\r\n", tx_cfg->tx_cfg_pout));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_POUT__u32_,tx_cfg->tx_cfg_pout);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX ALC mode %hu\r\n", tx_cfg->tx_cfg_alc_mode));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_ALC_MODE_IS__u8_,tx_cfg->tx_cfg_alc_mode);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX RS enable %hu\r\n", tx_cfg->tx_cfg_rs));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_RS_ENABLE_IS__u8_,tx_cfg->tx_cfg_rs);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX CC enable %hu\r\n", tx_cfg->tx_cfg_cc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CC_ENABLE_IS__u8_,tx_cfg->tx_cfg_cc);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX randomisation enable %hu\r\n", tx_cfg->tx_cfg_rand));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_RANDOMISATION_ENABLE_IS__u8_,tx_cfg->tx_cfg_rand);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX CRC checksum enable %hu\r\n", tx_cfg->tx_cfg_crc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRC_CHECKSUM_ENABLE_IS__u8_,tx_cfg->tx_cfg_crc);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX idletime %hi\r\n", tx_cfg->tx_cfg_idletime));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_IDLETIME_IS__u16_,tx_cfg->tx_cfg_idletime);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX payload size %hi\r\n", tx_cfg->tx_cfg_size));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_PAYLOAD_SIZE_IS__u16_,tx_cfg->tx_cfg_size);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX satellite ID %hi\r\n", tx_cfg->tx_cfg_id));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_SATELLITE_ID_IS__u16_,tx_cfg->tx_cfg_id);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto key %s\r\n", tx_cfg->crypto_cfg.crypto_key));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_TX crypto key is");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)tx_cfg->crypto_cfg.crypto_key);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto encrypt %hu\r\n", tx_cfg->crypto_cfg.crypto_encrypt));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRYPTO_ENCRYPT_IS__u8_,tx_cfg->crypto_cfg.crypto_encrypt);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto Auth %hu\r\n", tx_cfg->crypto_cfg.crypto_auth));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRYPTO_AUTH_IS__u8_,tx_cfg->crypto_cfg.crypto_auth);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX PA temp limit %hhd\r\n", tx_cfg->tx_cfg_pa_templimit));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_PA_TEMP_LIMIT_IS__u8_,tx_cfg->tx_cfg_pa_templimit);
    return ret;
}

/**
 * @brief  This function is used for setting the receive config of the S-Band Module
 * @brief Sets S-Band simulator RX configuration. 
 * 
 * @param[in] rx_cfg RX configuration structure.
 * @return Execution status. 
 */
int32_t sdr_sband_sim_set_rx_cfg(s_comms_rx_cfg *rx_cfg)
{
    int32_t ret = 0;
    memcpy(&rx_cfg_sim.crypto_cfg,&rx_cfg->crypto_cfg,sizeof(rx_cfg->crypto_cfg));

    rx_cfg_sim.rx_cfg_freq               = rx_cfg->rx_cfg_freq              ;
    rx_cfg_sim.rx_cfg_type               = rx_cfg->rx_cfg_type              ;
    rx_cfg_sim.rx_cfg_rate               = rx_cfg->rx_cfg_rate              ;
    rx_cfg_sim.rx_cfg_rolloff            = rx_cfg->rx_cfg_rolloff           ;
    rx_cfg_sim.afc_cfg.rx_cfg_afc_enable = rx_cfg->afc_cfg.rx_cfg_afc_enable;
    rx_cfg_sim.afc_cfg.rx_cfg_afc_range  = rx_cfg->afc_cfg.rx_cfg_afc_range ;
    rx_cfg_sim.rx_cfg_rs                 = rx_cfg->rx_cfg_rs                ;
    rx_cfg_sim.rx_cfg_cc                 = rx_cfg->rx_cfg_cc                ;
    rx_cfg_sim.rx_cfg_rand               = rx_cfg->rx_cfg_rand              ;
    rx_cfg_sim.rx_cfg_crc                = rx_cfg->rx_cfg_crc               ;
    rx_cfg_sim.rx_cfg_size               = rx_cfg->rx_cfg_size              ;
    rx_cfg_sim.rx_cfg_frames             = 0;
    rx_cfg_sim.rx_cfg_detected           = 0;
    rx_cfg_sim.rx_cfg_rssi               = 0;
    rx_cfg_sim.rx_cfg_freqerr            = 0;
    rx_cfg_sim.rx_cfg_symerr             = 0;
    rx_cfg_sim.rx_cfg_ebn0               = 0;
    rx_cfg_sim.rx_cfg_carrier_lock       = 0;
    rx_cfg_sim.rx_frame_lock             = 0;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX frequency %lu\r\n", rx_cfg->rx_cfg_freq));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FREQUENCY_IS__u32_,rx_cfg->rx_cfg_freq);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX type %hu\r\n", rx_cfg->rx_cfg_type));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_TYPE_IS__u8_,rx_cfg->rx_cfg_type);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX RATE %lu\r\n", rx_cfg->rx_cfg_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RATE_IS__u32_,rx_cfg->rx_cfg_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Roll off %hu\r\n", rx_cfg->rx_cfg_rolloff));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_ROLL_OFF_IS__u8_,rx_cfg->rx_cfg_rolloff);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX AFC enable %hu\r\n", rx_cfg->afc_cfg.rx_cfg_afc_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_AFC_ENABLE_IS__u8_,rx_cfg->afc_cfg.rx_cfg_afc_enable);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] AFC Range %lu\r\n", rx_cfg->afc_cfg.rx_cfg_afc_range));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_AFC_RANGE_IS__u32_,rx_cfg->afc_cfg.rx_cfg_afc_range);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX RS config %hu\r\n", rx_cfg->rx_cfg_rs));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RS_CONFIG_IS__u8_,rx_cfg->rx_cfg_rs);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX CC enable %hu\r\n", rx_cfg->rx_cfg_cc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CC_ENABLE_IS__u8_,rx_cfg->rx_cfg_cc);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX randomisation enable %hu\r\n", rx_cfg->rx_cfg_rand));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RANDOMISATION_ENABLE_IS__u8_,rx_cfg->rx_cfg_rand);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX CRC checksum enable %hu\r\n", rx_cfg->rx_cfg_crc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRC_CHECKSUM_ENABLE_IS__u8_,rx_cfg->rx_cfg_crc);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX payload size %hu\r\n", rx_cfg->rx_cfg_size));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_PAYLOAD_SIZE_IS__u8_,rx_cfg->rx_cfg_size);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] Satellite ID %hu\r\n", rx_cfg->rx_cfg_id));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SATELLITE_ID_IS__u16_,rx_cfg->rx_cfg_id);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto Key %s\r\n", rx_cfg->crypto_cfg.crypto_key));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_The RX crypto key is");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)rx_cfg->crypto_cfg.crypto_key);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto decrypt %hu\r\n", rx_cfg->crypto_cfg.crypto_decrypt));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRYPTO_DECRYPT_IS__u8_,rx_cfg->crypto_cfg.crypto_decrypt);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto Auth %hu\r\n", rx_cfg->crypto_cfg.crypto_auth));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRYPTO_AUTH_IS__u8_,rx_cfg->crypto_cfg.crypto_auth);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frames received  %lu\r\n", rx_cfg->rx_cfg_frames));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAMES_RECEIVED_IS__u32_, rx_cfg->rx_cfg_frames);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frames detected %lu\r\n", rx_cfg->rx_cfg_detected));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAMES_DETECTED_IS__u32_,rx_cfg->rx_cfg_detected);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RSSI %lf\r\n", rx_cfg->rx_cfg_rssi));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RSSI_IS__u16_pt_u16_,rx_cfg->rx_cfg_rssi);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frquency deviation %lf\r\n", rx_cfg->rx_cfg_freqerr));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FREQUENCY_DEVIATION_IS__u16_pt_u16_,rx_cfg->rx_cfg_freqerr);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Symbol deviation %lf\r\n", rx_cfg->rx_cfg_symerr));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_SYMBOL_DEVIATION_IS__u16_pt_u16_,rx_cfg->rx_cfg_symerr);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX EBN0 %lf\r\n", rx_cfg->rx_cfg_ebn0));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_EBN0__u16_pt_u16_,rx_cfg->rx_cfg_ebn0);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Carrier lock %d\r\n", rx_cfg->rx_cfg_carrier_lock));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CARRIER_LOCK_IS__u8_,rx_cfg->rx_cfg_carrier_lock);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frame Lock %d\r\n", rx_cfg->rx_frame_lock));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAME_LOCK_IS__u8_,rx_cfg->rx_frame_lock);
    return ret;
}

/**
 * @brief This function is used for getting the system config from the S-Band module
 * @brief Gets S-Band simulator system configuration.
 *
 * @param[out] sys_cfg System configuration structure.
 * @return Execution status.
 */
int32_t sdr_sband_sim_get_sys_cfg(s_comms_sys_cfg *sys_cfg)
{
    int32_t ret = 0;
    memcpy(sys_cfg,&sys_cfg_sim,sizeof(s_comms_sys_cfg));

    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->sys_name: %s\r\n", sys_cfg->sys_name));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_NAME");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->sys_name);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_serial: %lu\r\n", sys_cfg->boot_cfg.sys_serial));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_SERIAL__u32_,sys_cfg->boot_cfg.sys_serial);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_sw_version: %lu\r\n", sys_cfg->boot_cfg.sys_sw_version));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_SW_VERSION__u32_,sys_cfg->boot_cfg.sys_sw_version);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_bootcount: %lu\r\n", sys_cfg->boot_cfg.sys_bootcount));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_BOOTCOUNT__u32_,sys_cfg->boot_cfg.sys_bootcount);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_reboot: %d\r\n", sys_cfg->boot_cfg.sys_reboot));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_REBOOT__u16_,sys_cfg->boot_cfg.sys_reboot);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->gwdt_cfg.sys_gwdt_init: %lu\r\n", sys_cfg->gwdt_cfg.sys_gwdt_init));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_pt_SYS_GWDT_INIT__u32_,sys_cfg->gwdt_cfg.sys_gwdt_init);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->gwdt_cfg.sys_gwdt_counter: %lu\r\n", sys_cfg->gwdt_cfg.sys_gwdt_counter));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_pt_SYS_GWDT_COUNTER__u32_,sys_cfg->gwdt_cfg.sys_gwdt_counter);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->gwdt_cfg.sys_gwdt_reset: %lu\r\n", sys_cfg->gwdt_cfg.sys_gwdt_reset));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_pt_SYS_GWDT_RESET__u32_,sys_cfg->gwdt_cfg.sys_gwdt_reset);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->csp_cfg.sys_csp_address: %hhd\r\n", sys_cfg->csp_cfg.sys_csp_address));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CSP_CFG_pt_SYS_CSP_ADDRESS__u8_, sys_cfg->csp_cfg.sys_csp_address);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->csp_cfg.sys_csp_routes: %s\r\n", sys_cfg->csp_cfg.sys_csp_routes));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_CSP_CFG_pt_SYS_CSP_ROUTES");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->csp_cfg.sys_csp_routes);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->can_cfg.sys_can_rate: %lu\r\n", sys_cfg->can_cfg.sys_can_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CAN_CFG_pt_SYS_CAN_RATE__u32_,sys_cfg->can_cfg.sys_can_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->can_cfg.sys_can_promisc: %hu\r\n", sys_cfg->can_cfg.sys_can_promisc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CAN_CFG_pt_SYS_CAN_PROMISC__u8_,sys_cfg->can_cfg.sys_can_promisc);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->uart_cfg.sys_uart_rate: %lu\r\n", sys_cfg->uart_cfg.sys_uart_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_UART_CFG_pt_SYS_UART_RATE__u32_,sys_cfg->uart_cfg.sys_uart_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->uart_cfg.sys_uart_multidrop: %hu\r\n", sys_cfg->uart_cfg.sys_uart_multidrop));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_UART_CFG_pt_SYS_UART_MULTIDROP__u8_,sys_cfg->uart_cfg.sys_uart_multidrop);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_enable: %hu\r\n", sys_cfg->net_cfg.sys_net_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_ENABLE__u8_,sys_cfg->net_cfg.sys_net_enable);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_en_ip: %s\r\n", sys_cfg->net_cfg.sys_net_en_ip));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_EN_IP");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->net_cfg.sys_net_en_ip);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_en_prefix: %hhd\r\n", sys_cfg->net_cfg.sys_net_en_prefix));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_EN_PREFIX__u8_,sys_cfg->net_cfg.sys_net_en_prefix);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_en_gw: %s\r\n", sys_cfg->net_cfg.sys_net_en_gw));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_EN_GW");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->net_cfg.sys_net_en_gw);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_rf_ip: %s\r\n", sys_cfg->net_cfg.sys_net_rf_ip));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_RF_IP");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->net_cfg.sys_net_rf_ip);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_rf_prefix: %hhd\r\n", sys_cfg->net_cfg.sys_net_rf_prefix));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_RF_PREFIX__u8_,sys_cfg->net_cfg.sys_net_rf_prefix);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_rf_gw: %s\r\n", sys_cfg->net_cfg.sys_net_rf_gw));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_RF_GW");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->net_cfg.sys_net_rf_gw);
    return ret;
}

/**
 * @brief  This function is used for getting the calibration config from the S-Band Module
 * @brief Gets S-Band simulator calibration configuration.
 *
 * @param[out] cal_cfg Calibration configuration structure.  
 * @return Execution status.
 */
int32_t sdr_sband_sim_get_cal_cfg(s_comms_cal_cfg *cal_cfg)
{
    int32_t ret = 0;
    cal_cfg->cal_ps_gain             = cal_cfg_sim.cal_ps_gain      ;
    cal_cfg->cal_ps_intercept        = cal_cfg_sim.cal_ps_intercept ;
    cal_cfg->cal_vctcxo              = cal_cfg_sim.cal_vctcxo       ;
    cal_cfg->cal_pwr_set             = cal_cfg_sim.cal_pwr_set      ;
    cal_cfg->cal_ber_enable          = cal_cfg_sim.cal_ber_enable   ;
    cal_cfg->cal_ber_window          = cal_cfg_sim.cal_ber_window   ;
    cal_cfg->cal_ber_count           = cal_cfg_sim.cal_ber_count    ;

    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ps_gain: %lf\r\n", cal_cfg->cal_ps_gain));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_PS_GAIN__u16_pt_u16_,cal_cfg->cal_ps_gain);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ps_intercept: %lf\r\n", cal_cfg->cal_ps_intercept));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_PS_INTERCEPT__u16_pt_u16_,cal_cfg->cal_ps_intercept);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_vctcxo: %d\r\n", cal_cfg->cal_vctcxo));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_VCTCXO__u16_,cal_cfg->cal_vctcxo);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_pwr_set: %.2f\r\n", cal_cfg->cal_pwr_set));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_PWR_SET__u16_pt_u16_,cal_cfg->cal_pwr_set);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ber_enable: %d\r\n", cal_cfg->cal_ber_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_BER_ENABLE__u8_,cal_cfg->cal_ber_enable);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ber_window: %lu\r\n", cal_cfg->cal_ber_window));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_BER_WINDOW__u32_,cal_cfg->cal_ber_window);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ber_count: %lu\r\n", cal_cfg->cal_ber_count));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_BER_COUNT__u32_,cal_cfg->cal_ber_count);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief  This function is used for setting the system config of the S-Band Module
 * @brief Sets S-Band simulator system configuration.
 * 
 * @param[in] sys_cfg System configuration structure.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_sys_cfg(s_comms_sys_cfg *sys_cfg)
{
    int32_t ret = 0;
    memcpy(&sys_cfg_sim,sys_cfg,sizeof(s_comms_sys_cfg));

    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->sys_name: %s\r\n", sys_cfg->sys_name));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_SYS_NAME");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->sys_name);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_serial: %lu\r\n", sys_cfg->boot_cfg.sys_serial));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_SERIAL__u32_,sys_cfg->boot_cfg.sys_serial);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_sw_version: %lu\r\n", sys_cfg->boot_cfg.sys_sw_version));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_SW_VERSION__u32_,sys_cfg->boot_cfg.sys_sw_version);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_bootcount: %lu\r\n", sys_cfg->boot_cfg.sys_bootcount));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_BOOTCOUNT__u32_,sys_cfg->boot_cfg.sys_bootcount);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_reboot: %d\r\n", sys_cfg->boot_cfg.sys_reboot));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_REBOOT__u16_,sys_cfg->boot_cfg.sys_reboot);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->gwdt_cfg.sys_gwdt_init: %lu\r\n", sys_cfg->gwdt_cfg.sys_gwdt_init));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_pt_SYS_GWDT_INIT__u32_,sys_cfg->gwdt_cfg.sys_gwdt_init);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->gwdt_cfg.sys_gwdt_counter: %lu\r\n", sys_cfg->gwdt_cfg.sys_gwdt_counter));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_pt_SYS_GWDT_COUNTER__u32_,sys_cfg->gwdt_cfg.sys_gwdt_counter);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->gwdt_cfg.sys_gwdt_reset: %lu\r\n", sys_cfg->gwdt_cfg.sys_gwdt_reset));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_pt_SYS_GWDT_RESET__u32_,sys_cfg->gwdt_cfg.sys_gwdt_reset);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->csp_cfg.sys_csp_address: %hhd\r\n", sys_cfg->csp_cfg.sys_csp_address));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CSP_CFG_pt_SYS_CSP_ADDRESS__u8_, sys_cfg->csp_cfg.sys_csp_address);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->csp_cfg.sys_csp_routes: %s\r\n", sys_cfg->csp_cfg.sys_csp_routes));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_CSP_CFG_pt_SYS_CSP_ROUTES");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->csp_cfg.sys_csp_routes);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->can_cfg.sys_can_rate: %lu\r\n", sys_cfg->can_cfg.sys_can_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CAN_CFG_pt_SYS_CAN_RATE__u32_,sys_cfg->can_cfg.sys_can_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->can_cfg.sys_can_promisc: %hu\r\n", sys_cfg->can_cfg.sys_can_promisc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CAN_CFG_pt_SYS_CAN_PROMISC__u8_,sys_cfg->can_cfg.sys_can_promisc);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->uart_cfg.sys_uart_rate: %lu\r\n", sys_cfg->uart_cfg.sys_uart_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_UART_CFG_pt_SYS_UART_RATE__u32_,sys_cfg->uart_cfg.sys_uart_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->uart_cfg.sys_uart_multidrop: %hu\r\n", sys_cfg->uart_cfg.sys_uart_multidrop));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_UART_CFG_pt_SYS_UART_MULTIDROP__u8_,sys_cfg->uart_cfg.sys_uart_multidrop);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_enable: %hu\r\n", sys_cfg->net_cfg.sys_net_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_ENABLE__u8_,sys_cfg->net_cfg.sys_net_enable);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_en_ip: %s\r\n", sys_cfg->net_cfg.sys_net_en_ip));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_EN_IP");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->net_cfg.sys_net_en_ip);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_en_prefix: %hhd\r\n", sys_cfg->net_cfg.sys_net_en_prefix));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_EN_PREFIX__u8_,sys_cfg->net_cfg.sys_net_en_prefix);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_en_gw: %s\r\n", sys_cfg->net_cfg.sys_net_en_gw));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_EN_GW");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->net_cfg.sys_net_en_gw);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_rf_ip: %s\r\n", sys_cfg->net_cfg.sys_net_rf_ip));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_RF_IP");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->net_cfg.sys_net_rf_ip);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_rf_prefix: %hhd\r\n", sys_cfg->net_cfg.sys_net_rf_prefix));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_RF_PREFIX__u8_,sys_cfg->net_cfg.sys_net_rf_prefix);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg.sys_net_rf_gw: %s\r\n", sys_cfg->net_cfg.sys_net_rf_gw));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_SYS_CFG_NET_CFG_pt_SYS_NET_RF_GW");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_cfg->net_cfg.sys_net_rf_gw);
    return ret;
}

/**
 * @brief  This function is used for setting the calibration config of the S-Band Module
 * @brief Sets S-Band simulator calibration configuration. 
 *
 * @param[in] cal_cfg Calibration configuration structure.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_cal_cfg(s_comms_cal_cfg *cal_cfg)
{
    int32_t ret = 0;
    cal_cfg_sim.cal_ps_gain             = cal_cfg->cal_ps_gain      ;
    cal_cfg_sim.cal_ps_intercept        = cal_cfg->cal_ps_intercept ;
    cal_cfg_sim.cal_vctcxo              = cal_cfg->cal_vctcxo       ;

    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ps_gain: %lf\r\n", cal_cfg->cal_ps_gain));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_PS_GAIN__u16_pt_u16_,cal_cfg->cal_ps_gain);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ps_intercept: %lf\r\n", cal_cfg->cal_ps_intercept));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_PS_INTERCEPT__u16_pt_u16_,cal_cfg->cal_ps_intercept);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_vctcxo: %d\r\n", cal_cfg->cal_vctcxo));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_VCTCXO__u16_,cal_cfg->cal_vctcxo);
    return ret;
}

/**
 * @brief  This function is used for getting the telemetry properties of the S-Band module
 * @brief Gets S-Band simulator telemetry properties.
 *
 * @param[out] tm Pointer to telemetry structure.
 * @param[in] size Size of telemetry structure.
 * @return Execution status. 
 */
int32_t sdr_sband_sim_get_tm_prop(s_comms_tm_prop *tm, uint16_t size)
{
    int32_t ret = 0;

    tm->temp_psu = tm_prop_sim.temp_psu ;
    tm->temp_mcu = tm_prop_sim.temp_mcu ;
    tm->temp_fpga = tm_prop_sim.temp_fpga ;
    tm->temp_xcvr = tm_prop_sim.temp_xcvr ;
    tm->temp_lna = tm_prop_sim.temp_lna ;
    tm->temp_pa = tm_prop_sim.temp_pa ;
    tm->volt_vin = tm_prop_sim.volt_vin ;
    tm->volt_3v3 = tm_prop_sim.volt_3v3 ;
    tm->volt_1v8 = tm_prop_sim.volt_1v8 ;
    tm->volt_1v0 = tm_prop_sim.volt_1v0 ;
    tm->volt_pa = tm_prop_sim.volt_pa ;
    tm->cur_vin = tm_prop_sim.cur_vin ;
    tm->cur_3v3 = tm_prop_sim.cur_3v3 ;
    tm->cur_1v8 = tm_prop_sim.cur_1v8 ;
    tm->cur_1v0 = tm_prop_sim.cur_1v0 ;
    tm->cur_pa = tm_prop_sim.cur_pa ;
    tm->power_vin = tm_prop_sim.power_vin ;
    tm->power_3v3 = tm_prop_sim.power_3v3 ;
    tm->power_1v8 = tm_prop_sim.power_1v8 ;
    tm->power_1v0 = tm_prop_sim.power_1v0 ;
    tm->power_pa = tm_prop_sim.power_pa ;

    return ret;
}

/**
 * @brief  This function is used for updating the firmware configuration of the S-Band
 * @brief Handles S-Band simulator firmware configuration.
 * 
 * @param[in] tc_cmd Pointer to configuration command.
 * @return Execution status.
 */
int32_t sdr_sband_sim_firmware_cfg(uint8_t *tc_cmd)
{
    int32_t ret = 0;

    return ret;
}


/**
 * @brief  This function is used to reset the S-Band Module
 *
 * @param[in] id Reset request ID.
 * @return Execution status. 
 */
int32_t sdr_sband_sim_reset_req(uint16_t id)
{
    int32_t ret = 0;

    return ret;
}

/**
 * @brief  This function is used for saving the configuration of a particular group(tx/rx/sys/cal) to an alternative memory
 * @brief Handles S-Band simulator group save request.
 *
 * @param[in] group Group number to save.
 * @param[in] fallback Fallback flag. 
 * @return Execution status.
 */
int32_t sdr_sband_sim_group_save_req(uint16_t group,uint8_t fallback)
{
    int32_t ret = 0;

    return ret;
}

/**
 * @brief  This function is used to load back the previously saved configuration for the groups
 * @brief Handles S-Band simulator group load request.
 *
 * @param[in] group Group number to load.
 * @param[in] fallback Fallback flag.
 * @return Execution status.
 */
int32_t sdr_sband_sim_group_load_req(uint16_t group,uint8_t fallback)
{
    int32_t ret = 0;

    return ret;
}

/**
 * @brief  This function is used to erase the config from the alternate location of the groups
 * @brief Handles S-Band simulator group erase request.
 *
 * @param[in] group Group number to erase. 
 * @param[in] fallback Fallback flag.
 * @return Execution status. 
 */
int32_t sdr_sband_sim_group_erase_req(uint16_t group, uint8_t fallback)
{
    int32_t ret = 0;

    return ret;
}

/**
 * @brief  This function is used to lock the configured params of the alternate location of groups
 * @brief Handles S-Band simulator group lock request.
 *
 * @param[in] group Group number to lock.
 * @param[in] fallback Fallback flag.
 * @return Execution status.
 */
int32_t sdr_sband_sim_group_lock_req(uint16_t group, uint8_t fallback)
{
    int32_t ret = 0;

    return ret;
}

/**
 * @brief  This function is used to unlock the configured paramas of the alternate location of groups
 * @brief Handles S-Band simulator group unlock request.
 *
 * @param[in] group Group number to unlock.
 * @param[in] fallback Fallback flag. 
 * @return Execution status.
 */
int32_t sdr_sband_sim_group_unlock_req(uint16_t group, uint8_t fallback)
{
    int32_t ret = 0;

    return ret;
}

/**
 * @brief This function is used to set transmit frequency for the S-Band module
 * @brief Sets S-Band simulator TX frequency configuration.
 *
 * @param[in] tx_cfg_freq TX frequency value.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_freq(uint32_t tx_cfg_freq)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_freq= tx_cfg_freq;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX Frequency %lu\r\n", tx_cfg_freq));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_FREQUENCY_IS__u32_,tx_cfg_freq);
#pragma GCC diagnostic pop
    return ret;

}

/**
 * @brief This function is used to set transmit modulation type of the S-Band Module
 * @brief Sets S-Band simulator TX modulation type configuration.
 *
 * @param[in] tx_cfg_type TX modulation type.
 * @return Execution status. 
 */
int32_t sdr_sband_sim_set_tx_cfg_type(uint8_t tx_cfg_type)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_type= tx_cfg_type;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX modulation type %hu\r\n", tx_cfg_type));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_MODULATION_TYPE_IS__u8_,tx_cfg_type);
    return ret;
}

/**
 * @brief This function is used to set transmit symbol rate of the S-Band Module
 * @brief Sets S-Band simulator TX data rate configuration.
 *
 * @param[in] tx_cfg_rate TX data rate value.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_rate(uint32_t tx_cfg_rate)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_rate= tx_cfg_rate;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX baud rate %lu\r\n", tx_cfg_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_BAUD_RATE_IS__u32_,tx_cfg_rate);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to set transmit rolloff config of the S-Band Module
 * @brief Sets S-Band simulator TX rolloff factor configuration.
 *
 * @param[in] tx_cfg_rolloff TX rolloff factor value.  
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_rolloff(uint8_t tx_cfg_rolloff)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_rolloff= tx_cfg_rolloff;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX roll off %hu\r\n", tx_cfg_rolloff));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_ROLL_OFF_IS__u8_,tx_cfg_rolloff);
    return ret;
}

/**
 * @brief This function is used to set transmit output power of the S-Band Module
 * @brief Sets S-Band simulator TX output power configuration.
 *
 * @param[in] tx_cfg_pout TX output power value.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_pout(f32 tx_cfg_pout)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_pout= tx_cfg_pout;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX pout %f\r\n", tx_cfg_pout));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_POUT__u32_,tx_cfg_pout);
    return ret;
}

/**
 * @brief This function is used to set transmit ALC mode config of the S-Band Module
 * @brief Sets S-Band simulator TX ALC mode configuration.
 *
 * @param[in] tx_cfg_alc_mode TX ALC mode. 
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_alc_mode(uint8_t tx_cfg_alc_mode)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_alc_mode= tx_cfg_alc_mode;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX ALC mode %hu\r\n", tx_cfg_alc_mode));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_ALC_MODE_IS__u8_,tx_cfg_alc_mode);
    return ret;
}

/**
 * @brief This function is used to set transmit Reed Solomon config of the S-Band module
 * @brief Sets S-Band simulator TX Reed-Solomon configuration.
 *
 * @param[in] tx_cfg_rs TX Reed-Solomon configuration. 
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_rs(uint8_t tx_cfg_rs)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_rs= tx_cfg_rs;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX RS enable %hu\r\n", tx_cfg_rs));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_RS_ENABLE_IS__u8_,tx_cfg_rs);
    return ret;
}

/**
 * @brief This function is used to set transmit convolutional code config of the S-Band Module
 * @brief Sets S-Band simulator TX convolutional coding configuration.
 *
 * @param[in] tx_cfg_cc TX convolutional coding configuration.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_cc(uint8_t tx_cfg_cc)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_cc= tx_cfg_cc;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX CC enable %hu\r\n", tx_cfg_cc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CC_ENABLE_IS__u8_,tx_cfg_cc);
    return ret;
}

/**
 * @brief This function is used to set transmit randomization config of the S-Band Module
 * @brief Sets S-Band simulator TX randomization configuration. 
 *
 * @param[in] tx_cfg_rand TX randomization configuration.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_rand(uint8_t tx_cfg_rand)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_rand= tx_cfg_rand;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX randomisation enable %hu\r\n", tx_cfg_rand));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_RANDOMISATION_ENABLE_IS__u8_,tx_cfg_rand);
    return ret;
}

/**
 * @brief This function is used to set transmit Cyclic Redundancy Check config of the S-Band Module
 * @brief Sets S-Band simulator TX CRC configuration.
 *
 * @param[in] tx_cfg_crc TX CRC configuration.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_crc(uint8_t tx_cfg_crc)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_crc= tx_cfg_crc;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX CRC checksum enable %hu\r\n", tx_cfg_crc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRC_CHECKSUM_ENABLE_IS__u8_,tx_cfg_crc);
    return ret;
}

/**
 * @brief This function is used to set transmit idletime config of the S-Band Module
 * @brief Sets S-Band simulator TX idle time configuration.
 *
 * @param[in] tx_cfg_idletime TX idle time value.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_idletime(uint16_t tx_cfg_idletime)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_idletime= tx_cfg_idletime;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX idletime %hi\r\n", tx_cfg_idletime));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_IDLETIME_IS__u16_,tx_cfg_idletime);
    return ret;
}

/**
 * @brief This function is used to set transmit MTU size of the S-Band module
 * @brief Sets S-Band simulator TX packet size configuration.
 *
 * @param[in] tx_cfg_size TX packet size value.
 * @return Execution status. 
 */
int32_t sdr_sband_sim_set_tx_cfg_size(uint16_t tx_cfg_size)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_size= tx_cfg_size ;

    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX payload size %hi\r\n", tx_cfg_size));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_PAYLOAD_SIZE_IS__u16_,tx_cfg_size);
    return ret;
}

/**
 * @brief This function is used to set transmit satellite ID of the S-Band module
 * @brief Sets S-Band simulator TX packet ID configuration.
 *
 * @param[in] tx_cfg_id TX packet ID value.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_id(uint16_t tx_cfg_id)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_id= tx_cfg_id;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX satellite ID %hi\r\n", tx_cfg_id));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_SATELLITE_ID_IS__u16_,tx_cfg_id);
    return ret;
}

/**
 * @brief This function is used to set transmit security config of the S-Band Module
 * @brief Sets S-Band simulator TX crypto configuration.
 *
 * @param[in] crypto_cfg Pointer to TX crypto configuration.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_crypto(s_comms_tx_crypto_cfg *crypto_cfg)
{
    int32_t ret = 0;
    memcpy(crypto_cfg,&tx_cfg_sim.crypto_cfg, sizeof(s_comms_tx_crypto_cfg));
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto key %s\r\n", crypto_cfg->crypto_key));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_The TX crypto key is");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)crypto_cfg->crypto_key);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto encrypt %hu\r\n", crypto_cfg->crypto_encrypt));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRYPTO_ENCRYPT_IS__u8_,crypto_cfg->crypto_encrypt);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto Auth %hu\r\n", crypto_cfg->crypto_auth));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRYPTO_AUTH_IS__u8_,crypto_cfg->crypto_auth);

    return ret;
}

/**
 * @brief This function is used to set transmit PA temperature limit of the S-Band Module
 * @brief Sets S-Band simulator TX PA temperature limit configuration.
 *
 * @param[in] tx_cfg_pa_templimit TX PA temperature limit value.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_tx_cfg_pa_templimit(uint8_t tx_cfg_pa_templimit)
{
    int32_t ret = 0;
    tx_cfg_sim.tx_cfg_pa_templimit= tx_cfg_pa_templimit;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX PA temp limit %hhd\r\n", tx_cfg_pa_templimit));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_PA_TEMP_LIMIT_IS__u8_,tx_cfg_pa_templimit);
    return ret;
}

/**
 * @brief This function is used to set receive frequency of the S-Band Module
 * @brief Sets S-Band simulator RX frequency configuration.
 *
 * @param[in] rx_cfg_freq RX frequency value.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_rx_cfg_freq(uint32_t rx_cfg_freq)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_freq= rx_cfg_freq;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX frequency %lu\r\n", rx_cfg_freq));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FREQUENCY_IS__u32_,rx_cfg_freq);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to set receive modulation type of the S-Band Module
 * @brief Sets S-Band simulator RX modulation type configuration.
 *
 * @param[in] rx_cfg_type RX modulation type.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_rx_cfg_type(uint8_t rx_cfg_type)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_type= rx_cfg_type;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX type %hu\r\n", rx_cfg_type));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_TYPE_IS__u8_,rx_cfg_type);
    return ret;
}

/**
 * @brief This function is used to set receive symbol rate of the S-Band Module
 * @brief Sets S-Band simulator RX data rate configuration. 
 *
 * @param[in] rx_cfg_rate RX data rate value.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_rx_cfg_rate(uint32_t rx_cfg_rate)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_rate= rx_cfg_rate;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX RATE %lu\r\n", rx_cfg_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RATE_IS__u32_,rx_cfg_rate);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to set receive rolloff config of the S-Band Module
 * @brief Sets S-Band simulator RX rolloff factor configuration.
 *  
 * @param[in] rx_cfg_rolloff RX rolloff factor value.
 * @return Execution status. 
 */
int32_t sdr_sband_sim_set_rx_cfg_rolloff(uint8_t rx_cfg_rolloff)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_rolloff= rx_cfg_rolloff;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Roll off %hu\r\n", rx_cfg_rolloff));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_ROLL_OFF_IS__u8_,rx_cfg_rolloff);
    return ret;
}

/**
 * @brief This function is used to set receive automatic frequency control enable/disable of the S-Band Module
 * @brief Sets S-Band simulator RX AFC configuration.
 *
 * @param[in] afc_cfg Pointer to RX AFC configuration.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_rx_cfg_afc(s_comms_rx_afc_cfg *afc_cfg)
{
    int32_t ret = 0;
    rx_cfg_sim.afc_cfg.rx_cfg_afc_enable = rx_cfg_sim.afc_cfg.rx_cfg_afc_enable;
    rx_cfg_sim.afc_cfg.rx_cfg_afc_range = rx_cfg_sim.afc_cfg.rx_cfg_afc_range;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX AFC enable %hu\r\n", afc_cfg->rx_cfg_afc_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_AFC_ENABLE_IS__u8_,afc_cfg->rx_cfg_afc_enable);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] AFC Range %lu\r\n", afc_cfg->rx_cfg_afc_range));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_AFC_RANGE_IS__u32_,afc_cfg->rx_cfg_afc_range);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to set receive Reed Solomon enable/disable of the S-Band Module
 * @brief Sets S-Band simulator RX Reed-Solomon configuration.
 *
 * @param[in] rx_cfg_rs RX Reed-Solomon configuration. 
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_rx_cfg_rs(uint8_t rx_cfg_rs)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_rs= rx_cfg_rs;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX RS config %hu\r\n", rx_cfg_rs));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RS_CONFIG_IS__u8_,rx_cfg_rs);
    return ret;
}

/**
 * @brief This function is used to set receive convolutional code enable/disable of the S-Band Module
 * @brief Sets S-Band simulator RX convolutional coding configuration.
 *
 * @param[in] rx_cfg_cc RX convolutional coding configuration.
 * @return Execution status.
 */
int32_t sdr_sband_sim_set_rx_cfg_cc(uint8_t rx_cfg_cc)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_cc= rx_cfg_cc;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX CC enable %hu\r\n", rx_cfg_cc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CC_ENABLE_IS__u8_,rx_cfg_cc);
    return ret;
}

/**
 * @brief This function is used to set receive randomization enable/disable of the S-Band module
 * @brief This function is used to set receive randomization enable/disable of the S-Band module
 * 
 * @param rx_cfg_rand Receive randomization enable (0 = disable, 1 = enable)
 * 
 * @return Status of setting receive randomization configuration
 */
int32_t sdr_sband_sim_set_rx_cfg_rand(uint8_t rx_cfg_rand)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_rand= rx_cfg_rand;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX randomisation enable %hu\r\n", rx_cfg_rand));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RANDOMISATION_ENABLE_IS__u8_,rx_cfg_rand);
    return ret;
}

/**
 * @brief This function is used to set receive Cyclic Redundancy check enable/disable of the S-Band Module
 * @brief This function is used to set receive Cyclic Redundancy check enable/disable of the S-Band Module
 * 
 * @param rx_cfg_crc Receive CRC checksum enable (0 = disable, 1 = enable) 
 * 
 * @return Status of setting receive CRC configuration
 */
int32_t sdr_sband_sim_set_rx_cfg_crc(uint8_t rx_cfg_crc)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_crc= rx_cfg_crc;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX CRC checksum enable %hu\r\n", rx_cfg_crc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRC_CHECKSUM_ENABLE_IS__u8_,rx_cfg_crc);
    return ret;
}

/**
 * @brief This function is used to set receive MTU size of the S-Band Module
 * @brief This function is used to set receive MTU size of the S-Band Module
 * 
 * @param rx_cfg_size Receive payload size in bytes
 * 
 * @return Status of setting receive size configuration
 */
int32_t sdr_sband_sim_set_rx_cfg_size(uint16_t rx_cfg_size)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_size= rx_cfg_size;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX payload size %hu\r\n", rx_cfg_size));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_PAYLOAD_SIZE_IS__u8_,rx_cfg_size);
    return ret;
}

/**
 * @brief This function is used to set receive satellite ID of the S-Band Module
 * @brief This function is used to set receive satellite ID of the S-Band Module
 * 
 * @param rx_cfg_id Identity of receive satellite
 * 
 * @return Status of setting receive ID configuration  
 */
int32_t sdr_sband_sim_set_rx_cfg_id(uint16_t rx_cfg_id)
{
    int32_t ret = 0;
    rx_cfg_sim.rx_cfg_id= rx_cfg_id;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] Satellite ID %hu\r\n", rx_cfg_id));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SATELLITE_ID_IS__u16_,rx_cfg_id);
    return ret;
}

/**
 * @brief This function is used to set receive security config of the S-Band Module
 * @brief This function is used to set receive security config of the S-Band Module
 * 
 * @param crypto_cfg Pointer to receive crypto configuration
 * 
 * @return Status of setting receive crypto configuration
 */
int32_t sdr_sband_sim_set_rx_cfg_crypto(s_comms_rx_crypto_cfg *crypto_cfg)
{
    int32_t ret = 0;
    memcpy(crypto_cfg,&rx_cfg_sim.crypto_cfg,sizeof(s_comms_rx_crypto_cfg));
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto Key %s\r\n", crypto_cfg->crypto_key));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_The RX crypto key is");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)crypto_cfg->crypto_key);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto decrypt %hu\r\n", crypto_cfg->crypto_decrypt));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRYPTO_DECRYPT_IS__u8_,crypto_cfg->crypto_decrypt);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto Auth %hu\r\n", crypto_cfg->crypto_auth));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRYPTO_AUTH_IS__u8_,crypto_cfg->crypto_auth);
    return ret;
}

/**
 * @brief This function is used to set transmit frequency for the S-Band module
 * @brief This function is used to get configured transmit frequency of the S-Band Module  
 *
 * @param tx_cfg_freq Transmit frequency in Hz
 * @param size Pointer to size of frequency parameter
 * 
 * @return Status of getting transmit frequency configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_freq(uint32_t tx_cfg_freq, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_freq);
    tx_cfg_rb.tx_cfg_freq= tx_cfg_sim.tx_cfg_freq;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX Frequency %lu\r\n", tx_cfg_rb.tx_cfg_freq));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_FREQUENCY_IS__u32_,tx_cfg_rb.tx_cfg_freq);
#pragma GCC diagnostic pop
    return ret;

}

/**
 * @brief This function is used to get transmit modulation type of the S-Band Module
 * @brief This function is used to get configured transmit modulation type of the S-Band Module
 *
 * @param tx_cfg_type Transmit modulation type (1 = BPSK, 2 = QPSK, etc)
 * @param size Pointer to size of modulation type parameter  
 *
 * @return Status of getting transmit modulation type configuration  
 */
int32_t sdr_sband_sim_get_tx_cfg_type(uint8_t tx_cfg_type, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_type);
    tx_cfg_rb.tx_cfg_type= tx_cfg_sim.tx_cfg_type;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX modulation type %hu\r\n",tx_cfg_rb.tx_cfg_type));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_MODULATION_TYPE_IS__u8_,tx_cfg_rb.tx_cfg_type);
    return ret;
}

/**
 * @brief This function is used to get transmit symbol rate of the S-Band Module
 * @brief This function is used to get configured transmit data rate of the S-Band Module
 *
 * @param tx_cfg_rate Transmit data rate in bps
 * @param size Pointer to size of data rate parameter
 *
 * @return Status of getting transmit data rate configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_rate(uint32_t tx_cfg_rate, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_rate);
    tx_cfg_rb.tx_cfg_rate= tx_cfg_sim.tx_cfg_rate;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX baud rate %lu\r\n", tx_cfg_rb.tx_cfg_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_BAUD_RATE_IS__u32_,tx_cfg_rb.tx_cfg_rate);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get transmit rolloff config of the S-Band Module
 * @brief This function is used to get configured transmit roll-off factor of the S-Band Module
 *
 * @param tx_cfg_rolloff Transmit roll-off factor (e.g. 0.35) 
 * @param size Pointer to size of roll-off factor parameter
 *
 * @return Status of getting transmit roll-off factor configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_rolloff(uint8_t tx_cfg_rolloff, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_rolloff);
    tx_cfg_rb.tx_cfg_rolloff= tx_cfg_sim.tx_cfg_rolloff;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX roll off %hu\r\n",tx_cfg_rb.tx_cfg_rolloff));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_ROLL_OFF_IS__u8_,tx_cfg_rb.tx_cfg_rolloff);
    return ret;
}

/**
 * @brief This function is used to get transmit output power of the S-Band Module
 * @brief This function is used to get configured transmit power level of the S-Band Module
 *
 * @param tx_cfg_pout Transmit power level in dBm
 * @param size Pointer to size of power level parameter
 *
 * @return Status of getting transmit power level configuration  
 */
int32_t sdr_sband_sim_get_tx_cfg_pout(f32 tx_cfg_pout, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_pout);
    tx_cfg_rb.tx_cfg_pout= tx_cfg_sim.tx_cfg_pout;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX pout %f\r\n", tx_cfg_rb.tx_cfg_pout));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_POUT__u32_,tx_cfg_rb.tx_cfg_pout);
    return ret;
}

/**
 * @brief This function is used to get transmit ALC mode config of the S-Band Module
 * @brief This function is used to get configured transmit ALC mode of the S-Band Module
 * 
 * @param tx_cfg_alc_mode Transmit ALC mode (0 = disabled, 1 = enabled)
 * @param size Pointer to size of ALC mode parameter
 *
 * @return Status of getting transmit ALC mode configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_alc_mode(uint8_t tx_cfg_alc_mode, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_alc_mode);
    tx_cfg_rb.tx_cfg_alc_mode= tx_cfg_sim.tx_cfg_alc_mode;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX ALC mode %hu\r\n", tx_cfg_rb.tx_cfg_alc_mode));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_ALC_MODE_IS__u8_,tx_cfg_rb.tx_cfg_alc_mode);
    return ret;
}

/**
 * @brief This function is used to get transmit Reed Solomon config of the S-Band module
 * @brief This function is used to get configured transmit Reed-Solomon coding of the S-Band Module
 *
 * @param tx_cfg_rs Transmit Reed-Solomon coding enable (0 = disabled, 1 = enabled)  
 * @param size Pointer to size of Reed-Solomon parameter
 *
 * @return Status of getting transmit Reed-Solomon configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_rs(uint8_t tx_cfg_rs, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_rs);
    tx_cfg_rb.tx_cfg_rs= tx_cfg_sim.tx_cfg_rs;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX RS enable %hu\r\n", tx_cfg_rb.tx_cfg_rs));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_RS_ENABLE_IS__u8_,tx_cfg_rb.tx_cfg_rs);
    return ret;
}

/**
 * @brief This function is used to get transmit convolutional code config of the S-Band Module
 * @brief This function is used to get configured transmit convolutional coding of the S-Band Module
 *
 * @param tx_cfg_cc Transmit convolutional coding enable (0 = disabled, 1 = enabled)
 * @param size Pointer to size of convolutional coding parameter
 * 
 * @return Status of getting transmit convolutional coding configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_cc(uint8_t tx_cfg_cc, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_cc);
    tx_cfg_rb.tx_cfg_cc= tx_cfg_sim.tx_cfg_cc;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX CC enable %hu\r\n", tx_cfg_rb.tx_cfg_cc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CC_ENABLE_IS__u8_,tx_cfg_rb.tx_cfg_cc);
    return ret;
}

/**
 * @brief This function is used to get transmit randomization config of the S-Band Module
 * @brief This function is used to get configured transmit randomization of the S-Band Module  
 *
 * @param tx_cfg_rand Transmit randomization enable (0 = disabled, 1 = enabled)
 * @param size Pointer to size of randomization parameter
 *
 * @return Status of getting transmit randomization configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_rand(uint8_t tx_cfg_rand, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_rand);
    tx_cfg_rb.tx_cfg_rand= tx_cfg_sim.tx_cfg_rand;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX randomisation enable %hu\r\n", tx_cfg_rb.tx_cfg_rand));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_RANDOMISATION_ENABLE_IS__u8_,tx_cfg_rb.tx_cfg_rand);
    return ret;
}

/**
 * @brief This function is used to get transmit Cyclic Redundancy Check config of the S-Band Module
 * @brief This function is used to get configured transmit CRC checksum of the S-Band Module
 *
 * @param tx_cfg_crc Transmit CRC checksum enable (0 = disabled, 1 = enabled)
 * @param size Pointer to size of CRC parameter 
 *
 * @return Status of getting transmit CRC configuration  
 */
int32_t sdr_sband_sim_get_tx_cfg_crc(uint8_t tx_cfg_crc, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_crc);
    tx_cfg_rb.tx_cfg_crc= tx_cfg_sim.tx_cfg_crc;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX CRC checksum enable %hu\r\n", tx_cfg_rb.tx_cfg_crc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRC_CHECKSUM_ENABLE_IS__u8_,tx_cfg_rb.tx_cfg_crc);
    return ret;
}

/**
 * @brief This function is used to get transmit idletime config of the S-Band Module
 * @brief This function is used to get configured transmit idle time of the S-Band Module
 *
 * @param tx_cfg_idletime Transmit idle time in ms
 * @param size Pointer to size of idle time parameter
 *
 * @return Status of getting transmit idle time configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_idletime(uint16_t tx_cfg_idletime, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_idletime);
    tx_cfg_rb.tx_cfg_idletime= tx_cfg_sim.tx_cfg_idletime;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX idletime %hi\r\n", tx_cfg_rb.tx_cfg_idletime));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_IDLETIME_IS__u16_,tx_cfg_rb.tx_cfg_idletime);
    return ret;
}

/**
 * @brief This function is used to get transmit MTU size of the S-Band module
 * @brief This function is used to get configured transmit payload size of the S-Band Module
 *
 * @param tx_cfg_size Transmit payload size in bytes  
 * @param size Pointer to size of payload size parameter
 *
 * @return Status of getting transmit payload size configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_size(uint16_t tx_cfg_size, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_size);
    tx_cfg_rb.tx_cfg_size= tx_cfg_sim.tx_cfg_size ;

    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX payload size %hi\r\n", tx_cfg_rb.tx_cfg_size));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_PAYLOAD_SIZE_IS__u16_,tx_cfg_rb.tx_cfg_size);
    return ret;
}

/**
 * @brief This function is used to get transmit satellite ID of the S-Band module
 * @brief This function is used to get configured transmit ID of the S-Band Module
 *
 * @param tx_cfg_id Transmit ID  
 * @param size Pointer to size of ID parameter
 *
 * @return Status of getting transmit ID configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_id(uint16_t tx_cfg_id, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_id);
    tx_cfg_rb.tx_cfg_id= tx_cfg_sim.tx_cfg_id;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX satellite ID %hi\r\n", tx_cfg_rb.tx_cfg_id));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_SATELLITE_ID_IS__u16_,tx_cfg_rb.tx_cfg_id);
    return ret;
}

/**
 * @brief This function is used to get transmit security config of the S-Band Module
 * @brief This function is used to get configured transmit security of the S-Band Module
 *
 * @param crypto_cfg Pointer to transmit crypto configuration structure
 * @param size Pointer to size of crypto configuration structure
 *
 * @return Status of getting transmit crypto configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_crypto(s_comms_tx_crypto_cfg *crypto_cfg, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(s_comms_tx_crypto_cfg);
    memcpy(crypto_cfg,&tx_cfg_sim.crypto_cfg, sizeof(s_comms_tx_crypto_cfg));
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto key %s\r\n", crypto_cfg->crypto_key));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_The TX crypto key is");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)crypto_cfg->crypto_key);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto encrypt %hu\r\n", crypto_cfg->crypto_encrypt));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRYPTO_ENCRYPT_IS__u8_,crypto_cfg->crypto_encrypt);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX crypto Auth %hu\r\n", crypto_cfg->crypto_auth));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_CRYPTO_AUTH_IS__u8_,crypto_cfg->crypto_auth);

    return ret;
}

/**
 * @brief This function is used to get transmit PA temperature limit of the S-Band Module
 * @brief This function is used to get configured transmit PA temperature limit of the S-Band Module
 *
 * @param tx_cfg_pa_templimit Transmit PA temperature limit in Celsius  
 * @param size Pointer to size of PA limit parameter
 *
 * @return Status of getting transmit PA temperature limit configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_pa_templimit(uint8_t tx_cfg_pa_templimit, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_pa_templimit);
    tx_cfg_rb.tx_cfg_pa_templimit= tx_cfg_sim.tx_cfg_pa_templimit;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX PA temp limit %hhd\r\n", tx_cfg_rb.tx_cfg_pa_templimit));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_PA_TEMP_LIMIT_IS__u8_,tx_cfg_rb.tx_cfg_pa_templimit);
    return ret;
}

/**
 * @brief This function is used to get transmit frames config of the S-Band Module
 * @brief This function is used to get configured number of transmit frames of the S-Band Module
 *
 * @param tx_cfg_frames Number of transmit frames  
 * @param size Pointer to size of frames parameter
 *
 * @return Status of getting transmit number of frames configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_frames(uint32_t tx_cfg_frames, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_frames);
    tx_cfg_rb.tx_cfg_frames = tx_cfg_sim.tx_cfg_frames;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] transmitted frames are %lu\r\n", tx_cfg_rb.tx_cfg_frames));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TRANSMITTED_FRAMES_ARE__u32_,tx_cfg_rb.tx_cfg_frames);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get transmit forward power of the S-Band Module
 * @brief This function is used to get configured transmit forward power of the S-Band Module
 *
 * @param tx_cfg_pwr_fwd Transmit forward power in dBm
 * @param size Pointer to size of forward power parameter  
 *
 * @return Status of getting transmit forward power configuration
 */
int32_t sdr_sband_sim_get_tx_cfg_pwr_fwd(f32 tx_cfg_pwr_fwd, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_pwr_fwd);
    tx_cfg_rb.tx_cfg_pwr_fwd = tx_cfg_sim.tx_cfg_pwr_fwd;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX measured forward power %.2f\r\n", tx_cfg_rb.tx_cfg_pwr_fwd));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_MEASURED_FORWARED_POWER_IS__u16_pt_u16_,tx_cfg_rb.tx_cfg_pwr_fwd);
    return ret;
}

/**
 * @brief This function is used to get transmit reflected power od the S-Band Module
 * @brief This function is used to get configured transmit reflected power of the S-Band Module
 * 
 * @param tx_cfg_pwr_rfl Transmit reflected power in dBm
 * @param size Pointer to size of reflected power parameter
 *
 * @return Status of getting transmit reflected power configuration  
 */
int32_t sdr_sband_sim_get_tx_cfg_pwr_rfl(f32 tx_cfg_pwr_rfl, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(tx_cfg_pwr_rfl);
    tx_cfg_rb.tx_cfg_pwr_rfl = tx_cfg_sim.tx_cfg_pwr_rfl;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX refected power %.2f\r\n", tx_cfg_rb.tx_cfg_pwr_rfl));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_REFECTED_POWER_IS__u16_pt_u16_, tx_cfg_rb.tx_cfg_pwr_rfl);
    return ret;
}

/**
 * @brief This function is used to get receive frequency of the S-Band Module
 * @brief This function is used to get configured receive frequency of the S-Band Module
 *
 * @param rx_cfg_freq Receive frequency in Hz  
 * @param size Pointer to size of frequency parameter
 *
 * @return Status of getting receive frequency configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_freq(uint32_t rx_cfg_freq, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_freq);
    rx_cfg_rb.rx_cfg_freq= rx_cfg_sim.rx_cfg_freq;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX frequency %lu\r\n", rx_cfg_rb.rx_cfg_freq));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FREQUENCY_IS__u32_,rx_cfg_rb.rx_cfg_freq);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get receive modulation type of the S-Band Module
 * @brief This function is used to get configured receive modulation type of the S-Band Module
 * 
 * @param rx_cfg_type Receive modulation type (1 = BPSK, 2 = QPSK, etc)
 * @param size Pointer to size of modulation type parameter
 *
 * @return Status of getting receive modulation type configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_type(uint8_t rx_cfg_type, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_type);
    rx_cfg_rb.rx_cfg_type= rx_cfg_sim.rx_cfg_type;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX type %hu\r\n", rx_cfg_rb.rx_cfg_type));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_TYPE_IS__u8_,rx_cfg_rb.rx_cfg_type);
    return ret;
}

/**
 * @brief This function is used to get receive symbol rate of the S-Band Module
 * @brief This function is used to get configured receive data rate of the S-Band Module
 *
 * @param rx_cfg_rate Receive data rate in bps
 * @param size Pointer to size of data rate parameter  
 *
 * @return Status of getting receive data rate configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_rate(uint32_t rx_cfg_rate, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_rate);
    rx_cfg_rb.rx_cfg_rate= rx_cfg_sim.rx_cfg_rate;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX RATE %lu\r\n", rx_cfg_rb.rx_cfg_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RATE_IS__u32_,rx_cfg_rb.rx_cfg_rate);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get receive rolloff config of the S-Band Module
 * @brief This function is used to get configured receive roll-off factor of the S-Band Module
 * 
 * @param rx_cfg_rolloff Receive roll-off factor (e.g. 0.35)
 * @param size Pointer to size of roll-off factor parameter
 *
 * @return Status of getting receive roll-off factor configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_rolloff(uint8_t rx_cfg_rolloff, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_rolloff);
    rx_cfg_rb.rx_cfg_rolloff= rx_cfg_sim.rx_cfg_rolloff;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Roll off %hu\r\n", rx_cfg_rb.rx_cfg_rolloff));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_ROLL_OFF_IS__u8_,rx_cfg_rb.rx_cfg_rolloff);
    return ret;
}

/**
 * @brief This function is used to get receive automatic frequency control enable/disable of the S-Band Module
 * @brief This function is used to get configured receive AFC of the S-Band Module
 *
 * @param afc_cfg Pointer to receive AFC configuration structure 
 * @param size Pointer to size of AFC configuration structure
 * 
 * @return Status of getting receive AFC configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_afc(s_comms_rx_afc_cfg *afc_cfg, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(s_comms_rx_afc_cfg);
    afc_cfg->rx_cfg_afc_enable = rx_cfg_sim.afc_cfg.rx_cfg_afc_enable;
    afc_cfg->rx_cfg_afc_range = rx_cfg_sim.afc_cfg.rx_cfg_afc_range;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX AFC enable %hu\r\n", afc_cfg->rx_cfg_afc_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_AFC_ENABLE_IS__u8_,afc_cfg->rx_cfg_afc_enable);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] AFC Range %lu\r\n", afc_cfg->rx_cfg_afc_range));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_AFC_RANGE_IS__u32_,afc_cfg->rx_cfg_afc_range);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get receive Reed Solomon enable/disable of the S-Band Module
 * @brief This function is used to get configured receive Reed-Solomon coding of the S-Band Module
 * 
 * @param rx_cfg_rs Receive Reed-Solomon coding enable (0 = disabled, 1 = enabled)
 * @param size Pointer to size of Reed-Solomon parameter
 *
 * @return Status of getting receive Reed-Solomon configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_rs(uint8_t rx_cfg_rs, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_rs);
    rx_cfg_rb.rx_cfg_rs= rx_cfg_sim.rx_cfg_rs;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX RS config %hu\r\n", rx_cfg_rb.rx_cfg_rs));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RS_CONFIG_IS__u8_,rx_cfg_rb.rx_cfg_rs);
    return ret;
}

/**
 * @brief This function is used to get receive convolutional code enable/disable of the S-Band Module
 * @brief This function is used to get configured receive convolutional coding of the S-Band Module
 *
 * @param rx_cfg_cc Receive convolutional coding enable (0 = disabled, 1 = enabled) 
 * @param size Pointer to size of convolutional coding parameter
 *
 * @return Status of getting receive convolutional coding configuration 
 */
int32_t sdr_sband_sim_get_rx_cfg_cc(uint8_t rx_cfg_cc, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_cc);
    rx_cfg_rb.rx_cfg_cc= rx_cfg_sim.rx_cfg_cc;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX CC enable %hu\r\n", rx_cfg_rb.rx_cfg_cc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CC_ENABLE_IS__u8_,rx_cfg_rb.rx_cfg_cc);
    return ret;
}

/**
 * @brief This function is used to get receive randomization enable/disable of the S-Band module
 * @brief This function is used to get configured receive randomization of the S-Band Module
 *
 * @param rx_cfg_rand Receive randomization enable (0 = disabled, 1 = enabled)
 * @param size Pointer to size of randomization parameter
 * 
 * @return Status of getting receive randomization configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_rand(uint8_t rx_cfg_rand, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_rand);
    rx_cfg_rb.rx_cfg_rand= rx_cfg_sim.rx_cfg_rand;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX randomisation enable %hu\r\n", rx_cfg_rb.rx_cfg_rand));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_RANDOMISATION_ENABLE_IS__u8_,rx_cfg_rb.rx_cfg_rand);
    return ret;
}

/**
 * @brief This function is used to get receive Cyclic Redundancy check enable/disable of the S-Band Module
 * @brief This function is used to get configured receive CRC checksum of the S-Band Module  
 *
 * @param rx_cfg_crc Receive CRC checksum enable (0 = disabled, 1 = enabled)
 * @param size Pointer to size of CRC parameter
 *
 * @return Status of getting receive CRC configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_crc(uint8_t rx_cfg_crc, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_crc);
    rx_cfg_rb.rx_cfg_crc= rx_cfg_sim.rx_cfg_crc;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX CRC checksum enable %hu\r\n", rx_cfg_rb.rx_cfg_crc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRC_CHECKSUM_ENABLE_IS__u8_,rx_cfg_rb.rx_cfg_crc);
    return ret;
}

/**
 * @brief This function is used to get receive MTU size of the S-Band Module
 * @brief This function is used to get configured receive payload size of the S-Band Module
 * 
 * @param rx_cfg_size Receive payload size in bytes
 * @param size Pointer to size of payload size parameter
 * 
 * @return Status of getting receive payload size configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_size(uint16_t rx_cfg_size, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_size);
    rx_cfg_rb.rx_cfg_size= rx_cfg_sim.rx_cfg_size;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX payload size %hu\r\n", rx_cfg_rb.rx_cfg_size));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_PAYLOAD_SIZE_IS__u8_,rx_cfg_rb.rx_cfg_size);
    return ret;
}

/**
 * @brief This function is used to get receive satellite ID of the S-Band Module
 * @brief This function is used to get configured receive ID of the S-Band Module
 *
 * @param rx_cfg_id Receive ID
 * @param size Pointer to size of ID parameter
 *
 * @return Status of getting receive ID configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_id(uint16_t rx_cfg_id, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_id);
    rx_cfg_rb.rx_cfg_id= rx_cfg_sim.rx_cfg_id;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] Satellite ID %hu\r\n", rx_cfg_rb.rx_cfg_id));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SATELLITE_ID_IS__u16_,rx_cfg_rb.rx_cfg_id);
    return ret;
}

/**
 * @brief This function is used to get receive security config of the S-Band Module
 * @brief This function is used to get configured receive security of the S-Band Module
 *
 * @param crypto_cfg Pointer to receive crypto configuration structure
 * @param size Pointer to size of crypto configuration structure
 *
 * @return Status of getting receive crypto configuration 
 */
int32_t sdr_sband_sim_get_rx_cfg_crypto(s_comms_rx_crypto_cfg *crypto_cfg, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(s_comms_rx_crypto_cfg);
    memcpy(crypto_cfg,&rx_cfg_sim.crypto_cfg,sizeof(s_comms_rx_crypto_cfg));
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto Key %s\r\n", crypto_cfg->crypto_key));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_The RX crypto key is");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)crypto_cfg->crypto_key);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto decrypt %hu\r\n", crypto_cfg->crypto_decrypt));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRYPTO_DECRYPT_IS__u8_,crypto_cfg->crypto_decrypt);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX crypto Auth %hu\r\n", crypto_cfg->crypto_auth));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CRYPTO_AUTH_IS__u8_,crypto_cfg->crypto_auth);
    return ret;
}

/**
 * @brief This function is used to get receive frames config of the S-Band Module
 * @brief This function is used to get configured number of receive frames of the S-Band Module
 *
 * @param rx_cfg_frames Number of receive frames
 * @param size Pointer to size of frames parameter
 * 
 * @return Status of getting receive number of frames configuration
 */
int32_t sdr_sband_sim_get_rx_cfg_frames(uint32_t rx_cfg_frames, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_frames);
    rx_cfg_rb.rx_cfg_frames= rx_cfg_sim.rx_cfg_frames;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frames received %lu\r\n", rx_cfg_rb.rx_cfg_frames));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAMES_RECEIVED_IS__u32_,rx_cfg_rb.rx_cfg_frames);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get receive detected frames of the S-BAnd Module
 * @brief This function is used to get number of frames detected by the S-Band Module
 *
 * @param rx_cfg_detected Number of frames detected
 * @param size Pointer to size of detected frames parameter
 *
 * @return Status of getting number of detected frames  
 */
int32_t sdr_sband_sim_get_rx_cfg_detected(uint32_t rx_cfg_detected, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_detected);
    rx_cfg_rb.rx_cfg_detected= rx_cfg_sim.rx_cfg_detected;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frames detected %lu\r\n", rx_cfg_rb.rx_cfg_detected));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAMES_DETECTED_IS__u32_,rx_cfg_rb.rx_cfg_detected);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get receive signal strength indicator of the S-Band Module
 * @brief This function is used to get received signal strength of the S-Band Module
 *
 * @param rx_cfg_rssi Received signal strength in dBm  
 * @param size Pointer to size of RSSI parameter
 *
 * @return Status of getting received signal strength
 */
int32_t sdr_sband_sim_get_rx_cfg_rssi(f32 rx_cfg_rssi, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_rssi);
    rx_cfg_rb.rx_cfg_rssi= rx_cfg_sim.rx_cfg_rssi;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RSSI %.2f\r\n", rx_cfg_rb.rx_cfg_rssi));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RSSI_IS__u16_pt_u16_,rx_cfg_rb.rx_cfg_rssi);
    return ret;
}

/**
 * @brief This function is used to get receive frequency error of the S-Band Module
 * @brief This function is used to get frequency error of received signal in the S-Band Module
 *
 * @param rx_cfg_freqerr Frequency error in Hz
 * @param size Pointer to size of frequency error parameter
 *
 * @return Status of getting frequency error
 */
int32_t sdr_sband_sim_get_rx_cfg_freqerr(f32 rx_cfg_freqerr, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_freqerr);
    rx_cfg_rb.rx_cfg_freqerr= rx_cfg_sim.rx_cfg_freqerr;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frquency error %.2f\r\n", rx_cfg_rb.rx_cfg_freqerr));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FREQUENCY_ERROR_IS__u16_pt_u16_,rx_cfg_rb.rx_cfg_freqerr);
    return ret;
}

/**
 * @brief This function is used to get receive symbol error of the S-Band Module
 * @brief This function is used to get symbol error rate of received signal in the S-Band Module
 *
 * @param rx_cfg_symerr Symbol error rate  
 * @param size Pointer to size of symbol error rate parameter
 *
 * @return Status of getting symbol error rate
 */
int32_t sdr_sband_sim_get_rx_cfg_symerr(f32 rx_cfg_symerr, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_symerr);
    rx_cfg_rb.rx_cfg_symerr= rx_cfg_sim.rx_cfg_symerr;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Symbol error %.2f\r\n", rx_cfg_rb.rx_cfg_symerr));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_SYMBOL_ERROR_IS__u16_pt_u16_,rx_cfg_rb.rx_cfg_symerr);
    return ret;
}

/**
 * @brief This function is used to get receive normalized signal to noise ratio of the S-Band Module
 * @brief This function is used to get Eb/N0 ratio of received signal in the S-Band Module
 *
 * @param rx_cfg_ebn0 Eb/N0 ratio in dB  
 * @param size Pointer to size of Eb/N0 parameter
 *
 * @return Status of getting Eb/N0 ratio
 */
int32_t sdr_sband_sim_get_rx_cfg_ebn0(f32 rx_cfg_ebn0, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_ebn0);
    rx_cfg_rb.rx_cfg_ebn0= rx_cfg_sim.rx_cfg_ebn0;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] is RX EBN0 %.2f\r\n", rx_cfg_rb.rx_cfg_ebn0));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_EBN0__u16_pt_u16_,rx_cfg_rb.rx_cfg_ebn0);
    return ret;
}

/**
 * @brief This function is used to get receive carrier lock of the S-Band Module
 * @brief This function is used to get carrier lock status of the S-Band Module
 *
 * @param rx_cfg_carrier_lock Carrier lock status (0 = not locked, 1 = locked)
 * @param size Pointer to size of carrier lock parameter
 *
 * @return Status of getting carrier lock status
 */
int32_t sdr_sband_sim_get_rx_cfg_carrier_lock(uint8_t rx_cfg_carrier_lock, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_cfg_carrier_lock);
    rx_cfg_rb.rx_cfg_carrier_lock= rx_cfg_sim.rx_cfg_carrier_lock ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Carrier lock %d\r\n", rx_cfg_rb.rx_cfg_carrier_lock));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CARRIER_LOCK_IS__u8_,rx_cfg_rb.rx_cfg_carrier_lock);
    return ret;
}

/**
 * @brief This function is used to get receive frame lock config of the S-Band Module
 * @brief This function is used to get frame lock status of the S-Band Module  
 *
 * @param rx_frame_lock Frame lock status (0 = not locked, 1 = locked)
 * @param size Pointer to size of frame lock parameter
 *
 * @return Status of getting frame lock status
 */
int32_t sdr_sband_sim_get_rx_cfg_frame_lock(uint8_t rx_frame_lock, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(rx_frame_lock);
    rx_cfg_rb.rx_frame_lock= rx_cfg_sim.rx_frame_lock;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frame Lock %d\r\n", rx_cfg_rb.rx_frame_lock));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAME_LOCK_IS__u8_,rx_cfg_rb.rx_frame_lock);
    return ret;
}

/**
 * @brief This function is used to set system name of the S-Band Module
 * @brief This function sets the system name configuration of the S-Band module
 * 
 * @param sys_name Pointer to null-terminated string containing system name
 * 
 * @return Status of setting system name configuration
 */
int32_t sdr_sband_sim_set_sys_cfg_name(uint8_t *sys_name)
{
    int32_t ret = 0;
    memcpy(sys_cfg_sim.sys_name,sys_name,sizeof(sys_cfg_sim.sys_name));
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->sys_name: %s\r\n", sys_name));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_name");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)sys_name);
    return ret;
}

/**
 * @brief  This function is used to set ground watch dog timer configuration
 * @brief This function sets the ground watchdog timer configuration of the S-Band module
 *
 * @param gwdt_cfg Pointer to ground watchdog timer configuration structure
 * 
 * @return Status of setting ground watchdog timer configuration
 */
int32_t sdr_sband_sim_set_sys_cfg_gwdt_cfg(s_comms_gwdt_cfg *gwdt_cfg)
{
    int32_t ret = 0;
    memcpy(&sys_cfg_sim.gwdt_cfg,gwdt_cfg,sizeof(sys_cfg_sim.gwdt_cfg));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->sys_gwdt_init: %lu\r\n", gwdt_cfg->sys_gwdt_init));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_SYS_GWDT_INIT__u32_,gwdt_cfg->sys_gwdt_init);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to set CSP configuration 
 * @brief This function sets the CSP configuration of the S-Band module
 *
 * @param csp_cfg Pointer to CSP configuration structure
 *
 * @return Status of setting CSP configuration  
 */
int32_t sdr_sband_sim_set_sys_cfg_csp_cfg(s_comms_csp_cfg *csp_cfg)
{
    int32_t ret = 0;
    memcpy(&sys_cfg_sim.csp_cfg,csp_cfg,sizeof(sys_cfg_sim.csp_cfg));
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->csp_cfg->sys_csp_address: %hhd\r\n", csp_cfg->sys_csp_address));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CSP_CFG_SYS_CSP_ADDRESS__u8_, csp_cfg->sys_csp_address);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->csp_cfg->sys_csp_routes: %s\r\n", csp_cfg->sys_csp_routes));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_csp_routes");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)csp_cfg->sys_csp_routes);
    return ret;
}

/**
 * @brief This function is used to set CAN interface configuration
 * @brief This function sets the CAN configuration of the S-Band module
 *
 * @param can_cfg Pointer to CAN configuration structure
 * 
 * @return Status of setting CAN configuration
 */
int32_t sdr_sband_sim_set_sys_cfg_can_cfg(s_comms_can_cfg *can_cfg)
{
    int32_t ret = 0;
    memcpy(&sys_cfg_sim.can_cfg,can_cfg,sizeof(sys_cfg_sim.can_cfg));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->can_cfg->sys_can_rate: %lu\r\n", can_cfg->sys_can_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CAN_CFG_SYS_CAN_RATE__u32_,can_cfg->sys_can_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->can_cfg->sys_can_promisc: %hu\r\n", can_cfg->sys_can_promisc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CAN_CFG_SYS_CAN_PROMISC__u8_,can_cfg->sys_can_promisc);
    return ret;
}

/**
 * @brief This function is used to set UART interface configuration
 * @brief This function sets the UART configuration of the S-Band module
 *
 * @param uart_cfg Pointer to UART configuration structure
 *
 * @return Status of setting UART configuration
 */
int32_t sdr_sband_sim_set_sys_cfg_uart_cfg(s_comms_uart_cfg *uart_cfg)
{
    int32_t ret = 0;
    memcpy(&sys_cfg_sim.uart_cfg,uart_cfg,sizeof(sys_cfg_sim.uart_cfg));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->uart_cfg->sys_uart_rate: %lu\r\n", uart_cfg->sys_uart_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_UART_CFG__SYS_UART_RATE__u32_,uart_cfg->sys_uart_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->uart_cfg->sys_uart_multidrop: %hu\r\n", uart_cfg->sys_uart_multidrop));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_UART_CFG_SYS_UART_MULTIDROP__u8_,uart_cfg->sys_uart_multidrop);
    return ret;
}

/**
 * @brief This function is used to set IP configuration
 * @brief This function sets the network configuration of the S-Band module
 *
 * @param net_cfg Pointer to network configuration structure
 * 
 * @return Status of setting network configuration
 */
int32_t sdr_sband_sim_set_sys_cfg_net_cfg(s_comms_net_cfg *net_cfg)
{
    int32_t ret = 0;
    memcpy(&sys_cfg_sim.net_cfg,net_cfg,sizeof(sys_cfg_sim.net_cfg));
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_enable: %hu\r\n", net_cfg->sys_net_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_SYS_NET_ENABLE__u8_,net_cfg->sys_net_enable);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_en_ip: %s\r\n", net_cfg->sys_net_en_ip));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_net_en_ip");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)net_cfg->sys_net_en_ip);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_en_prefix: %hhd\r\n", net_cfg->sys_net_en_prefix));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_SYS_NET_EN_PREFIX__u8_,net_cfg->sys_net_en_prefix);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_en_gw: %s\r\n", net_cfg->sys_net_en_gw));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_net_en_gw");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)net_cfg->sys_net_en_gw);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_rf_ip: %s\r\n", net_cfg->sys_net_rf_ip));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_net_rf_ip");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)net_cfg->sys_net_rf_ip);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_rf_prefix: %hhd\r\n", net_cfg->sys_net_rf_prefix));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_SYS_NET_RF_PREFIX__u8_,net_cfg->sys_net_rf_prefix);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_rf_gw: %s\r\n", net_cfg->sys_net_rf_gw));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_net_rf_gw");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)net_cfg->sys_net_rf_gw);
    return ret;
}

/**
 * @brief This function is used to set boot configuration
 * @brief This function sets the boot configuration of the S-Band module
 * 
 * @param boot_cfg Pointer to boot configuration structure
 * 
 * @return Status of setting boot configuration
 */
int32_t sdr_sband_sim_set_sys_cfg_boot_cfg(s_comms_boot_cfg *boot_cfg)
{
    int32_t ret = 0;
    memcpy(&sys_cfg_sim.boot_cfg,boot_cfg,sizeof(s_comms_boot_cfg ));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_bootcount: %lu\r\n", boot_cfg->sys_bootcount));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_BOOTCOUNT__u32_,boot_cfg->sys_bootcount);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to set the system name of S-Band module
 * @brief This function gets the size of the system name configuration of the S-Band module
 *
 * @param size Pointer to size of system name parameter
 * 
 * @return Status of getting size of system name configuration 
 */
int32_t sdr_sband_sim_get_sys_cfg_name( uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(sys_cfg_rb.sys_name);
    memcpy(sys_cfg_rb.sys_name,sys_cfg_sim.sys_name,sizeof(sys_cfg_sim.sys_name));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->sys_name: %u\r\n", sys_cfg_rb.sys_name));
#ifndef LINUX_TEMP_PORT
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_SYS_NAME__u32_,(uint32_t)sys_cfg_rb.sys_name);
#endif
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get boot configuration from S-Band module
 * @brief This function gets the boot configuration of the S-Band module
 *
 * @param boot_cfg Pointer to boot configuration structure  
 * @param size Pointer to size of boot configuration structure
 *
 * @return Status of getting boot configuration
 */
int32_t sdr_sband_sim_get_sys_cfg_boot_cfg(s_comms_boot_cfg *boot_cfg, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(s_comms_boot_cfg );
    memcpy(&sys_cfg_rb.boot_cfg,&sys_cfg_sim.boot_cfg,sizeof(s_comms_boot_cfg ));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_serial: %lu\r\n", boot_cfg->sys_serial));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_SERIAL__u32_,boot_cfg->sys_serial);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_sw_version: %lu\r\n", boot_cfg->sys_sw_version));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_SW_VERSION__u32_,boot_cfg->sys_sw_version);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->boot_cfg.sys_bootcount: %lu\r\n", boot_cfg->sys_bootcount));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_BOOTCOUNT__u32_,boot_cfg->sys_bootcount);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->sys_reboot: %d\r\n", boot_cfg->sys_reboot));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_BOOT_CFG_pt_SYS_REBOOT__u16_,boot_cfg->sys_reboot);
    return ret;
}

/**
 * @brief  This function is used to get GWDT configuration
 * @brief This function gets the ground watchdog timer configuration of the S-Band module
 *
 * @param gwdt_cfg Pointer to ground watchdog timer configuration structure
 * @param size Pointer to size of gwdt configuration structure
 * 
 * @return Status of getting ground watchdog timer configuration
 */
int32_t sdr_sband_sim_get_sys_cfg_gwdt_cfg(s_comms_gwdt_cfg *gwdt_cfg, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(s_comms_gwdt_cfg );
    memcpy(&sys_cfg_rb.gwdt_cfg,&sys_cfg_sim.gwdt_cfg,sizeof(s_comms_gwdt_cfg ));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->gwdt_cfg->sys_gwdt_init: %lu\r\n", gwdt_cfg->sys_gwdt_init));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_SYS_GWDT_INIT__u32_,gwdt_cfg->sys_gwdt_init);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->gwdt_cfg->sys_gwdt_counter: %lu\r\n", gwdt_cfg->sys_gwdt_counter));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_SYS_GWDT_COUNTER__u32_,gwdt_cfg->sys_gwdt_counter);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->gwdt_cfg->sys_gwdt_reset: %lu\r\n", gwdt_cfg->sys_gwdt_reset));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_GWDT_CFG_SYS_GWDT_RESET__u32_,gwdt_cfg->sys_gwdt_reset);
#pragma GCC diagnostic pop

    return ret;
}

/**
 * @brief This function is used to get CSP Configuration
 * @brief This function gets the CSP configuration of the S-Band module
 *
 * @param csp_cfg Pointer to CSP configuration structure 
 * @param size Pointer to size of CSP configuration structure
 *
 * @return Status of getting CSP configuration
 */
int32_t sdr_sband_sim_get_sys_cfg_csp_cfg(s_comms_csp_cfg *csp_cfg, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(s_comms_csp_cfg );
    memcpy(&sys_cfg_rb.csp_cfg,&sys_cfg_sim.csp_cfg,sizeof(s_comms_csp_cfg ));
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->csp_cfg->sys_csp_address: %hhd\r\n", csp_cfg->sys_csp_address));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CSP_CFG_SYS_CSP_ADDRESS__u8_, csp_cfg->sys_csp_address);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->csp_cfg->sys_csp_routes: %s\r\n", csp_cfg->sys_csp_routes));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_csp_routes");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)csp_cfg->sys_csp_routes);
    return ret;
}

/**
 * @brief  This function is used to get CAN interface configuration
 * @brief This function gets the CAN configuration of the S-Band module
 *
 * @param can_cfg Pointer to CAN configuration structure
 * @param size Pointer to size of CAN configuration structure
 *
 * @return Status of getting CAN configuration
 */
int32_t sdr_sband_sim_get_sys_cfg_can_cfg(s_comms_can_cfg *can_cfg, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(s_comms_can_cfg );
    memcpy(&sys_cfg_rb.can_cfg,&sys_cfg_sim.can_cfg,sizeof(s_comms_can_cfg ));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->can_cfg->sys_can_rate: %lu\r\n", can_cfg->sys_can_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CAN_CFG_SYS_CAN_RATE__u32_,can_cfg->sys_can_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->can_cfg->sys_can_promisc: %hu\r\n", can_cfg->sys_can_promisc));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_CAN_CFG_SYS_CAN_PROMISC__u8_,can_cfg->sys_can_promisc);
    return ret;
}

/**
 * @brief This function is used to get UART configuration
 * @brief This function gets the UART configuration of the S-Band module  
 * 
 * @param uart_cfg Pointer to UART configuration structure
 * @param size Pointer to size of UART configuration structure
 *
 * @return Status of getting UART configuration
 */
int32_t sdr_sband_sim_get_sys_cfg_uart_cfg(s_comms_uart_cfg *uart_cfg, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(s_comms_uart_cfg );
    memcpy(&sys_cfg_rb.uart_cfg,&sys_cfg_sim.uart_cfg,sizeof(s_comms_uart_cfg ));
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->uart_cfg->sys_uart_rate: %lu\r\n", uart_cfg->sys_uart_rate));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_UART_CFG__SYS_UART_RATE__u32_,uart_cfg->sys_uart_rate);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->uart_cfg->sys_uart_multidrop: %hu\r\n", uart_cfg->sys_uart_multidrop));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_UART_CFG_SYS_UART_MULTIDROP__u8_,uart_cfg->sys_uart_multidrop);
    return ret;
}

/**
 * @brief This function is used to get IP config
 * @brief This function gets the network configuration of the S-Band module
 *
 * @param net_cfg Pointer to network configuration structure 
 * @param size Pointer to size of network configuration structure
 * 
 * @return Status of getting network configuration
 */
int32_t sdr_sband_sim_get_sys_cfg_net_cfg(s_comms_net_cfg *net_cfg, uint16_t *size)
{
    int32_t ret = 0;
    *size = sizeof(s_comms_net_cfg );
    memcpy(&sys_cfg_rb.net_cfg,&sys_cfg_sim.net_cfg,sizeof(s_comms_net_cfg ));
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_enable: %hu\r\n", net_cfg->sys_net_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_SYS_NET_ENABLE__u8_,net_cfg->sys_net_enable);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_en_ip: %s\r\n", net_cfg->sys_net_en_ip));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_net_en_ip");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)net_cfg->sys_net_en_ip);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_en_prefix: %hhd\r\n", net_cfg->sys_net_en_prefix));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_SYS_NET_EN_PREFIX__u8_,net_cfg->sys_net_en_prefix);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_en_gw: %s\r\n", net_cfg->sys_net_en_gw));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_net_en_gw");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)net_cfg->sys_net_en_gw);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_rf_ip: %s\r\n", net_cfg->sys_net_rf_ip));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_net_rf_ip");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)net_cfg->sys_net_rf_ip);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_rf_prefix: %hhd\r\n", net_cfg->sys_net_rf_prefix));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_SYS_CFG_NET_CFG_SYS_NET_RF_PREFIX__u8_,net_cfg->sys_net_rf_prefix);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] sys_cfg->net_cfg->sys_net_rf_gw: %s\r\n", net_cfg->sys_net_rf_gw));
    log_string(LOG_INFO_L1,LOG_COMMS,"SBAND_SIM_sys_net_rf_gw");
    log_string(LOG_INFO_L1,LOG_COMMS,(char*)net_cfg->sys_net_rf_gw);
    return ret;
}
/**
 * @brief This function is used to set PS Gain for calibration of S-Band module
 * @brief This function sets the power sensor gain calibration of the S-Band module
 *
 * @param cal_ps_gain Power sensor gain value
 *
 * @return Status of setting power sensor gain calibration
 */
int32_t sdr_sband_sim_set_cal_cfg_ps_gain(f32 cal_ps_gain)
{
    int32_t ret = 0;
    cal_cfg_sim.cal_ps_gain             = cal_ps_gain      ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ps_gain: %lf\r\n", cal_ps_gain));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_PS_GAIN__u16_pt_u16_,cal_ps_gain);
    return ret;
}

/**
 * @brief This function is used to set PS intercept for S-Band module
 * @brief This function sets the power sensor intercept calibration of the S-Band module
 * 
 * @param cal_ps_intercept Power sensor intercept value
 *
 * @return Status of setting power sensor intercept calibration
 */
int32_t sdr_sband_sim_set_cal_cfg_ps_intercept(f32 cal_ps_intercept)
{
    int32_t ret = 0;
    cal_cfg_sim.cal_ps_intercept        = cal_ps_intercept ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ps_intercept: %f\r\n", cal_ps_intercept));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_SBAND_SIM_CFG_CAL_PS_INTERCEPT__u32_,cal_ps_intercept);
    return ret;
}

/**
 * @brief This function is used to set VCTCXO for calibration of S-Band module
 * @brief This function sets the VCTCXO calibration of the S-Band module
 *
 * @param cal_vctcxo VCTCXO calibration value
 *
 * @return Status of setting VCTCXO calibration  
 */
int32_t sdr_sband_sim_set_cal_cfg_vctcxo(uint16_t cal_vctcxo)
{
    int32_t ret = 0;
    cal_cfg_sim.cal_vctcxo              = cal_vctcxo       ;

    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_vctcxo: %d\r\n", cal_vctcxo));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_VCTCXO__u16_,cal_vctcxo);
    return ret;
}

/**
 * @brief This function is used to get PS gain param value used for calibration of S_Band module
 * @brief This function gets the power sensor gain calibration of the S-Band module
 *
 * @param cal_ps_gain Power sensor gain value  
 * @param size Pointer to size of gain parameter
 * 
 * @return Status of getting power sensor gain calibration
 */
int32_t sdr_sband_sim_get_cal_cfg_ps_gain(f32 cal_ps_gain, uint16_t *size)
{
    int32_t ret = 0;
    cal_cfg_global.cal_ps_gain             = cal_cfg_sim.cal_ps_gain      ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ps_gain: %lf\r\n", cal_ps_gain));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_PS_GAIN__u16_pt_u16_,cal_ps_gain);
    return ret;
}

/**
 * @brief  This function is used to get PS intercept parameter value for calibration of S-Band module
 * @brief This function gets the power sensor intercept calibration of the S-Band module
 *
 * @param cal_ps_intercept Power sensor intercept value 
 * @param size Pointer to size of intercept parameter
 *
 * @return Status of getting power sensor intercept calibration
 */
int32_t sdr_sband_sim_get_cal_cfg_ps_intercept(f32 cal_ps_intercept, uint16_t *size)
{
    int32_t ret = 0;
    cal_cfg_global.cal_ps_intercept        = cal_cfg_sim.cal_ps_intercept ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ps_intercept: %f\r\n", cal_ps_intercept));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_PS_INTERCEPT__u32_,cal_ps_intercept);
    return ret;
}

/**
 * @brief This function is used to get VCTCXO of S-Band module
 * @brief This function gets the VCTCXO calibration of the S-Band module
 *
 * @param cal_vctcxo VCTCXO calibration value
 * @param size Pointer to size of VCTCXO parameter
 *
 * @return Status of getting VCTCXO calibration
 */
int32_t sdr_sband_sim_get_cal_cfg_vctcxo(uint16_t cal_vctcxo, uint16_t *size)
{
    int32_t ret = 0;
    cal_cfg_global.cal_vctcxo              = cal_cfg_sim.cal_vctcxo       ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_vctcxo: %d\r\n", cal_vctcxo));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_VCTCXO__u16_,cal_vctcxo);
    return ret;
}

/**
 * @brief This function is used to get configured power for calibrating S-Band module
 * @brief This function gets the power setpoint calibration of the S-Band module
 *
 * @param cal_pwr_set Power setpoint value
 * @param size Pointer to size of power setpoint parameter
 *
 * @return Status of getting power setpoint calibration
 */
int32_t sdr_sband_sim_get_cal_cfg_pwr_set(f32 cal_pwr_set, uint16_t *size)
{
    int32_t ret = 0;
    cal_cfg_global.cal_pwr_set             = cal_cfg_sim.cal_pwr_set      ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_pwr_set: %.2f\r\n", cal_pwr_set));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_PWR_SET__u16_pt_u16_,cal_pwr_set);
    return ret;
}

/**
 * @brief  This function is used to get BER enable status (BER is a standalone simulation model to measure the bit error rate)
 * @brief This function gets the BER enable setting of the S-Band module
 *
 * @param cal_ber_enable BER enable setting (0 = disabled, 1 = enabled)
 * @param size Pointer to size of BER enable parameter
 *
 * @return Status of getting BER enable setting
 */
int32_t sdr_sband_sim_get_cal_cfg_ber_enable(uint8_t cal_ber_enable, uint16_t *size)
{
    int32_t ret = 0;
    cal_cfg_global.cal_ber_enable          = cal_cfg_sim.cal_ber_enable   ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ber_enable: %d\r\n", cal_ber_enable));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_BER_ENABLE__u8_,cal_ber_enable);
    return ret;
}

/**
 * @brief This function is used to get BER window duration
 * @brief This function gets the BER window setting of the S-Band module
 *
 * @param cal_ber_window BER window size 
 * @param size Pointer to size of BER window parameter
 *
 * @return Status of getting BER window setting
 */
int32_t sdr_sband_sim_get_cal_cfg_ber_window(uint32_t cal_ber_window, uint16_t *size)
{
    int32_t ret = 0;
    cal_cfg_global.cal_ber_window          = cal_cfg_sim.cal_ber_window   ;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ber_window: %lu\r\n", cal_ber_window));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_BER_WINDOW__u32_,cal_ber_window);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get BER count
 * @brief This function gets the BER error count of the S-Band module
 * 
 * @param cal_ber_count BER error count
 * @param size Pointer to size of BER count parameter
 *
 * @return Status of getting BER error count
 */
int32_t sdr_sband_sim_get_cal_cfg_ber_count(uint32_t cal_ber_count, uint16_t *size)
{
    int32_t ret = 0;
    cal_cfg_global.cal_ber_count           = cal_cfg_sim.cal_ber_count    ;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ber_count: %lu\r\n", cal_ber_count));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_BER_COUNT__u32_,cal_ber_count);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get BER lock status
 * @brief This function gets the BER lock count of the S-Band module
 *
 * @param cal_ber_locks BER lock count  
 * @param size Pointer to size of BER lock count parameter
 *
 * @return Status of getting BER lock count
 */
int32_t sdr_sband_sim_get_cal_cfg_ber_locks(uint32_t cal_ber_locks, uint16_t *size)
{
    int32_t ret = 0;
    cal_cfg_global.cal_ber_locks           = cal_cfg_sim.cal_ber_locks    ;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] cal_cfg->cal_ber_locks: %lu\r\n", cal_ber_locks));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_CAL_CFG_CAL_BER_LOCKS__u32_,cal_ber_locks);
#pragma GCC diagnostic pop
    return ret;
}

/**
 * @brief This function is used to get temperature(psu) TM property
 * @brief This function gets the power supply temperature of the S-Band module
 *
 * @param temp_psu Power supply temperature in Celsius
 * @param size Pointer to size of temperature parameter
 *
 * @return Status of getting power supply temperature 
 */
int32_t sdr_sband_sim_get_tm_prop_temp_psu(int16_t temp_psu, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.temp_psu  = tm_prop_sim.temp_psu  ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->temp_psu;: %d\r\n", temp_psu));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_TEMP_PSU__s16_,temp_psu);

    return ret;
}


/**
 * @brief This function is used to get temperature(mcu) TM property
 * @brief This function gets the MCU temperature of the S-Band module
 *
 * @param temp_mcu MCU temperature in Celsius  
 * @param size Pointer to size of temperature parameter
 *
 * @return Status of getting MCU temperature
 */
int32_t sdr_sband_sim_get_tm_prop_temp_mcu(int16_t temp_mcu, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.temp_mcu  = tm_prop_sim.temp_mcu  ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->temp_mcu;: %d\r\n", temp_mcu));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_TEMP_MCU__s16_,temp_mcu);

    return ret;
}

/**
 * @brief This function is used to get temperature(fpga) TM property
 * @brief This function gets the FPGA temperature of the S-Band module
 * 
 * @param temp_fpga FPGA temperature in Celsius
 * @param size Pointer to size of temperature parameter
 *
 * @return Status of getting FPGA temperature
 */
int32_t sdr_sband_sim_get_tm_prop_temp_fpga(int16_t temp_fpga, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.temp_fpga = tm_prop_sim.temp_fpga ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->temp_fpga;: %d\r\n", temp_fpga));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_TEMP_FPGA__s16_,temp_fpga);
    return ret;
}

/**
 * @brief This function is used to get temperature(xvcr) TM property
 * @brief This function gets the transceiver temperature of the S-Band module
 * 
 * @param temp_xcvr Transceiver temperature in Celsius
 * @param size Pointer to size of temperature parameter
 *
 * @return Status of getting transceiver temperature
 */
int32_t sdr_sband_sim_get_tm_prop_temp_xcvr(int16_t temp_xcvr, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.temp_xcvr = tm_prop_sim.temp_xcvr ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->temp_xcvr;: %d\r\n", temp_xcvr));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_TEMP_XCVR__s16_,temp_xcvr);

    return ret;
}

/**
 * @brief This function is used to get temperature(LNA) TM property
 * @brief This function gets the LNA temperature of the S-Band module
 *
 * @param temp_lna LNA temperature in Celsius
 * @param size Pointer to size of temperature parameter 
 *
 * @return Status of getting LNA temperature
 */
int32_t sdr_sband_sim_get_tm_prop_temp_lna(int16_t temp_lna, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.temp_lna  = tm_prop_sim.temp_lna  ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->temp_lna;: %d\r\n", temp_lna));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_TEMP_LNA__s16_,temp_lna);
    return ret;
}

/**
 * @brief This function is used to get temperature(PA) TM property
 * @brief This function gets the power amplifier temperature of the S-Band module
 *
 * @param temp_pa Power amplifier temperature in Celsius
 * @param size Pointer to size of temperature parameter
 *
 * @return Status of getting power amplifier temperature
 */
int32_t sdr_sband_sim_get_tm_prop_temp_pa(int16_t temp_pa, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.temp_pa   = tm_prop_sim.temp_pa   ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->temp_pa;: %d\r\n", temp_pa));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_TEMP_PA__s16_,temp_pa);
    return ret;
}

/**
 * @brief This function is used to get Voltage(Vin) - TM property
 * @brief This function gets the input voltage of the S-Band module
 *
 * @param volt_vin Input voltage in millivolts  
 * @param size Pointer to size of voltage parameter
 *
 * @return Status of getting input voltage
 */
int32_t sdr_sband_sim_get_tm_prop_volt_vin(uint16_t volt_vin, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.volt_vin  = tm_prop_sim.volt_vin  ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->volt_vin;: %d\r\n", volt_vin));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_VOLT_VIN__u16_,volt_vin);
    return ret;
}

/**
 * @brief This function is used to get Voltage(3v3) - TM property
 * @brief This function gets the 3.3V supply voltage of the S-Band module
 *
 * @param volt_3v3 3.3V supply voltage in millivolts
 * @param size Pointer to size of voltage parameter
 * 
 * @return Status of getting 3.3V supply voltage
 */
int32_t sdr_sband_sim_get_tm_prop_volt_3v3(uint16_t volt_3v3, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.volt_3v3  = tm_prop_sim.volt_3v3  ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->volt_3v3;: %d\r\n", volt_3v3));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_VOLT_3V3__u16_,volt_3v3);
    return ret;
}

/**
 * @brief This function is used to get Voltage(1v8) - TM property
 * @brief This function gets the 1.8V supply voltage of the S-Band module  
 *
 * @param volt_1v8 1.8V supply voltage in millivolts
 * @param size Pointer to size of voltage parameter
 *
 * @return Status of getting 1.8V supply voltage
 */
int32_t sdr_sband_sim_get_tm_prop_volt_1v8(uint16_t volt_1v8, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.volt_1v8  = tm_prop_sim.volt_1v8  ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->volt_1v8;: %d\r\n", volt_1v8));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_VOLT_1V8__u16_,volt_1v8);
    return ret;
}

/**
 * @brief This function is used to get Voltage(1v0) - TM property
 * @brief This function gets the 1.0V supply voltage of the S-Band module
 *
 * @param volt_1v0 1.0V supply voltage in millivolts
 * @param size Pointer to size of voltage parameter
 *
 * @return Status of getting 1.0V supply voltage
 */
int32_t sdr_sband_sim_get_tm_prop_volt_1v0(uint16_t volt_1v0, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.volt_1v0  = tm_prop_sim.volt_1v0  ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->volt_1v0;: %d\r\n", volt_1v0));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_VOLT_1V0__u16_,volt_1v0);
    return ret;
}

/**
 * @brief This function is used to get Voltage(Vpa) - TM property
 * @brief This function gets the power amplifier voltage of the S-Band module
 *
 * @param volt_pa Power amplifier voltage in millivolts
 * @param size Pointer to size of voltage parameter
 * 
 * @return Status of getting power amplifier voltage
 */
int32_t sdr_sband_sim_get_tm_prop_volt_pa(uint16_t volt_pa, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.volt_pa   = tm_prop_sim.volt_pa   ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->volt_pa;: %d\r\n", volt_pa));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_VOLT_PA__u16_,volt_pa);
    return ret;
}

/**
 * @brief This function is used to get Current(Iin) - TM property
 * @brief This function gets the input current of the S-Band module
 *
 * @param cur_vin Input current in milliamps
 * @param size Pointer to size of current parameter
 *
 * @return Status of getting input current  
 */
int32_t sdr_sband_sim_get_tm_prop_cur_vin(int16_t cur_vin, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.cur_vin   = tm_prop_sim.cur_vin   ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->cur_vin;: %d\r\n", cur_vin));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_CUR_VIN__s16_,cur_vin);
    return ret;
}

/**
 * @brief This function is used to get Current(I 3v3) - TM property
 * @brief This function gets the 3.3V supply current of the S-Band module
 * 
 * @param cur_3v3 3.3V supply current in milliamps
 * @param size Pointer to size of current parameter
 *
 * @return Status of getting 3.3V supply current
 */
int32_t sdr_sband_sim_get_tm_prop_cur_3v3(int16_t cur_3v3, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.cur_3v3   = tm_prop_sim.cur_3v3   ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->cur_3v3;: %d\r\n", cur_3v3));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_CUR_3V3__s16_,cur_3v3);
    return ret;
}

/**
 * @brief This function is used to get Current(I 1v8) - TM property
* @brief This function gets the 1.8V supply current of the S-Band module  
*
* @param cur_1v8 1.8V supply current in milliamps
* @param size Pointer to size of current parameter
* 
* @return Status of getting 1.8V supply current
 */
int32_t sdr_sband_sim_get_tm_prop_cur_1v8(int16_t cur_1v8, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.cur_1v8   = tm_prop_sim.cur_1v8   ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->cur_1v8;: %d\r\n", cur_1v8));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_CUR_1V8__s16_,cur_1v8);
    return ret;
}

/**
 * @brief This function is used to get Current(I 1v0) - TM property
* @brief This function gets the 1V supply current of the S-Band module
*
* @param cur_1v0 1V supply current in milliamps  
* @param size Pointer to size of current parameter
*
* @return Status of getting 1V supply current
 */
int32_t sdr_sband_sim_get_tm_prop_cur_1v0(int16_t cur_1v0, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.cur_1v0   = tm_prop_sim.cur_1v0   ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->cur_1v0;: %d\r\n", cur_1v0));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_CUR_1V0__s16_,cur_1v0);
    return ret;
}

/**
 * @brief This function is used to get Current(I pa) - TM property
* @brief This function gets the PA current of the S-Band module  
*
* @param cur_pa PA current in milliamps
* @param size Pointer to size of current parameter
*
* @return Status of getting PA current 
 */
int32_t sdr_sband_sim_get_tm_prop_cur_pa(int16_t cur_pa, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.cur_pa    = tm_prop_sim.cur_pa    ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->cur_pa;: %d\r\n", cur_pa));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_CUR_PA__s16_,cur_pa);
    return ret;
}

/**
 * @brief This function is used to get Power(Vin) - TM property
* @brief This function gets the input power of the S-Band module
* 
* @param power_vin Input power in milliwatts 
* @param size Pointer to size of power parameter
*
* @return Status of getting input power
 */
int32_t sdr_sband_sim_get_tm_prop_power_vin(uint16_t power_vin, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.power_vin = tm_prop_sim.power_vin ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->power_vin;: %d\r\n", power_vin));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_POWER_VIN__u16_,power_vin);
    return ret;
}

/**
 * @brief This function is used to get Power(3v3) - TM property
* @brief This function gets the 3.3V rail power of the S-Band module
*
* @param power_3v3 3.3V rail power in milliwatts
* @param size Pointer to size of power parameter  
*
* @return Status of getting 3.3V rail power
 */
int32_t sdr_sband_sim_get_tm_prop_power_3v3(uint16_t power_3v3, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.power_3v3 = tm_prop_sim.power_3v3 ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->power_3v3;: %d\r\n", power_3v3));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_POWER_3V3__u16_,power_3v3);
    return ret;
}

/**
 * @brief This function is used to get Power(1v8) - TM property
* @brief This function gets the 1.8V rail power of the S-Band module
* 
* @param power_1v8 1.8V rail power in milliwatts
* @param size Pointer to size of power parameter
*
* @return Status of getting 1.8V rail power  
 */
int32_t sdr_sband_sim_get_tm_prop_power_1v8(uint16_t power_1v8, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.power_1v8 = tm_prop_sim.power_1v8 ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->power_1v8;: %d\r\n", power_1v8));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_POWER_1V8__u16_,power_1v8);
    return ret;
}

/**
 * @brief This function is used to get Power(1v0) - TM property
* @brief This function gets the 1V rail power of the S-Band module
*
* @param power_1v0 1V rail power in milliwatts
* @param size Pointer to size of power parameter 
* 
* @return Status of getting 1V rail power
 */
int32_t sdr_sband_sim_get_tm_prop_power_1v0(uint16_t power_1v0, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.power_1v0 = tm_prop_sim.power_1v0 ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->power_1v0;: %d\r\n", power_1v0));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_POWER_1V0__u16_,power_1v0);
    return ret;
}

/**
 * @brief This function is used to get Power(PA) - TM property
* @brief This function gets the PA power of the S-Band module
*
* @param power_pa PA power in milliwatts
* @param size Pointer to size of power parameter
* 
* @return Status of getting PA power
 */
int32_t sdr_sband_sim_get_tm_prop_power_pa(uint16_t power_pa, uint16_t *size)
{
    int32_t ret = 0;
    tm_prop_global.power_pa  = tm_prop_sim.power_pa  ;
    DEBUG_CPRINT(("\r\n [SBAND-SIM] tm->power_pa;: %d\r\n", power_pa));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TM_POWER_PA__u16_,power_pa);
    return ret;
}

/**
 * @brief This function is used to get transmission - TM property of S-Band module
* @brief This function gets the transmission telemetry of the S-Band module
*
* @param tx_tm Pointer to transmission telemetry struct 
* @param size Pointer to size of telemetry struct
*
* @return Status of getting transmission telemetry
 */
int32_t sdr_sband_sim_get_tx_tm_prop(s_comms_tx_tm *tx_tm, uint16_t *size)
{
    int32_t ret = 0;
    tx_tm->tx_cfg_frames = tx_cfg_sim.tx_cfg_frames;
    tx_tm->tx_cfg_pwr_fwd = tx_cfg_sim.tx_cfg_pwr_fwd;
    tx_tm->tx_cfg_pwr_rfl = tx_cfg_sim.tx_cfg_pwr_rfl;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] transmitted frames are %lu", tx_tm->tx_cfg_frames));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TRANSMITTED_FRAMES_ARE__u32_,tx_tm->tx_cfg_frames);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX measured forward power %.2f", tx_tm->tx_cfg_pwr_fwd));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_MEASURED_FORWARED_POWER_IS__u16_pt_u16_,tx_tm->tx_cfg_pwr_fwd);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] TX refected power %.2f", tx_tm->tx_cfg_pwr_rfl));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_TX_REFECTED_POWER_IS__u16_pt_u16_,tx_tm->tx_cfg_pwr_rfl);
    return ret;
}

/**
 * @brief  This function is used to get reception - TM property of S-Band module
* @brief This function gets the reception telemetry of the S-Band module  
*
* @param rx_tm Pointer to reception telemetry struct
* @param size Pointer to size of telemetry struct
* 
* @return Status of getting reception telemetry
 */
int32_t sdr_sband_sim_get_rx_tm_prop(s_comms_rx_tm  *rx_tm, uint16_t *size)
{
    int32_t ret = 0;

    rx_tm->rx_cfg_frames =       rx_cfg_sim.rx_cfg_frames;
    rx_tm->rx_cfg_detected =     rx_cfg_sim.rx_cfg_detected;
    rx_tm->rx_cfg_rssi =         rx_cfg_sim.rx_cfg_rssi;
    rx_tm->rx_cfg_freqerr =      rx_cfg_sim.rx_cfg_freqerr;
    rx_tm->rx_cfg_symerr =       rx_cfg_sim.rx_cfg_symerr;
    rx_tm->rx_cfg_ebn0 =         rx_cfg_sim.rx_cfg_ebn0;
    rx_tm->rx_cfg_carrier_lock = rx_cfg_sim.rx_cfg_carrier_lock;
    rx_tm->rx_frame_lock =       rx_cfg_sim.rx_frame_lock;
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat"
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frames received %lu\r\n", rx_tm->rx_cfg_frames));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAMES_RECEIVED_IS__u32_,rx_tm->rx_cfg_frames);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frames detected %lu\r\n", rx_tm->rx_cfg_detected));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAMES_DETECTED_IS__u32_,rx_tm->rx_cfg_detected);
#pragma GCC diagnostic pop
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RSSI %f", rx_tm->rx_cfg_rssi));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RSSI_IS__u16_pt_u16_,rx_tm->rx_cfg_rssi);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Symbol deviation %f", rx_tm->rx_cfg_symerr));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FREQUENCY_DEVIATION_IS__u16_pt_u16_,rx_tm->rx_cfg_freqerr);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frquency deviation %f", rx_tm->rx_cfg_freqerr));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_SYMBOL_DEVIATION_IS__u16_pt_u16_,rx_tm->rx_cfg_symerr);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX EBN0 %f", rx_tm->rx_cfg_ebn0));
    log_id_with_float(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_EBN0_IS__u16_pt_u16_,rx_tm->rx_cfg_ebn0);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Carrier lock %d", rx_tm->rx_cfg_carrier_lock));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_CARRIER_LOCK_IS__u8_,rx_tm->rx_cfg_carrier_lock);
    DEBUG_CPRINT(("\r\n [SBAND-SIM] RX Frame Lock %d", rx_tm->rx_frame_lock));
    log_id_with_one_arg(LOG_INFO_L1,LOG_COMMS,SBAND_SIM_RX_FRAME_LOCK__u8_,rx_tm->rx_frame_lock);
    return ret;
}

#endif
