mbgtools-lx  4.2.8
mbgirigcfg.c File Reference
#include <mbgdevio.h>
#include <mbgutil.h>
#include <mbgtime.h>
#include <pcpsmktm.h>
#include <pcpslstr.h>
#include <myutil.h>
#include <toolutil.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

Go to the source code of this file.

Macros

#define MBG_FIRST_COPYRIGHT_YEAR   2003
 
#define MBG_LAST_COPYRIGHT_YEAR   0
 

Functions

static int snprint_hours_mins (char *s, size_t max_len, long num_minutes)
 
static void print_cfg_rx (const char *info, const char *msg)
 
static void print_cfg_tx (const char *info, const char *msg)
 
static void set_new_icode_rx (char *s)
 
static void set_new_ref_offs (char *s)
 
static void set_ref_offs_not_cfgd (void)
 
static void set_new_str_utc (char *s)
 
static void set_new_icode_tx (char *s)
 
static void set_new_irig_tx_local (char *s)
 
static void set_new_tfom_flag (char *s, IRIG_SETTINGS *p, int *changed_flag, int *err_flag)
 
static int chk_dev_rx (const PCPS_DEV *p_dev)
 
static int chk_dev_tx (const PCPS_DEV *p_dev)
 
static void check_cmd_line (int argc, char *argv[], const PCPS_DEV *p_dev)
 
static void usage (void)
 
static int do_mbgirigcfg (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev)
 
int main (int argc, char *argv[])
 

Variables

static const char pname [] = "mbgirigcfg"
 
static int glb_argc
 
static char ** glb_argv
 
static const char str_yes [] = "YES"
 
static const char str_no [] = "NO"
 
static const char str_not_supp [] = " (not supp. by this frame type)"
 
static const char info_curr [] = "Current"
 
static const char info_new [] = "New"
 
static const char msg_rx [] = DEFAULT_OPT_NAME_IRIG_RX_EN
 
static const char msg_tx [] = DEFAULT_OPT_NAME_IRIG_TX_EN
 
static IRIG_INFO irig_rx_info
 
static IRIG_INFO irig_tx_info
 
static MBG_REF_OFFS ref_offs
 
static MBG_OPT_INFO opt_info
 
static int cfg_err_rx
 
static int cfg_err_tx
 
static int changed_cfg_rx
 
static int changed_cfg_tx
 
static int warned_no_rx
 
static int warned_no_tx
 
static int must_print_help_info
 
static const char * icode_rx_names [N_ICODE_RX] = DEFAULT_ICODE_RX_NAMES
 
static const char * icode_rx_descr [N_ICODE_RX] = DEFAULT_ICODE_RX_DESCRIPTIONS_ENG
 
static const char * icode_tx_names [N_ICODE_TX] = DEFAULT_ICODE_TX_NAMES
 
static const char * icode_tx_descr [N_ICODE_TX] = DEFAULT_ICODE_TX_DESCRIPTIONS_ENG
 
static char str_ref_offs_min [16]
 
static char str_ref_offs_max [16]
 
static MBG_DEV_HANDLER_FNC do_mbgirigcfg
 

Macro Definition Documentation

◆ MBG_FIRST_COPYRIGHT_YEAR

#define MBG_FIRST_COPYRIGHT_YEAR   2003

Definition at line 78 of file mbgirigcfg.c.

Referenced by main().

◆ MBG_LAST_COPYRIGHT_YEAR

#define MBG_LAST_COPYRIGHT_YEAR   0

Definition at line 79 of file mbgirigcfg.c.

Referenced by main().

Function Documentation

◆ check_cmd_line()

◆ chk_dev_rx()

static int chk_dev_rx ( const PCPS_DEV p_dev)
static

Definition at line 407 of file mbgirigcfg.c.

References _pcps_is_irig_rx, cfg_err_rx, and warned_no_rx.

Referenced by check_cmd_line(), and do_mbgirigcfg().

◆ chk_dev_tx()

static int chk_dev_tx ( const PCPS_DEV p_dev)
static

Definition at line 430 of file mbgirigcfg.c.

References _pcps_has_irig_tx, cfg_err_tx, and warned_no_tx.

Referenced by check_cmd_line(), and do_mbgirigcfg().

◆ do_mbgirigcfg()

◆ main()

◆ print_cfg_rx()

◆ print_cfg_tx()

◆ set_new_icode_rx()

static void set_new_icode_rx ( char *  s)
static

◆ set_new_icode_tx()

static void set_new_icode_tx ( char *  s)
static

◆ set_new_irig_tx_local()

static void set_new_irig_tx_local ( char *  s)
static

◆ set_new_ref_offs()

static void set_new_ref_offs ( char *  s)
static

◆ set_new_str_utc()

static void set_new_str_utc ( char *  s)
static

◆ set_new_tfom_flag()

static void set_new_tfom_flag ( char *  s,
IRIG_SETTINGS p,
int *  changed_flag,
int *  err_flag 
)
static

◆ set_ref_offs_not_cfgd()

static void set_ref_offs_not_cfgd ( void  )
static

Definition at line 294 of file mbgirigcfg.c.

