# HG changeset patch # User Florian Pose # Date 1268131423 -3600 # Node ID 4d4aa4c0fc1eb695ce548b94beb76acf87b23b50 # Parent ed8b490b5bc31f44eee3cae735fd69c674bba090 Improved frame statistics output again. diff -r ed8b490b5bc3 -r 4d4aa4c0fc1e tool/CommandMaster.cpp --- a/tool/CommandMaster.cpp Tue Mar 09 10:22:32 2010 +0100 +++ b/tool/CommandMaster.cpp Tue Mar 09 11:43:43 2010 +0100 @@ -112,6 +112,12 @@ && data.devices[i].address[5] == 0x00) { cout << "None."; } else { + unsigned int lost = + data.devices[i].tx_count - data.devices[i].rx_count; + if (lost == 1) { + // allow one frame travelling + lost = 0; + } cout << hex << setfill('0') << setw(2) << (unsigned int) data.devices[i].address[0] << ":" @@ -129,10 +135,15 @@ << ")" << endl << dec << " Link: " << (data.devices[i].link_state ? "UP" : "DOWN") << endl - << " Tx count: " << data.devices[i].tx_count << endl - << " Rx count: " << data.devices[i].rx_count << endl - << " Tx bytes: " << data.devices[i].tx_bytes << endl - << " Tx errors: " << data.devices[i].tx_errors << endl + << " Tx frames: " + << data.devices[i].tx_count << endl + << " Rx frames: " + << data.devices[i].rx_count << endl + << " Lost frames: " << lost << endl + << " Tx bytes: " + << data.devices[i].tx_bytes << endl + << " Tx errors: " + << data.devices[i].tx_errors << endl << " Tx frame rate [1/s]: " << setfill(' ') << setprecision(0) << fixed; for (j = 0; j < EC_RATE_COUNT; j++) { @@ -144,10 +155,10 @@ } cout << endl << " Tx rate [KByte/s]: " - << setprecision(0) << fixed; - for (j = 0; j < EC_RATE_COUNT; j++) { - cout << - setw(5) << data.devices[i].tx_byte_rates[j] / 1000.0; + << setprecision(1) << fixed; + for (j = 0; j < EC_RATE_COUNT; j++) { + cout << setw(5) + << data.devices[i].tx_byte_rates[j] / 1024000.0; if (j < EC_RATE_COUNT - 1) { cout << " "; }