summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Burnicki <martin.burnicki@meinberg.de>2022-04-01 16:18:52 +0200
committerMartin Burnicki <martin.burnicki@meinberg.de>2022-07-08 17:21:00 +0200
commitbb3cbed75f5a53f4718597dc4c04899c02d06d28 (patch)
treeaf72aa4a3b3af13d15ea0ff770c9479303b629e0
parenta5b8957046d2d8d0bfb6e5e1ac7d45b51cce18f6 (diff)
downloadmbgtools-win-bb3cbed75f5a53f4718597dc4c04899c02d06d28.tar.gz
mbgtools-win-bb3cbed75f5a53f4718597dc4c04899c02d06d28.zip
Improve printing of usage information by the command line tools
-rw-r--r--mbgcmptime/mbgcmptime.c11
-rw-r--r--mbgctrl/mbgctrl.c8
-rw-r--r--mbgfasttstamp/mbgfasttstamp.c11
-rw-r--r--mbggpscap/mbggpscap.c11
-rw-r--r--mbghrtime/mbghrtime.c11
-rw-r--r--mbgsetsystime/mbgsetsystime.c11
-rw-r--r--mbgshowsignal/mbgshowsignal.c11
-rw-r--r--mbgstatus/mbgstatus.c11
-rw-r--r--mbgtcrcal/mbgtcrcal.c8
-rw-r--r--mbgxhrtime/mbgxhrtime.c11
10 files changed, 60 insertions, 44 deletions
diff --git a/mbgcmptime/mbgcmptime.c b/mbgcmptime/mbgcmptime.c
index 5ee8043..f6483ad 100644
--- a/mbgcmptime/mbgcmptime.c
+++ b/mbgcmptime/mbgcmptime.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgcmptime.c 1.10 2021/11/08 18:01:08Z martin.burnicki REL_M $
+ * $Id: mbgcmptime.c 1.11 2021/11/15 17:08:52Z martin.burnicki REL_M $
*
* Description:
* Main file for mbgcmptime program which compares the time on 2 devices
@@ -11,7 +11,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbgcmptime.c $
- * Revision 1.10 2021/11/08 18:01:08Z martin.burnicki
+ * Revision 1.11 2021/11/15 17:08:52Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.10 2021/11/08 18:01:08 martin.burnicki
* Account for modified MBG_DEV_FN type.
* Revision 1.9 2021/04/12 21:57:54 martin
* Updated printing of usage information.
@@ -288,7 +290,7 @@ done:
static /*HDR*/
void usage( void )
{
- mbg_print_usage_intro( pname,
+ mbg_print_usage_intro( pname, true,
"Compare the time on two devices by reading the time stamps plus cycles from\n"
"both devices immediately after each other, and compensate the execution delay\n"
"based on the returned cycles counts.\n"
@@ -312,7 +314,6 @@ void usage( void )
mbg_print_opt_info( "-q", "quiet, Only log errors to console (use -o to specify file for full log)" );
mbg_print_opt_info( "-a", "Auto-compensate initial offset" );
mbg_print_device_options( DEV_OPT_PRINT_BUS_LEVEL );
- puts( "" );
printf( "\nExamples:\n\n" );
printf(
@@ -327,6 +328,8 @@ void usage( void )
pname, EXAMPLE_DEV_NAME_1, EXAMPLE_DEV_NAME_2
);
+ mbg_print_usage_syn1588_support();
+
} // usage
diff --git a/mbgctrl/mbgctrl.c b/mbgctrl/mbgctrl.c
index 6e3334f..e98ca6b 100644
--- a/mbgctrl/mbgctrl.c
+++ b/mbgctrl/mbgctrl.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgctrl.c 1.32 2021/11/08 18:01:31Z martin.burnicki REL_M $
+ * $Id: mbgctrl.c 1.33 2021/11/15 17:08:54Z martin.burnicki REL_M $
*
* Description:
* Main file for mbgctrl program which sends commands and
@@ -9,7 +9,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbgctrl.c $
- * Revision 1.32 2021/11/08 18:01:31Z martin.burnicki
+ * Revision 1.33 2021/11/15 17:08:54Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.32 2021/11/08 18:01:31 martin.burnicki
* Account for modified MBG_DEV_FN type.
* Revision 1.31 2021/04/12 21:57:56 martin
* Updated printing of usage information.
@@ -2901,6 +2903,8 @@ void usage( MBG_DEV_HANDLE dh, PCPS_DEV *p_dev, RECEIVER_INFO *p_ri,
printf( " EVENT=<n> Set event time to system time + <n> seconds.\n" );
}
+ mbg_print_usage_syn1588_support();
+
} // usage
diff --git a/mbgfasttstamp/mbgfasttstamp.c b/mbgfasttstamp/mbgfasttstamp.c
index 9b94197..e204c8f 100644
--- a/mbgfasttstamp/mbgfasttstamp.c
+++ b/mbgfasttstamp/mbgfasttstamp.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgfasttstamp.c 1.12 2021/04/12 21:58:08Z martin REL_M $
+ * $Id: mbgfasttstamp.c 1.13 2021/11/15 17:08:52Z martin.burnicki REL_M $
*
* Description:
* Main file for mbgfasttstamp program which demonstrates how to access
@@ -9,7 +9,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbgfasttstamp.c $
- * Revision 1.12 2021/04/12 21:58:08Z martin
+ * Revision 1.13 2021/11/15 17:08:52Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.12 2021/04/12 21:58:08 martin
* Updated printing of usage information.
* Revision 1.11 2021/03/21 17:53:49 martin
* Updated some comments.
@@ -220,7 +222,7 @@ static MBG_DEV_HANDLER_FNC do_mbgfasttstamp;
static /*HDR*/
void usage( void )
{
- mbg_print_usage_intro( pname,
+ mbg_print_usage_intro( pname, true,
"This example program reads fast high resolution time stamps.\n"
"\n"
"This is done using memory mapped I/O in the kernel driver, so\n"
@@ -234,8 +236,7 @@ void usage( void )
mbg_print_opt_info( "-C val", "Check for continuity, max allowed delta (seconds, with fractions)" );
mbg_print_opt_info( "-s num", "Sleep num seconds between calls (implies -c)" );
mbg_print_opt_info( "-u num", "Sleep num microseconds between calls (implies -c)" );
- mbg_print_device_options( DEV_OPT_PRINT_BUS_LEVEL );
- puts( "" );
+ mbg_print_usage_outro( DEV_OPT_PRINT_BUS_LEVEL, true );
} // usage
diff --git a/mbggpscap/mbggpscap.c b/mbggpscap/mbggpscap.c
index b6f97fa..6ec39d6 100644
--- a/mbggpscap/mbggpscap.c
+++ b/mbggpscap/mbggpscap.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbggpscap.c 1.19 2021/04/12 21:57:50Z martin REL_M $
+ * $Id: mbggpscap.c 1.20 2021/11/15 17:08:53Z martin.burnicki REL_M $
*
* Description:
* Main file for mbggpscap program which demonstrates how to access
@@ -13,7 +13,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbggpscap.c $
- * Revision 1.19 2021/04/12 21:57:50Z martin
+ * Revision 1.20 2021/11/15 17:08:53Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.19 2021/04/12 21:57:50 martin
* Updated printing of usage information.
* Revision 1.18 2021/03/21 17:56:33 martin
* Updated a bunch of comments.
@@ -571,7 +573,7 @@ static MBG_DEV_HANDLER_FNC do_mbggpscap;
static /*HDR*/
void usage( void )
{
- mbg_print_usage_intro( pname,
+ mbg_print_usage_intro( pname, true,
"This example program reads time capture events from a card.\n"
"This works only with devices that provide time capture inputs."
);
@@ -585,8 +587,7 @@ void usage( void )
mbg_print_opt_info( "-Q", "Query continuously once per second, read events as fast as possible" );
mbg_print_opt_info( "-r", "Show raw (hex) timestamp and status)" );
mbg_print_opt_info( "-o", "Force usage of old API (for testing only)" );
- mbg_print_device_options( DEV_OPT_PRINT_BUS_LEVEL );
- puts( "" );
+ mbg_print_usage_outro( DEV_OPT_PRINT_BUS_LEVEL, false );
} // usage
diff --git a/mbghrtime/mbghrtime.c b/mbghrtime/mbghrtime.c
index 46cb7a4..8a2761a 100644
--- a/mbghrtime/mbghrtime.c
+++ b/mbghrtime/mbghrtime.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbghrtime.c 1.18 2021/04/12 21:58:02Z martin REL_M $
+ * $Id: mbghrtime.c 1.19 2021/11/15 17:08:53Z martin.burnicki REL_M $
*
* Description:
* Main file for mbghrtime program which demonstrates how to access
@@ -10,7 +10,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbghrtime.c $
- * Revision 1.18 2021/04/12 21:58:02Z martin
+ * Revision 1.19 2021/11/15 17:08:53Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.18 2021/04/12 21:58:02 martin
* Updated printing of usage information.
* Revision 1.17 2021/03/21 17:59:51 martin
* Updated some comments.
@@ -250,7 +252,7 @@ static MBG_DEV_HANDLER_FNC do_mbghrtime;
static /*HDR*/
void usage( void )
{
- mbg_print_usage_intro( pname,
+ mbg_print_usage_intro( pname, true,
"This example program reads high resolution time stamps (HR time)\n"
"from a device.\n"
"This works only for devices which support high resolution time (HR time)."
@@ -264,8 +266,7 @@ void usage( void )
mbg_print_opt_info( "-s num", "Sleep num seconds between calls (implies -c)" );
mbg_print_opt_info( "-u num", "Sleep num microseconds between calls (implies -c)" );
mbg_print_opt_info( "-v", "Increase verbosity" );
- mbg_print_device_options( DEV_OPT_PRINT_BUS_LEVEL );
- puts( "" );
+ mbg_print_usage_outro( DEV_OPT_PRINT_BUS_LEVEL, true );
} // usage
diff --git a/mbgsetsystime/mbgsetsystime.c b/mbgsetsystime/mbgsetsystime.c
index 1ed3743..c6b1eaf 100644
--- a/mbgsetsystime/mbgsetsystime.c
+++ b/mbgsetsystime/mbgsetsystime.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgsetsystime.c 1.17 2021/04/12 21:57:46Z martin REL_M $
+ * $Id: mbgsetsystime.c 1.18 2021/11/15 17:08:53Z martin.burnicki REL_M $
*
* Description:
* Main file for mbgsetsystime program which reads the current date
@@ -14,7 +14,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbgsetsystime.c $
- * Revision 1.17 2021/04/12 21:57:46Z martin
+ * Revision 1.18 2021/11/15 17:08:53Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.17 2021/04/12 21:57:46 martin
* Updated printing of usage information.
* Revision 1.16 2021/03/21 22:40:08 martin
* Updated some comments.
@@ -323,14 +325,13 @@ static MBG_DEV_HANDLER_FNC do_mbgsetsystime;
static /*HDR*/
void usage( void )
{
- mbg_print_usage_intro( pname,
+ mbg_print_usage_intro( pname, true,
"This program can be used to set the system time to the time of a device.\n"
"This should be done only at boot time, before the NTP daemon is started.\n"
"Please *don't* run this program while ntpd is already active."
);
mbg_print_help_options();
- mbg_print_device_options( DEV_OPT_PRINT_BUS_LEVEL );
- puts( "" );
+ mbg_print_usage_outro( DEV_OPT_PRINT_BUS_LEVEL, true );
} // usage
diff --git a/mbgshowsignal/mbgshowsignal.c b/mbgshowsignal/mbgshowsignal.c
index b2e3813..41f936d 100644
--- a/mbgshowsignal/mbgshowsignal.c
+++ b/mbgshowsignal/mbgshowsignal.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgshowsignal.c 1.15 2021/04/12 21:57:52Z martin REL_M $
+ * $Id: mbgshowsignal.c 1.16 2021/11/15 17:08:55Z martin.burnicki REL_M $
*
* Description:
* Main file for mbgshowsignal program which demonstrates how to
@@ -10,7 +10,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbgshowsignal.c $
- * Revision 1.15 2021/04/12 21:57:52Z martin
+ * Revision 1.16 2021/11/15 17:08:55Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.15 2021/04/12 21:57:52 martin
* Updated printing of usage information.
* Revision 1.14 2021/03/21 22:40:19 martin
* Updated some comments.
@@ -180,14 +182,13 @@ static MBG_DEV_HANDLER_FNC do_mbgshowsignal;
static /*HDR*/
void usage( void )
{
- mbg_print_usage_intro( pname,
+ mbg_print_usage_intro( pname, true,
"This program displays the modulation signal of devices which receive\n"
"a slowly modulated input signal, e.g. the longwave signal from DCF77.\n"
);
mbg_print_help_options();
mbg_print_opt_info( "-F", "Force reading status port even if signal not supported" );
- mbg_print_device_options( DEV_OPT_PRINT_BUS_LEVEL );
- puts( "" );
+ mbg_print_usage_outro( DEV_OPT_PRINT_BUS_LEVEL, false );
} // usage
diff --git a/mbgstatus/mbgstatus.c b/mbgstatus/mbgstatus.c
index 9159e49..52982f9 100644
--- a/mbgstatus/mbgstatus.c
+++ b/mbgstatus/mbgstatus.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgstatus.c 1.32 2021/11/08 21:50:59Z martin.burnicki REL_M $
+ * $Id: mbgstatus.c 1.33 2021/11/15 17:08:52Z martin.burnicki REL_M $
*
* Description:
* Main file for mbgstatus program which demonstrates how to
@@ -10,7 +10,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbgstatus.c $
- * Revision 1.32 2021/11/08 21:50:59Z martin.burnicki
+ * Revision 1.33 2021/11/15 17:08:52Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.32 2021/11/08 21:50:59 martin.burnicki
* Show SYN1588-specific info, if appropriate.
* Revision 1.31 2021/05/27 20:57:38 martin
* Refactured printing of GPS/UTC time offset and
@@ -1721,7 +1723,7 @@ static MBG_DEV_HANDLER_FNC do_mbgstatus;
static /*HDR*/
void usage( void )
{
- mbg_print_usage_intro( pname,
+ mbg_print_usage_intro( pname, true,
"This program prints status information for a device.\n"
"The displayed information depends on the type of the card."
);
@@ -1733,8 +1735,7 @@ void usage( void )
mbg_print_opt_info( "-s num", "Sleep num seconds between calls (implies -c)" );
mbg_print_opt_info( "-u num", "Sleep num microseconds between calls (implies -c)" );
mbg_print_opt_info( "-v", "Increase verbosity" );
- mbg_print_device_options( DEV_OPT_PRINT_BUS_LEVEL );
- puts( "" );
+ mbg_print_usage_outro( DEV_OPT_PRINT_BUS_LEVEL, true );
} // usage
diff --git a/mbgtcrcal/mbgtcrcal.c b/mbgtcrcal/mbgtcrcal.c
index 1d3a625..c2f67c0 100644
--- a/mbgtcrcal/mbgtcrcal.c
+++ b/mbgtcrcal/mbgtcrcal.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgtcrcal.c 1.17 2021/04/12 21:58:03Z martin REL_M $
+ * $Id: mbgtcrcal.c 1.18 2021/11/15 17:08:53Z martin.burnicki REL_M $
*
* Description:
* Main file for mbgtcrcal program which can be used to calibrate
@@ -9,7 +9,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbgtcrcal.c $
- * Revision 1.17 2021/04/12 21:58:03Z martin
+ * Revision 1.18 2021/11/15 17:08:53Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.17 2021/04/12 21:58:03 martin
* Updated printing of usage information.
* Revision 1.16 2021/03/21 22:40:47 martin
* Updated a bunch of comments.
@@ -306,7 +308,7 @@ void usage( void )
{
char ws[20];
- mbg_print_usage_intro( pname,
+ mbg_print_usage_intro( pname, true,
"Show or set IRIG RX calibration parameters of devices which support this." );
mbg_print_help_options();
diff --git a/mbgxhrtime/mbgxhrtime.c b/mbgxhrtime/mbgxhrtime.c
index e79471b..f014990 100644
--- a/mbgxhrtime/mbgxhrtime.c
+++ b/mbgxhrtime/mbgxhrtime.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgxhrtime.c 1.10 2021/04/12 21:57:48Z martin REL_M $
+ * $Id: mbgxhrtime.c 1.11 2021/11/15 17:08:54Z martin.burnicki REL_M $
*
* Description:
* Main file for mbgxhrtime program which demonstrates how to retrieve
@@ -41,7 +41,9 @@
*
* -----------------------------------------------------------------------
* $Log: mbgxhrtime.c $
- * Revision 1.10 2021/04/12 21:57:48Z martin
+ * Revision 1.11 2021/11/15 17:08:54Z martin.burnicki
+ * Improved printing of usage information.
+ * Revision 1.10 2021/04/12 21:57:48 martin
* Updated printing of usage information.
* Revision 1.9 2021/03/21 22:40:58 martin
* Updated some comments.
@@ -280,7 +282,7 @@ static MBG_DEV_HANDLER_FNC do_mbgxhrtime;
static /*HDR*/
void usage( void )
{
- mbg_print_usage_intro( pname,
+ mbg_print_usage_intro( pname, true,
"This example program reads fast extrapolated high resolution time stamps.\n"
"\n"
"The program starts an extra polling thread which reads a high resolution\n"
@@ -295,8 +297,7 @@ void usage( void )
mbg_print_help_options();
mbg_print_opt_info( "-c", "Run continuously" );
mbg_print_opt_info( "-n num", "Run num loops" );
- mbg_print_device_options( DEV_OPT_PRINT_BUS_LEVEL );
- puts( "" );
+ mbg_print_usage_outro( DEV_OPT_PRINT_BUS_LEVEL, true );
} // usage