References changed_cfg_rx, MBG_REF_OFFS_NOT_CFGD, and ref_offs.

Referenced by check_cmd_line().

◆ snprint_hours_mins()

static int snprint_hours_mins ( char *  s,
size_t  max_len,
long  num_minutes 
)
static

Definition at line 122 of file mbgirigcfg.c.

References _int_from_size_t, mbg_snprintf(), and MINS_PER_HOUR.

Referenced by main(), print_cfg_rx(), and set_new_ref_offs().

◆ usage()

static void usage ( void  )
static

Variable Documentation

◆ cfg_err_rx

int cfg_err_rx
static

◆ cfg_err_tx

int cfg_err_tx
static

◆ changed_cfg_rx

int changed_cfg_rx
static

◆ changed_cfg_tx

int changed_cfg_tx
static

◆ do_mbgirigcfg

MBG_DEV_HANDLER_FNC do_mbgirigcfg
static

Definition at line 716 of file mbgirigcfg.c.

Referenced by main().

◆ glb_argc

int glb_argc
static

Definition at line 84 of file mbgirigcfg.c.

Referenced by do_mbgirigcfg(), and main().

◆ glb_argv

char** glb_argv
static

Definition at line 85 of file mbgirigcfg.c.

Referenced by do_mbgirigcfg(), and main().

◆ icode_rx_descr

const char* icode_rx_descr[N_ICODE_RX] = DEFAULT_ICODE_RX_DESCRIPTIONS_ENG
static

Definition at line 111 of file mbgirigcfg.c.

Referenced by print_cfg_rx(), and usage().

◆ icode_rx_names

const char* icode_rx_names[N_ICODE_RX] = DEFAULT_ICODE_RX_NAMES
static

Definition at line 110 of file mbgirigcfg.c.

Referenced by print_cfg_rx(), set_new_icode_rx(), and usage().

◆ icode_tx_descr

const char* icode_tx_descr[N_ICODE_TX] = DEFAULT_ICODE_TX_DESCRIPTIONS_ENG
static

Definition at line 114 of file mbgirigcfg.c.

Referenced by print_cfg_tx(), and usage().

◆ icode_tx_names

const char* icode_tx_names[N_ICODE_TX] = DEFAULT_ICODE_TX_NAMES
static

Definition at line 113 of file mbgirigcfg.c.

Referenced by print_cfg_tx(), set_new_icode_tx(), and usage().

◆ info_curr

const char info_curr[] = "Current"
static

Definition at line 91 of file mbgirigcfg.c.

Referenced by do_mbgirigcfg().

◆ info_new

const char info_new[] = "New"
static

Definition at line 92 of file mbgirigcfg.c.

Referenced by do_mbgirigcfg().

◆ irig_rx_info

IRIG_INFO irig_rx_info
static

Definition at line 96 of file mbgirigcfg.c.

Referenced by do_mbgtcrcal(), and show_signal().

◆ irig_tx_info

IRIG_INFO irig_tx_info
static

Definition at line 97 of file mbgirigcfg.c.

◆ msg_rx

const char msg_rx[] = DEFAULT_OPT_NAME_IRIG_RX_EN
static

Definition at line 93 of file mbgirigcfg.c.

Referenced by do_mbgirigcfg().

◆ msg_tx

const char msg_tx[] = DEFAULT_OPT_NAME_IRIG_TX_EN
static

Definition at line 94 of file mbgirigcfg.c.

Referenced by do_mbgirigcfg().

◆ must_print_help_info

int must_print_help_info
static

Definition at line 108 of file mbgirigcfg.c.

Referenced by do_mbgirigcfg(), and main().

◆ opt_info

MBG_OPT_INFO opt_info
static

Definition at line 99 of file mbgirigcfg.c.

◆ pname

const char pname[] = "mbgirigcfg"
static

Definition at line 81 of file mbgirigcfg.c.

Referenced by main(), and usage().

◆ ref_offs

◆ str_no

const char str_no[] = "NO"
static

Definition at line 88 of file mbgirigcfg.c.

Referenced by print_cfg_rx(), and print_cfg_tx().

◆ str_not_supp

const char str_not_supp[] = " (not supp. by this frame type)"
static

Definition at line 89 of file mbgirigcfg.c.

Referenced by print_cfg_rx(), and print_cfg_tx().

◆ str_ref_offs_max

char str_ref_offs_max[16]
static

Definition at line 117 of file mbgirigcfg.c.

Referenced by main(), set_new_ref_offs(), and usage().

◆ str_ref_offs_min

char str_ref_offs_min[16]
static

Definition at line 116 of file mbgirigcfg.c.

Referenced by main(), set_new_ref_offs(), and usage().

◆ str_yes

const char str_yes[] = "YES"
static

Definition at line 87 of file mbgirigcfg.c.

Referenced by print_cfg_rx(), and print_cfg_tx().

◆ warned_no_rx

int warned_no_rx
static

Definition at line 105 of file mbgirigcfg.c.

Referenced by chk_dev_rx(), and do_mbgirigcfg().

◆ warned_no_tx

int warned_no_tx
static

Definition at line 106 of file mbgirigcfg.c.

Referenced by chk_dev_tx(), and do_mbgirigcfg().