RE: [Embedlets-dev] 1WDR?
Status: Alpha
Brought to you by:
tkosan
From: Kelly S. <be...@ea...> - 2004-08-08 23:55:53
|
Dear Bruce - Its 3:26 PM Sunday here in California, so for a quick reference (for the edification of others), then jump over this to "(1)" - Kelly Kelly wrote (on 08/07/2004 I will dig in to rxtx and see what I can find, but I'll bet that Scott Hughes could tell you in a heartbeat. I did a quick google on 'rxtx source', so I guess I will start here: http://users.frii.com/jarvi/rxtx/download.html I might not be able to get started until late Sunday afternoon. For Windoze only, right? (1) From the URL above, and from this text: RXTX full comm implementation (developmental) for jdk-1.[1-4]*. The source is available by cvs. cvs checkout -r commapi-0-0-1 rxtx-devel Date: Dec 5, 2001 Formats: rxtx-1.5-8.tar.gz (~300 k) ...it appears (SWAG) that the "significant file" for timing tweaks, is 'termios.c', from the un-zip of rxtx-1.5-8.tar.gz Also, take a look at win32termios.h Both of these files are <well documented (lots of "magic numbers" in 'win32termios.h' (mostly "undocumented"... no comments), but if you stare at them they start to make some sense (like baud rates). So, the un-zip creates a folder rxtx-1.5-8. And from there, go to \src\termios.c ...and open with your editor-weapon-of-choice (TextPad does it for me). (2) Here is a snippet of the code section in 'termios.c', that I think (I could be FOS), needs the tweaks (alright, HACKS!): #ifdef DEBUG_VERBOSE sprintf( message, "VTIME:%d, VMIN:%d\n", s_termios->c_cc[VTIME], s_termios->c_cc[VMIN] ); report( message ); #endif /* DEBUG_VERBOSE */ vtime = s_termios->c_cc[VTIME] * 100; timeouts.ReadTotalTimeoutConstant = vtime; timeouts.ReadIntervalTimeout = vtime; timeouts.ReadTotalTimeoutMultiplier = 0; timeouts.WriteTotalTimeoutConstant = vtime; timeouts.ReadTotalTimeoutMultiplier = 0; /* max between bytes */ if ( s_termios->c_cc[VMIN] > 0 && vtime > 0 ) { /* read blocks forever on VMIN chars */ } else if ( s_termios->c_cc[VMIN] == 0 && vtime == 0 ) { /* read returns immediately */ timeouts.ReadIntervalTimeout = MAXDWORD; timeouts.ReadTotalTimeoutConstant = 0; timeouts.ReadTotalTimeoutMultiplier = 0; } #ifdef DEBUG_VERBOSE sprintf( message, "ReadIntervalTimeout=%ld\n", timeouts.ReadIntervalTimeout ); report( message ); sprintf( message, "c_cc[VTIME] = %d, c_cc[VMIN] = %d\n", s_termios->c_cc[VTIME], s_termios->c_cc[VMIN] ); report( message ); sprintf( message, "ReadTotalTimeoutConstant: %ld\n", timeouts.ReadTotalTimeoutConstant ); report( message ); sprintf( message, "ReadIntervalTimeout : %ld\n", timeouts.ReadIntervalTimeout ); report( message ); sprintf( message, "ReadTotalTimeoutMultiplier: %ld\n", timeouts.ReadTotalTimeoutMultiplier ); report( message ); #endif /* DEBUG_VERBOSE */ if ( !SetCommTimeouts( index->hComm, &timeouts ) ) { YACK(); report( "SetCommTimeouts\n" ); return -1; } memcpy( index->ttyset, s_termios, sizeof( struct termios ) ); LEAVE( "tcsetattr" ); return 0; } I think you may want to turn on the DEBUG_VERBOSE compile switch 'till you get your bearings. I hope that I have NOT lead you astray with this (waste your time). (3) Also look at: BOOL init_serial_struct( struct serial_struct *sstruct ) Snip...snip... This needs to use inb() to read the actual baud_base and divisor from the UART registers. Question is how far do we take this? */ sstruct->custom_divisor = 0; sstruct->baud_base = 115200; End-snip... (4) In \srcRXTXCommDriver.java 'CandidateDeviceNames', is probably very important to you. I don't know what COMx, that you intend this for... Ref: private final String[] getValidPortPrefixes(String CandidatePortPrefixes[]) Best regards, my friend! Also, Check with Scott, at DalSemi - Kelly Smith |