I want to connect magnetic card reader, send commands and get responses with Java (COM Port) in Windows XP. I have .h file & dll. I want use dll functions. How can I connect or send device?
-
possible duplicate of java api to send file through serial porttrashgod– trashgod2011-06-01 05:22:01 +00:00Commented Jun 1, 2011 at 5:22
-
@trashgod, I want send command and RECEIVE responses, not send filetotali– totali2011-06-01 05:34:00 +00:00Commented Jun 1, 2011 at 5:34
-
@trashgod, but the DLL probably has high level functions specific for his reader which he would be missing in those libraries.Eelke– Eelke2011-06-01 05:40:34 +00:00Commented Jun 1, 2011 at 5:40
-
Ah, I see; now it makes sense.trashgod– trashgod2011-06-01 05:44:54 +00:00Commented Jun 1, 2011 at 5:44
Add a comment
|
2 Answers
You will need to use JNI (Java Native Interface), google it for details. You probably will have to write some wrappers around the DLL in C first before JNI can use it.
3 Comments
totali
+1. Can I solve my problem with Java APIs (Javax.comm or RXTX, not using JNI or write some code in C)?
Eelke
@totali: using JNA as trashgod suggest in his answer shouldn't require any C but I have no experience with it. If you know the full serial protocol you can use any serial java communication library, see trashgods earlier comments.