Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 1585 times)
0 Members and 1 Guest are viewing this topic.
Offline Orangy Tang

JGO Kernel


Medals: 56
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 )

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

JGO Kernel


Medals: 164
Projects: 23
Exp: 18 years


Coder, Trainee Pixel Artist, Game Reviewer


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

This might help:

http://java.sun.com/products/javacomm/

Offline William

Junior Member




No Exit


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

The Java Communications API lets you do this (http://java.sun.com/products/javacomm/). 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: 56
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..

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

JGO Kernel


Medals: 378
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: 56
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 java.sun.com 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

[ TriangularPixels.com - 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.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Dwinin (23 views)
2014-09-12 09:08:26

Norakomi (56 views)
2014-09-10 13:57:51

TehJavaDev (69 views)
2014-09-10 06:39:09

Tekkerue (34 views)
2014-09-09 02:24:56

mitcheeb (56 views)
2014-09-08 06:06:29

BurntPizza (40 views)
2014-09-07 01:13:42

Longarmx (26 views)
2014-09-07 01:12:14

Longarmx (33 views)
2014-09-07 01:11:22

Longarmx (31 views)
2014-09-07 01:10:19

mitcheeb (39 views)
2014-09-04 23:08:59
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!