From owner-freebsd-net@FreeBSD.ORG Thu Feb 2 08:34:11 2012 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 323E0106564A for ; Thu, 2 Feb 2012 08:34:11 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms16-1.1blu.de (ms16-1.1blu.de [89.202.0.34]) by mx1.freebsd.org (Postfix) with ESMTP id B22218FC1A for ; Thu, 2 Feb 2012 08:34:10 +0000 (UTC) Received: from [89.204.137.128] (helo=tiny.Sisis.de) by ms16-1.1blu.de with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1Rss7K-0004Nr-Fn; Thu, 02 Feb 2012 09:34:07 +0100 Received: from tiny.Sisis.de (localhost [127.0.0.1]) by tiny.Sisis.de (8.14.5/8.14.3) with ESMTP id q128YlM2001187; Thu, 2 Feb 2012 09:34:49 +0100 (CET) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by tiny.Sisis.de (8.14.5/8.14.3/Submit) id q128YilJ001186; Thu, 2 Feb 2012 09:34:44 +0100 (CET) (envelope-from guru@unixarea.de) X-Authentication-Warning: tiny.Sisis.de: guru set sender to guru@unixarea.de using -f Date: Thu, 2 Feb 2012 09:34:44 +0100 From: Matthias Apitz To: Milan Obuch , freebsd-net@freebsd.org, edwin@mavetju.org Message-ID: <20120202083441.GA1171@tiny> References: <20120130110919.GA1249@tiny> <20120131094413.GA1306@tiny> <20120131110100.0da8b89e@atom.dino.sk> <20120131101930.GA1371@tiny> <20120131115348.0748df3a@atom.dino.sk> <20120131124347.GA1493@tiny> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="RnlQjJ0d97Da+TV1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20120131124347.GA1493@tiny> X-Operating-System: FreeBSD 10.0-CURRENT r226986 (i386) User-Agent: Mutt/1.5.21 (2010-09-15) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 89.204.137.128 Cc: Subject: Re: ports/net/e169-stats (was: UMTS Huawei monitor) X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Matthias Apitz List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Feb 2012 08:34:11 -0000 --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 - 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--