mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
fix on bandwidth
This commit is contained in:
parent
a00600a199
commit
8eab436ec2
2 changed files with 7 additions and 7 deletions
|
@ -12,7 +12,7 @@ while [ 1 == 1 ] ; do
|
|||
if [ $RXPREV -ne -1 ] ; then
|
||||
let BWRX=$RX-$RXPREV
|
||||
let BWTX=$TX-$TXPREV
|
||||
echo "$BWRX $BWTX">/tmp/netspeed
|
||||
echo "$((BWRX*8)) $(($BWTX*8))">/tmp/netspeed
|
||||
fi
|
||||
RXPREV=$RX
|
||||
TXPREV=$TX
|
||||
|
|
|
@ -774,14 +774,14 @@ void testnetspeed(int mode, int y)
|
|||
{
|
||||
case SPLIT:
|
||||
setTextSize(2);
|
||||
if (tx < 1000) sprintf(buf, "%dB/s", tx);
|
||||
if (tx < 1000) sprintf(buf, "%db/s", tx);
|
||||
else if (tx > 1000000) sprintf(buf, "%dMb/s", tx/1000000);
|
||||
else sprintf(buf, "%dKb/s", tx/1000);
|
||||
setCursor(30,19);
|
||||
//oled_write(24);
|
||||
print_str(buf);
|
||||
|
||||
if (rx < 1000) sprintf(buf, "%dB/s", rx);
|
||||
if (rx < 1000) sprintf(buf, "%db/s", rx);
|
||||
else if (rx > 1000000) sprintf(buf, "%dMb/s", rx/1000000);
|
||||
else sprintf(buf, "%dKb/s", rx/1000);
|
||||
setCursor(30,35);
|
||||
|
@ -790,14 +790,14 @@ void testnetspeed(int mode, int y)
|
|||
break;
|
||||
case MERGE:
|
||||
setTextSize(1);
|
||||
if (tx < 1000) sprintf(buf, "%03dB ", tx);
|
||||
if (tx < 1000) sprintf(buf, "%03db ", tx);
|
||||
else if (tx > 1000000) sprintf(buf, "%03dM", tx/1000000);
|
||||
else sprintf(buf, "%03dK ", tx/1000);
|
||||
setCursor((127-(2*strlen(buf)-1)*6)/2-4, y+4);
|
||||
oled_write(24);
|
||||
print_str(buf);
|
||||
|
||||
if (rx < 1000) sprintf(buf, "%03dB", rx);
|
||||
if (rx < 1000) sprintf(buf, "%03db", rx);
|
||||
else if (rx > 1000000) sprintf(buf, "%03dM", rx/1000000);
|
||||
else sprintf(buf, "%03dK", rx/1000);
|
||||
oled_write(25);
|
||||
|
@ -807,13 +807,13 @@ void testnetspeed(int mode, int y)
|
|||
setTextSize(1);
|
||||
setCursor(display_offset, y);
|
||||
oled_write(24);
|
||||
if (tx < 1000) sprintf(buf, "%03dB ", tx);
|
||||
if (tx < 1000) sprintf(buf, "%03db ", tx);
|
||||
else if (tx > 1000000) sprintf(buf, "%03dM", tx/1000000);
|
||||
else sprintf(buf, "%03dK ", tx/1000);
|
||||
print_str(buf);
|
||||
|
||||
oled_write(25);
|
||||
if (rx < 1000) sprintf(buf, "%03dB", rx);
|
||||
if (rx < 1000) sprintf(buf, "%03db", rx);
|
||||
else if (rx > 1000000) sprintf(buf, "%03dM", rx/1000000);
|
||||
else sprintf(buf, "%03dK", rx/1000);
|
||||
print_str(buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue