开云体育

Locked Re: Serial port too slow? Can anything work.


 

This is great!

We've been hacking around in some quite complicated code trying to fix this. It's only (so far) a problem on Windows, and I've be very happy to add the JNI code to call that function.

Would you be willing to compile it and send me a library? I don't have any build tools on my test windows machine. Or perhaps somebody else could do that?

Thanks!

Bob

--- In jmriusers@y..., "greggeeca" <ggee@g...> wrote:
Well, I installed JMRI on my 1 year old laptop and it says that my
COM port can only be set to 9600. I don't understand the reasons
why. Anyway, if this is true for JMRI, what about other loconet
apps?
Will any software work on my laptop, such as pr1dos, ... with an
MS100 or PR-1?

If I get a Locobuffer, will that work either?

Thanks,
Greg
The problem is that the javacomm package uses the serial driver's
list of valid baud rates which doesn't include 16457. You can get
around this under windows (don't know about unix) by getting hold
of the handle used to open the com port and then using jni to call a
C function to set the baudrate to 16457. Use something like:

DCB dcb;

FillMemory(&dcb, sizeof(dcb), 0);
if (!GetCommState(hComm, &dcb)) // get current DCB
// Error in GetCommState
return FALSE;

// Update DCB rate.
dcb.BaudRate = 16457;

// Set new state.
if (!SetCommState(hComm, &dcb))
// Error in SetCommState.
--
--------------
Bob Jacobsen (Bob_Jacobsen@..., 510-486-7355, fax 510-495-2957)

Join [email protected] to automatically receive all group messages.