home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.comp.os.windows-xp      Actually wasn't too bad for a M$-OS      17,273 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 16,610 of 17,273   
   R.Wieser to All   
   How to get all possible baudrates for a    
   05 Oct 23 10:11:28   
   
   From: address@is.invalid   
      
   Hello all,   
      
   I'm trying to figure out wat the allowable baudrates are for my serial   
   ports: one build-in RS232, one CP2102 USB-to-serial.   
      
   The problem is that none of places I've been looking gives me the full   
   scope.  Worse, two of them give me nonsense.   
      
   1) When going thru the "device manager" and looking at the "Port settings" I   
   get, for both seral ports, the same "Bits per second" dropdown list, from 75   
   to 128K.   
      
   The thing is that the RS232 port doesn't want to accept 128K, and the CP2120   
   doesn't do anything below 300.  Also, the latter has 8 baudrates above 128K,   
   which are not shown.   
      
   Also, for some reason the "Data bits" dropdown shows "4" as possibility,   
   which I've never seen mentioned anywhere.   
      
   2) When I (in a program) call the Kernel32.dll "CommConfigDialog" the "COM1"   
   RS232 port doesn't show 128k, but does show three speeds above it.  Neither   
   128K nor the three other speeds are accepted.   
      
   3) When I (in a program) call the kernel32.dll "GetCommProperties" I only   
   get baudrates upto 128K (as marked by their bitflags in the COMMPROP   
   structure), meaning that I do not get the eight baudrates above 128K which   
   CP1202 supports.   
      
   tl;dr:   
      
   I have three sources by which I can ask the OS about the capabilities of a   
   serial port, and none of them agrees with the other.  And the one   
   non-interactive method (GetCommProperties) only returns a subset of the   
   available baudrates.   
      
   My question:   
      
   How do I (programmatically) retrieve all the baudrates for a serial port   
   (native, USB or otherwise) ?   
      
   Regards,   
   Rudy Wieser   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca