[Rxtx] getPortIdentifiers(); returning null enumertion
Ed
eddythejekyll at gmail.com
Mon Aug 14 20:25:42 MDT 2006
Ah, I see. I've seen the caveats about limited Parallel support, but I
thought it was mainly about the javax.comm package. The gnu.io is derived
from javax.comm package right? That is, is the parallel support in rxtx is a
superset of what's in javax.comm?
I'm using this not for hobby usage, but for some simple instrumenation and
control. If the project mandates it, I'll gladly work on extending the
support. In the meantime, I need to get some sanity checks working, and
repair my relay board (I smoked the ULN2803 chip, apparently by tying the
BUSY (pin 11) to vcc). I guess I'll try the SEL pin next (and a supply of
2803s) with a ~1K pullup.
The caveat in the comment block isn't very encouraging (!), but I borrowed
an old Epson Stylus Color 600 printer to see what I can do. If I can write
out characters to it I'll be happy. Parallel printers aren't easy to find
these days.
I haven't yet looked at the native source, yet, but I've just imported it
into eclipse and I'll surf around a bit.
Ed
On 8/14/06, Trent Jarvi <tjarvi at qbang.org> wrote:
>
> On Mon, 14 Aug 2006, Ed wrote:
>
> > When I try to get the mode with int mode = pPort.getMode(); it returns 0
> > which isn't any of the valid modes. I tried setting it explicitely with
> > pPort.setMode(ParallelPort.LPT_MODE_XXX );and all failed with
> >
> > gnu.io.UnsupportedCommOperationException: setLPRMode was unable to
> proced
> > the requested mode in nativeSetSerialPortParams
> > at gnu.io.LPRPort.setLPRMode(Native Method)
> > at gnu.io.LPRPort.setMode(LPRPort.java:87)
> >
> > Except for LPT_MODE_ANY, but the getMode call still failed out with an
> > invalid state.
>
> This is because rxtx only supports the basics.
>
> JNIEXPORT jboolean JNICALL LPRPort(setLPRMode)(JNIEnv *env,
> jclass jclazz, jint mode)
> {
> switch(mode)
> {
> case LPT_MODE_ANY:
> break;
> case LPT_MODE_SPP:
> case LPT_MODE_PS2:
> case LPT_MODE_EPP:
> case LPT_MODE_ECP:
> case LPT_MODE_NIBBLE:
> default:
> throw_java_exception( env,
> UNSUPPORTED_COMM_OPERATION,
> "nativeSetSerialPortParams",
> "setLPRMode was unable to proced the
> requested \
> mode"
> );
> }
> return(JNI_TRUE);
> }
>
> One could program in more support. When I did that I just had a daisy
> wheel printer to test with and doing any more would have been blind.
>
> So that behavior is expected. I'll look to see if the Parallel Complete
> book mentions which pins you need to raise. If you look in the source
> code [ParallelImp.c] you can see this code isn't well tested. It has
> worked for hobby use in the past as I'd guess you are trying to do. But
> my experience with the code is as is mentioned in the top of the source:
>
> /*
> fear he who enter here. It appears that things have changed. An
> attempt
> has been made to put things the way the should be.
>
> It compiles and ParallelBlackBox runs. No further guarantees.
>
> Well... One.. it will print "Hello World!" on an epson DX 10
> printer.
> you know.. the 10 character per second daisy wheel printer ;)
>
> - Trent Jarvi
> */
>
> That comment is from 1997 or so.
>
> Since then some windows support was contributed but it is still very green
> code. We get about four requests for parallel support a year so its just
> not a well traveled area.
>
> It would be nice to have some documentation for the people trying to hook
> parallel ports to electronic projects. That appears to be the exclusive
> use of the Parallel support. The wiki pages are intended to let people
> share information like this to help each other in their projects as they
> figure out the details.
>
> --
> Trent Jarvi
> tjarvi at qbang.org
>
--
Ed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qbang.org/pipermail/rxtx/attachments/20060814/fbb5ddb4/attachment-1085.htm>
More information about the Rxtx
mailing list