Unimodem Diagnostics, (c) 2000-2002 Stanislav V. Mekhanoshin

What's this
-----------

This program is used to decode the diagnostics of modem supporting the AT#UD
command. Decoding is made according to:

Unimodem Diagnostics Command Reference Specification
Microsoft Corporation
Version 1.0
2 July, 1998

System Requirements
-------------------

There three different builds provided:

1. #udd2.exe - dual-exe for DOS & OS/2 16-bit. Works with the following
operating systems:

DOS             - as DOS application
W9x             - as DOS application
OS/2            - as OS2 application
WNT/W2K         - as OS2 application

2. #uddw.exe - dual-exe for DOS 16-bit & WIN32 Console. Works with the
following operating systems:

DOS             - as DOS application
W9x/WNT/W2k     - as Windows console application

3. #udw.exe - WIN32 GUI. Works with the following operating systems:

W9x/WNT/W2k     - as Windows GUI application

This version also requires comctl32.dll version 4.70 or higher (Internet
Explorer 3.0 or later).

This version is also a COM-server to decode the statistics.

License Agreement
-----------------

This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc.,
675 Mass Ave, Cambridge, MA 02139, USA.

Usage
-----

#ud [+prefix | -prefix string | -noprefix]
    [-clipview | -noclipview]
    [<stream | file]

Stream - #ud works only with piped standard input. That's because I don't
believe somebody will type statistics from TTY. The method of piping can be any
supported by Your shell (not only with '<'). For example You could use the
following command:

  type diag.txt|#ud

Windows GUI version doesn't work with stdin since there is no stdin there.

File - get statistics from file if specified.

Win32 versions can also process system clipboard if neither stdin (for
console) is redirected nor file is specified.

Windows GUI version is also able to load statistic files at any time after
loading or reanalyze clipboard. Statistic files can be opened from menu or
with drag-n-drop. To read the clipboard use either menu , F5 key or just paste
the statistics to the #udw window from clipboard.

Prefix - prefix which will be printed before any line. That can be useful, for
example, when redirecting the output of program to the mailer log file for
identification purposes. That's optional parameter.

