Date: Thu, 2 Feb 2012 09:34:44 +0100 From: Matthias Apitz <guru@unixarea.de> To: Milan Obuch <freebsd-net@dino.sk>, freebsd-net@freebsd.org, edwin@mavetju.org Subject: Re: ports/net/e169-stats (was: UMTS Huawei monitor) Message-ID: <20120202083441.GA1171@tiny> In-Reply-To: <20120131124347.GA1493@tiny> References: <20120130110919.GA1249@tiny> <20120131094413.GA1306@tiny> <20120131110100.0da8b89e@atom.dino.sk> <20120131101930.GA1371@tiny> <20120131115348.0748df3a@atom.dino.sk> <20120131124347.GA1493@tiny>
next in thread | previous in thread | raw e-mail | index | archive | help
--RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit El día Tuesday, January 31, 2012 a las 01:43:47PM +0100, Matthias Apitz escribió: > At the end I decided to understand the source code. Btw: the device port > /dev/cuaU0.n is hardcoded set to .2, while mine is .3 for the E1750; Hello, While digging into the source, I saw that I was wrong saying that; only the default is hardcoded set to .2 and if one provides an argument on the cmd line, this is used; don't know how I have overlooked that; Edwin, please accept my honestly sorry for this; I did some minor cosmetic changes (attached) for your consideration; in any case, now I have it clear why in some place where I sit reading with my netbook, the bandwidth and speed is so poor: the RSSI value there is only 2-3 in that place; it is a relatively new building with a lot of steel and concrete; the distance from the table to the windows is around 5-6 meters; when I move to the window the RSSI value is ~14, outside as well; in short words: your tool, Edwin, helped me a lot to get a clear picture of my problem; thanks! matthias -- Matthias Apitz e <guru@unixarea.de> - w http://www.unixarea.de/ UNIX since V7 on PDP-11, UNIX on mainframe since ESER 1055 (IBM /370) UNIX on x86 since SVR4.2 UnixWare 2.1.2, FreeBSD since 2.2.5 --RnlQjJ0d97Da+TV1 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=diff *** e169-stats.c.orig 2011-03-08 07:47:40.000000000 +0100 --- e169-stats.c 2012-01-31 22:14:32.000000000 +0100 *************** *** 120,126 **** v3 /= 1000; } ! mvwprintw(screen, Y - 1 - (v2 * yscale) / v1, 0, "%u%cB", v3, prefix); return (v1); } --- 120,128 ---- v3 /= 1000; } ! wattrset(screen, colour[scbar[0].sb_mode]); ! mvwprintw(screen, Y - 1 - (v2 * yscale) / v1, 0, "%u%cbps", v3*8, prefix); ! wattrset(screen, colour[1]); return (v1); } *************** *** 153,160 **** bytestosomething(rxtotal, srxtotal, sizeof(srxtotal)); bytestosomething(txtotal, stxtotal, sizeof(stxtotal)); ! bytestosomething(rxnow, srxnow, sizeof(srxnow)); ! bytestosomething(txnow, stxnow, sizeof(stxnow)); int X = getmaxx(screen); int Y = getmaxy(screen); --- 155,164 ---- bytestosomething(rxtotal, srxtotal, sizeof(srxtotal)); bytestosomething(txtotal, stxtotal, sizeof(stxtotal)); ! // bytestosomething(rxnow, srxnow, sizeof(srxnow)); ! // bytestosomething(txnow, stxnow, sizeof(stxnow)); ! snprintf(srxnow, sizeof(srxnow), "%1.03f Mbps", (double)rxnow*8/1024/1024); ! snprintf(stxnow, sizeof(stxnow), "%1.03f Mbps", (double)txnow*8/1024/1024); int X = getmaxx(screen); int Y = getmaxy(screen); *************** *** 176,183 **** mvwprintw(screen, 3, 0, "RSSI: %d dBm (%d)", 2 * scbar[0].sb_ssi - 113, scbar[0].sb_ssi); mvwprintw(screen, 4, 0, "Total: %s / %s", stxtotal, srxtotal); mvwprintw(screen, 5, 0, "Now: %s / %s", stxnow, srxnow); ! // mvwprintw(screen, 6, 0, "Last: %d / %d", scbar[0].sb_tx, scbar[0].sb_rx); int i; for (i = -9; i <= 0; i++) { --- 180,189 ---- mvwprintw(screen, 3, 0, "RSSI: %d dBm (%d)", 2 * scbar[0].sb_ssi - 113, scbar[0].sb_ssi); mvwprintw(screen, 4, 0, "Total: %s / %s", stxtotal, srxtotal); + wattrset(screen, colour[scbar[0].sb_mode]); mvwprintw(screen, 5, 0, "Now: %s / %s", stxnow, srxnow); ! wattrset(screen, colour[1]); ! // mvwprintw(screen, 6, 0, "Last: %d / %d", scbar[1].sb_tx, scbar[1].sb_rx); int i; for (i = -9; i <= 0; i++) { *************** *** 216,230 **** mvwaddch(screen, Y - 1 - (ssi / LENGTH(c)), X - i, colour[scbar[i].sb_mode] | c[ssi % LENGTH(c)]); } if (scbar[i].sb_tx > 0) { mvwaddch(screen, Y - 1 - (scbar[i].sb_tx * yscale) / vol, X - i, colour[scbar[i].sb_mode] | '^'); } if (scbar[i].sb_rx > 0) { mvwaddch(screen, Y - 1 - (scbar[i].sb_rx * yscale) / vol, ! X - i, colour[scbar[i].sb_mode] | 'v'); } if (scbar[i].sb_rx == 0 && scbar[i].sb_tx == 0) { mvwaddch(screen, Y - 1, --- 222,244 ---- mvwaddch(screen, Y - 1 - (ssi / LENGTH(c)), X - i, colour[scbar[i].sb_mode] | c[ssi % LENGTH(c)]); } + int y1, y2; + int v; if (scbar[i].sb_tx > 0) { + y1 = Y - 1 - (scbar[i].sb_tx * yscale) / vol; mvwaddch(screen, Y - 1 - (scbar[i].sb_tx * yscale) / vol, X - i, colour[scbar[i].sb_mode] | '^'); } if (scbar[i].sb_rx > 0) { + y2 = Y - 1 - (scbar[i].sb_rx * yscale) / vol; + v = 'v'; + /* 'v' and '^' don't fit into same place + * if so we use 'x' */ + if (y1 == y2) v = 'x'; mvwaddch(screen, Y - 1 - (scbar[i].sb_rx * yscale) / vol, ! X - i, colour[scbar[i].sb_mode] | v); } if (scbar[i].sb_rx == 0 && scbar[i].sb_tx == 0) { mvwaddch(screen, Y - 1, *************** *** 282,288 **** int i; fd_set fdset; int empty = 0; ! const char *dev = "/dev/cuaU0.2"; struct timeval timeout; int isfile; --- 296,302 ---- int i; fd_set fdset; int empty = 0; ! const char *dev = "/dev/cuaU0.3"; struct timeval timeout; int isfile; --RnlQjJ0d97Da+TV1--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120202083441.GA1171>