summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Burnicki <martin.burnicki@meinberg.de>2022-07-06 17:58:17 +0200
committerMartin Burnicki <martin.burnicki@meinberg.de>2022-07-06 17:58:17 +0200
commit086e9b13bd665cee148aba28179f19dbc92e33f8 (patch)
treefc8d5ad3dbf2f84218a691c1a7429047205804db
parentf4fd0d2a3374af0923c58b7af9934bd5ff1fc397 (diff)
downloadmbgtools-lx-086e9b13bd665cee148aba28179f19dbc92e33f8.tar.gz
mbgtools-lx-086e9b13bd665cee148aba28179f19dbc92e33f8.zip
Support SYN1588 insync range boundary codes in mbgstatus
-rw-r--r--mbgstatus/mbgstatus.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/mbgstatus/mbgstatus.c b/mbgstatus/mbgstatus.c
index c93817b..01192eb 100644
--- a/mbgstatus/mbgstatus.c
+++ b/mbgstatus/mbgstatus.c
@@ -1,7 +1,7 @@
/**************************************************************************
*
- * $Id: mbgstatus.c 1.36 2022/06/30 13:00:22 martin.burnicki REL_M $
+ * $Id: mbgstatus.c 1.37 2022/07/06 15:09:51 martin.burnicki REL_M $
*
* Description:
* Main file for mbgstatus program which demonstrates how to
@@ -10,6 +10,8 @@
*
* -----------------------------------------------------------------------
* $Log: mbgstatus.c $
+ * Revision 1.37 2022/07/06 15:09:51 martin.burnicki
+ * Support SYN1588 insync range boundary code.
* Revision 1.36 2022/06/30 13:00:22 martin.burnicki
* Support reading XMR status information from devices that support this.
* New option -F to force reading XMR stuff if the feature is not enabled,
@@ -912,8 +914,8 @@ void show_syn1588_ptp_sync_status( const DEVICE_STATUS *p_ds )
uint32_t ptp_state;
const char *ptp_state_str;
bool ptp_in_sync;
- uint32_t insync_boundary_idx;
- const char *insync_boundary_str;
+ uint32_t insync_boundary_code;
+ char insync_boundary_str[80];
bool lsync_running;
printf( "PTP state: " );
@@ -932,8 +934,9 @@ void show_syn1588_ptp_sync_status( const DEVICE_STATUS *p_ds )
ptp_state_str = mbg_syn1588_chk_get_ptp_state_str( ptp_state );
ptp_in_sync = syn1588_ptp_in_sync( p_ds->syn1588_ptp_sync_status );
- insync_boundary_idx = syn1588_get_in_sync_boundary_idx( p_ds->syn1588_ptp_sync_status );
- insync_boundary_str = mbg_syn1588_get_boundary_str( insync_boundary_idx );
+ insync_boundary_code = syn1588_get_in_sync_boundary_code( p_ds->syn1588_ptp_sync_status );
+ mbg_syn1588_snprint_insync_boundary_code( insync_boundary_str, sizeof( insync_boundary_str ),
+ insync_boundary_code, true );
lsync_running = syn1588_lsync_running( p_ds->syn1588_ptp_sync_status );
@@ -984,10 +987,11 @@ print_details:
if ( must_show_values )
printf( " (0x%02X)", ptp_state );
- printf( ", in sync: %i, boundary: %s", ptp_in_sync, insync_boundary_str );
+ printf( ", in sync: %i, boundary: %s", ptp_in_sync, sync_status_valid ?
+ insync_boundary_str : "undefined" );
if ( must_show_values )
- printf( " (%u)", insync_boundary_idx );
+ printf( " (0x%02X)", insync_boundary_code );
printf( "\n" );