Prefix `DIAG' for example can be specified as +DIAG or as -prefix DIAG.

Qualifier -noprefix is used to suppress the default prefix if specified in
ini-file (#udw only).

Qualifiers -clipview and -noclipview respectively used to set #udw as clipboard
viewer. The last one suppresses the default value from ini-file.

What is clipboard viewer? That's not too complicated -- program will
automatically catch the clipboard changes and reanalyze statistics. You can
enable this mode either with key -clipview, from menu, with F3 key or by
clicking on the status bar pane, indicating its state.

Ini-file with default values should reside in the same directory as #udw.exe
(this ini only supported by the Win32/GUI version) and should has the same
name as executable. I.e. #udw.ini. For example:

============ #udw.ini =============
[default]
ClipboardViewer=1
OpenFileName=c:\temp\stat.log
Prefix=DIAG
============== end ================

This will set default values:

-clipview -prefix DIAG c:\temp\stat.log

#udw will never create ini-file by itself and doesn't require it.


#ud reads data from the input stream until will find the string like

  DIAG <2A4D3263 ...>

Then it will read and analyze for unimodem diagnostic strings the stream until
the end or the first "OK" string.

One can also use #ud with lnterm (line terminal) utility which has an ability
to redirect its stdin/stdout. For example you can use following command:

  echo AT#UD|lnterm|#ud>stat.log

I'm personally using BinkleyTerm and collects the statistics with the special
cmd-file after session. Statistics is appended to the mailer log file. I'll
show this cmd-file as an example. Note that I'm using 4NT -- not the standard
cmd.exe from NT:

-------------------------------- mdm_stat.cmd --------------------------------
@echo off
echo writing Binkley.log...
echo AT#UD|c:\mail\lnterm com:1 baud:115200 rx-timeout:20|c:\mail\#ud "++ %@replace[ ,0,%@format[2,%_day]] %@word[%@dec[%_month],Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec] %_time.00 DIAG">>c:\mail\log\Binkley.Log
------------------------------------ eof -------------------------------------

This will append to the Binkley.log something like this:

--------------------------------- Binkley.log --------------------------------
+ 17 Jun 15:03:15.00 DIAG Unimodem Diagnostics/W32, version 1.0.1.0, compiled at Jun 17 2000 14:31:05
+ 17 Jun 15:03:15.00 DIAG (c) 2000 Stanislav V. Mekhanoshin (rampitec@tu.spb.ru, 2:5030/172.9@fidonet)
+ 17 Jun 15:03:15.00 DIAG ----------------------------------------------------------------------------
+ 17 Jun 15:03:15.00 DIAG Diag Command Specification rev.: 1.0
+ 17 Jun 15:03:15.00 DIAG Call Setup Result code         : Data Answering signal detected
+ 17 Jun 15:03:15.00 DIAG Multi-media mode               : Data Only
+ 17 Jun 15:03:15.00 DIAG DTE-DCE interface mode         : Async data
+ 17 Jun 15:03:15.00 DIAG TX/RX signal power level, -dBm : 14/25
+ 17 Jun 15:03:15.00 DIAG Estimated noise level, -dBm    : 26
+ 17 Jun 15:03:15.00 DIAG TX/RX Negotiation              : V.34/V.34
+ 17 Jun 15:03:15.00 DIAG TX/RX Symbol Rate              : 3429/3429
+ 17 Jun 15:03:15.00 DIAG TX/RX Carrier frequency, Hz    : 1959/1959
+ 17 Jun 15:03:15.00 DIAG TX data rate (Last/Init)       : 28800/26400
+ 17 Jun 15:03:15.00 DIAG RX data rate (Last/Init)       : 19200/28800
+ 17 Jun 15:03:15.00 DIAG Temporary carrier loss count   : 0
+ 17 Jun 15:03:15.00 DIAG Carrier Rate Re-neg count      : 28
+ 17 Jun 15:03:15.00 DIAG Retrains Requested/Granted     : 1/0
+ 17 Jun 15:03:15.00 DIAG Protocol/Compression           : V.42 LAPM/V.42bis
+ 17 Jun 15:03:15.00 DIAG Error control frame size, bytes: 128
+ 17 Jun 15:03:15.00 DIAG Error control timeouts in TX   : 0
+ 17 Jun 15:03:15.00 DIAG Error control NAKs received    : 0
+ 17 Jun 15:03:15.00 DIAG TX/RX flow control             : V.24 ckt 106/133 / V.24 ckt 106/133
+ 17 Jun 15:03:15.00 DIAG TX/RX chars sent               : 588/110029
+ 17 Jun 15:03:15.00 DIAG TX/RX chars lost (data overrun): 0/0
+ 17 Jun 15:03:15.00 DIAG TX/RX I-Frame count            : 36/1922
+ 17 Jun 15:03:15.00 DIAG TX/RX I-Frame error count      : 0/37
+ 17 Jun 15:03:15.00 DIAG Termination Cause              : Disconnect Frame Received
------------------------------------ eof -------------------------------------

COM-server usage
----------------

You can use udw.exe as a COM-server. You have to  register  the  program
first do do this. Please run `udw.exe  /RegServer'  or  instw32.bat.  To
uninstall the registration later please run `udw.exe /UnregServer'.

There are samples how to use the server on VBScript, JavaScript  (inside
html) and C++. They are located in devel/sample directory. In the  devel
directory there are files needed to build the C/C++ code.

For C/C++ include the files udw_i.c and  udw.h.  You  have  to  use  the
IUDDiag interface which has to properties:

 BSTR UDDiag(BSTR Response) - used to decode the #UD statistics.

 BSTR Prefix                - hold the prefix to  use  before  the  each
                              diagnostics line (same as the command line
                              switch prefix).

Acknowledgments
---------------

 - Vitaly Ponomarev for the specification of unimodem diagnostics format.

 - Yuri V. Bondarenko for the informational support and testing.


How to reach the author
-----------------------

mail-to: rampitec@tu.spb.ru
FIDO:    2:5030/172.9@fidonet.org
web:     http://www.geocities.com/rampitec/
