home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2000 April / VPR0004B.BIN / DRIVER / COMPAQ / SP12255 / sp12255.exe / DMWEBC1.CAB / serial.tpl < prev    next >
Text File  |  1999-07-21  |  2KB  |  71 lines

  1. <HTML>
  2. <!-- $Id: cf_sysinfo.tmpl 2.2 1998/01/06 20:12:13 cboeker Exp $ -->
  3. <!-- Copyright (C) 1997 Compaq Computer Corporation -->
  4.  
  5. <HEAD>
  6.  
  7. <SCRIPT LANGUAGE="JavaScript">
  8. <!--
  9.  
  10. <!#tables.js>
  11. //-->
  12. </SCRIPT>
  13.  
  14. <!#PORT.JS>
  15. </HEAD>
  16.  
  17. <SCRIPT LANGUAGE="JavaScript">
  18.  
  19.     // get Serial Port info        
  20.         <!*, DMTF|Serial Ports|*, 1, PortIndex>;
  21.         <!*, DMTF|Serial Ports|*, 2, PortIOAddress>;
  22.         <!*, DMTF|Serial Ports|*, 3, PortIRQ>;
  23.         <!*, DMTF|Serial Ports|*, 4, PortName>;
  24.         <!*, DMTF|Serial Ports|*, 5, PortConnectorType>;
  25.         <!*, DMTF|Serial Ports|*, 6, PortMaxSpeed>;
  26.         <!*, DMTF|Serial Ports|*, 7, PortCapability>;
  27.  
  28.     for (i = 0; i <= PortIndex.length - 1; i++)
  29.     {
  30.           writeTableLabel(sSerialPortNum + PortIndex[i]);
  31.             writeTableHead();
  32.  
  33.         writeSingleTableRowOrBlank(sBaseIOAddress + ":", "0x" + dtoh(PortIOAddress[i]));
  34.         writeSingleTableRowOrBlank(sIRQ + ":", PortIRQ[i]);
  35.         writeSingleTableRowOrBlank(sName + ":", PortName[i]);
  36.         writeSingleTableRowOrBlank(sConnectorType + ":", PortConnectorType[i]);
  37.         writeSingleTableRowOrBlank(sMaximumSpeed + ":", PortMaxSpeed[i] + " bps");
  38.         writeSingleTableRowOrBlank(sCapability + ":", PortCapability[i]);
  39.  
  40.             writeTableTail(); 
  41.             document.write("<BR>");
  42.  
  43.         // Insert blank line between each port
  44.           if (i < PortIndex.length-1)
  45.         {
  46.                 writeTableTail(); 
  47.                 document.write("<BR>");
  48.         }
  49.         }
  50.  
  51. // Function to convert from decimal to hex -- copy from JavaScript book    
  52. function htod(n)
  53. {
  54.     return parseInt(n, 16);
  55. }
  56.  
  57. // Function to convert from decimal to hex -- copy from JavaScript book    
  58. function dtoh(n)
  59. {
  60.     var hd = "0123456789ABCDEF";
  61.     n = parseInt(n);
  62.  
  63.     if (n < 16)
  64.         return (hd.charAt(n));
  65.     else
  66.         return (dtoh(n /16) + hd.charAt(parseInt(n%16)));
  67. }           
  68.  
  69. </SCRIPT>
  70. </HTML>
  71.