Hi !
Featured games (84)
games approved by the League of Dukes
Games in Showcase (604)
Games in Android Showcase (171)
games submitted by our members
Games in WIP (653)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Talking directly to a parallel and serial port  (Read 1828 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Posted 2003-05-29 06:34:16 »

Is it possible to interface directly to the parallel or serial ports of a computer with pure java? Or do i need to switch over to C/C++ for this?

I need fairly fine control, not just sending packets of information, but flipping on/off the voltages of the pins individually (trying to communicate to a GBA in UART mode Grin )

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline kevglass

« JGO Spiffy Duke »

Medals: 272
Projects: 25
Exp: 18 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #1 - Posted 2003-05-29 07:14:01 »

This might help:

Offline William

Junior Devvie

No Exit

« Reply #2 - Posted 2003-05-29 07:23:17 »

The Java Communications API lets you do this ( Sun has implementations for Windows and Solaris and there are open source implementations for Linux and other OS's.

I'm not sure if it allows switching the pins on and off individually but I would recommend checking out the open source implementations since some of them seem to support more features than the ones from Sun. I used JCA in my last project to talk with my motion capture controller and explicitly had to set the DTR flag so it does allow some pin-level control.

The only really bad thing about the API is that it does not come with a nice installer, one has to copy the files manually into the right directories of the JRE. This wasn't a problem for me since I had complete control over my platform, but it could be a problem for products that are meant to be mass-distributed.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #3 - Posted 2003-05-29 07:30:08 »

Ooo, I hadn't seen that package before - looks promising. Smiley A quick glance over the API shows that you can write individual bytes, so I assume you can affect all the bits by constructing the bytes to send appropriatly (although my knowledge of these ports in general is very lacking, i need to hunt around for more info).

Not having a proper installer isn't really too much of a worry - its mainly just a small side project, and i doubt many people will have the hardware to be able to use it and want to use it from Java. I will probably end up doing a C++ version as well, but i figured the Java one would be easier to start with..

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline princec

« JGO Spiffy Duke »

Medals: 556
Projects: 3
Exp: 16 years

Eh? Who? What? ... Me?

« Reply #4 - Posted 2003-05-31 11:23:52 »

Orangy, that package is pretty cool, and works well. I've used it for all sorts of things in live TV so it's pretty reliable....

EXCEPT: the Win32 version is broken under Java 2's security model - it throws an NPE and breaks immediately! Yes, you read right! Agh! And I don't think they've bothered to fix it even now! But have no fear, the jar can be reverse engineered and hacked, or better still, you can swap the broken classes out with the Solaris implementation - which mysteriously has been fixed :-/

Cas Smiley

Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #5 - Posted 2003-05-31 12:06:24 »

Well I installed it, and the simple write demo compiled and everything seemed good - until I tried to actually run the damn thing. Kept giving me an empty list of avalible ports - but i stumbled across a post on the forums that explains that the install info is wrong Angry Apparently the .dll needs to sit in the \Program Files\jre\bin dir on an NT machine.

After that it seems to work ok, so they must have fixed whatever bug you bumped into Cas.

Unfortunatly i seem to have some problems with flow control. This is probably a problem with my GBA code though, information on the UART mode with the FIFO queue is minimal to say the least Cry

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

SHC (28 views)
2015-08-01 03:58:20

Jesse (20 views)
2015-07-29 04:35:27

Riven (40 views)
2015-07-27 16:38:00

Riven (21 views)
2015-07-27 15:35:20

Riven (24 views)
2015-07-27 12:26:13

Riven (15 views)
2015-07-27 12:23:39

BurntPizza (36 views)
2015-07-25 00:14:37

BurntPizza (46 views)
2015-07-24 22:06:39

BurntPizza (31 views)
2015-07-24 06:06:53

NoxInc (37 views)
2015-07-22 22:16:53
List of Learning Resources
by gouessej
2015-07-09 11:29:36

How Do I Expand My Game?
by bashfrog
2015-06-14 11:34:43

List of Learning Resources
by PocketCrafter7
2015-05-31 05:37:30

Intersection Methods
by Roquen
2015-05-29 08:19:33

List of Learning Resources
by SilverTiger
2015-05-05 10:20:32

How to: JGO Wiki
by Mac70
2015-02-17 20:56:16

2D Dynamic Lighting
by ThePixelPony
2015-01-01 20:25:42

How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!