mbgtools-lx
4.2.8
|
#include <mbgdevio.h>
#include <deviohlp.h>
#include <toolutil.h>
#include <str_util.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
Go to the source code of this file.
Macros | |
#define | USLEEP_INTV 10000 |
#define | MBG_FIRST_COPYRIGHT_YEAR 2001 |
#define | MBG_LAST_COPYRIGHT_YEAR 0 |
Functions | |
static void | show_ucap_event (const PCPS_HR_TIME *ucap) |
Show a user capture event in PCPS_HR_TIME format. More... | |
static void | show_gps_ucap (const TTM *ucap) |
Show a user capture event in TTM format read from device. More... | |
static void | check_serial_mode (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev) |
Check the modes of a device's serial ports. More... | |
static int | do_mbggpscap (MBG_DEV_HANDLE dh, const PCPS_DEV *p_dev) |
static void | usage (void) |
int | main (int argc, char *argv[]) |
Variables | |
static const char * | pname = "mbggpscap" |
static int | continuous |
static double | nom_cap_intv |
static double | max_cap_jitter |
static int | raw |
static int | force_old_api |
static int | clear_buffer |
static const char * | log_fn |
static int | has_been_called |
static int | must_check_intv |
static int | query_only |
static ulong | err_cnt |
static PCPS_HR_TIME | prv_ucap |
static MBG_DEV_HANDLER_FNC | do_mbggpscap |
#define MBG_FIRST_COPYRIGHT_YEAR 2001 |
Definition at line 84 of file mbggpscap.c.
Referenced by main().
#define MBG_LAST_COPYRIGHT_YEAR 0 |
Definition at line 85 of file mbggpscap.c.
Referenced by main().
#define USLEEP_INTV 10000 |
Definition at line 81 of file mbggpscap.c.
Referenced by do_mbggpscap().
|
static |
Check the modes of a device's serial ports.
If one of the device's serial ports has been configured to send a serial string automatically then this is usually to send a capture event string automatically as soon as an event has occurred.
As a consequence, those events are removed from the on-board FIFO and aren't available anymore when an application tries to read capture events via the PCI bus, using the API functions mbg_get_ucap_event or mbg_get_gps_ucap.
So we check and print a warning, if this may be the case.
[in] | dh | Valid MBG_DEV_HANDLE handle to a Meinberg device. |
[in] | p_dev | Pointer do a device info structure for the device. |
Definition at line 259 of file mbggpscap.c.
References mbg_cond_err_msg(), mbg_get_serial_settings(), mbg_setup_receiver_info(), PORT_SETTINGS::mode, RECEIVER_INFO::n_com_ports, RECEIVER_PORT_CFG::pii, and STR_AUTO.
Referenced by do_mbggpscap().
|
static |
Definition at line 314 of file mbggpscap.c.
References _pcps_has_ucap, _pcps_is_gps, _pcps_time_is_read, check_serial_mode(), clear_buffer, continuous, err_cnt, force_old_api, PCPS_TIME_STAMP::frac, has_been_called, PCPS_UCAP_ENTRIES::max, max_cap_jitter, mbg_clr_ucap_buff(), mbg_cond_err_msg(), mbg_get_gps_ucap(), mbg_get_ucap_entries(), mbg_get_ucap_event(), MBG_SUCCESS, must_check_intv, nom_cap_intv, query_only, PCPS_TIME_STAMP::sec, show_gps_ucap(), show_ucap_event(), TTM::tm, PCPS_HR_TIME::tstamp, PCPS_UCAP_ENTRIES::used, and USLEEP_INTV.
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 475 of file mbggpscap.c.
References clear_buffer, continuous, do_mbggpscap, force_old_api, log_fn, max_cap_jitter, MBG_EXIT_CODE_FAIL, MBG_EXIT_CODE_SUCCESS, MBG_EXIT_CODE_USAGE, MBG_FIRST_COPYRIGHT_YEAR, mbg_handle_devices(), MBG_LAST_COPYRIGHT_YEAR, mbg_print_program_info(), mbg_rc_is_success, must_print_usage, nom_cap_intv, pname, query_only, raw, and usage().
|
static |
Show a user capture event in TTM format read from device.
This function is actually obsolete since it shows user capture events provided as TTM structure, as returned by the obsolete API call mbg_get_gps_ucap.
The current API call mbg_get_ucap_event is faster and provides capture events as PCPS_HR_TIME structure, but some very old devices may not support the newer API.
[in] | ucap | The capture event read from a device. |
Definition at line 214 of file mbggpscap.c.
References TTM::channel, TM_GPS::frac, TM_GPS::hour, TM_GPS::mday, TM_GPS::min, TM_GPS::month, raw, TM_GPS::sec, TM_GPS::status, TTM::tm, and TM_GPS::year.
Referenced by do_mbggpscap().
|
static |
Show a user capture event in PCPS_HR_TIME format.
The current API call mbg_get_ucap_event provides capture events as PCPS_HR_TIME structure, but there may be older devices which only support the obsolete API call mbg_get_gps_ucap.
[in] | ucap | The capture event read from a device. |
Definition at line 121 of file mbggpscap.c.
References err_cnt, PCPS_TIME_STAMP::frac, has_been_called, log_fn, max_cap_jitter, MBG_FRAC32_UNITS_PER_SEC, mbg_snprint_hr_time(), must_check_intv, nom_cap_intv, PCPS_UCAP_BUFFER_FULL, PCPS_UCAP_OVERRUN, raw, PCPS_TIME_STAMP::sec, PCPS_HR_TIME::signal, snprintf_safe(), PCPS_HR_TIME::status, and PCPS_HR_TIME::tstamp.
Referenced by do_mbggpscap().
|
static |
Definition at line 454 of file mbggpscap.c.
References mbg_print_device_options(), mbg_print_help_options(), mbg_print_opt_info(), mbg_print_usage_intro(), and pname.
Referenced by main().
|
static |
Definition at line 95 of file mbggpscap.c.
Referenced by do_mbggpscap(), and main().
|
static |
Definition at line 90 of file mbggpscap.c.
Referenced by do_mbggpscap(), and main().
|
static |
Definition at line 449 of file mbggpscap.c.
Referenced by main().
|
static |
Definition at line 101 of file mbggpscap.c.
Referenced by do_mbggpscap(), and show_ucap_event().
|
static |
Definition at line 94 of file mbggpscap.c.
Referenced by do_mbggpscap(), and main().
|
static |
Definition at line 98 of file mbggpscap.c.
Referenced by do_mbggpscap(), and show_ucap_event().
|
static |
Definition at line 96 of file mbggpscap.c.
Referenced by main(), and show_ucap_event().
|
static |
Definition at line 92 of file mbggpscap.c.
Referenced by do_mbggpscap(), main(), and show_ucap_event().
|
static |
Definition at line 99 of file mbggpscap.c.
Referenced by do_mbggpscap(), and show_ucap_event().
|
static |
Definition at line 91 of file mbggpscap.c.
Referenced by do_mbggpscap(), main(), and show_ucap_event().
|
static |
Definition at line 87 of file mbggpscap.c.
|
static |
Definition at line 102 of file mbggpscap.c.
|
static |
Definition at line 100 of file mbggpscap.c.
Referenced by do_mbggpscap(), and main().
|
static |
Definition at line 93 of file mbggpscap.c.
Referenced by main(), show_gps_ucap(), and show_ucap_event().