Serial Port communication in jPOS - create a Channel?

525 views
Skip to first unread message

AdrianLo

unread,
Nov 20, 2009, 5:27:38 AM11/20/09
to jPOS Users
Hello everyone, seniors and juniors alike :)

First, a brief intro on the situation. I'm creating a jPOS switch
between a EDC Terminal and the backend Host.
EDC Terminal runs a proprietary message type, the jPOS switch's task
is to translate it to ISO8583 and send it to the Host.
EDC Terminal connects via a RS232 cable to the switches' serial port,
hence my question.

Question is, where should I put the serial comm logic?
Please ignore the proprietary EDC message (a custom jPOS packager and
app logic will take care of it).

I'm looking at creating a new SerialPortChannel, extending from
BaseChannel itself.
The serial comms will be using the RxTx library; with this as an
example:-
http://www.captain.at/howto-java-serial-port-javax-comm-rxtx.php

Any comments on this approach?

p.s: did some homework, dug up this thread on serial ports + jPOS:-
http://osdir.com/ml/java.jpos.devel/2008-02/msg00015.html

Thank you for everyone's time, greatly appreciate it :)
Best regards,
Adrian

Didik Rawandi

unread,
Nov 26, 2009, 6:24:36 AM11/26/09
to jpos-...@googlegroups.com
i suggest you to do this(tell me if it working:D)

public class DidikRS232Channel implements SerialPortEventListener{
    SerialPort port;
    InputStream in;
    OutputStream out;
    //do connect to serial com (com1,,,,,comn)here
    public void connect(){
        port.connect....
        in=port.getInputStream();
    }
//read incoming msg
     public void serialEvent(SerialPortEvent arg0){
         ISOMsg m=new ISOMsg();
         m.setPackager(packager);
         m.unpack(in);
         //send using your tcp socket
        source.send(m);//Isosource
    }
   public void sendBackToTerminal(ISOMsg m)throws Exception{
        out.write(m.pack());
   }
}



--
You received this message because you are subscribed to the  "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users



--
Best Regards,

Didik Rawandi
354

pugazhendhi t

unread,
Nov 27, 2012, 12:15:44 AM11/27/12
to jpos-...@googlegroups.com
Hi Didik ,

 I am trying with COM interface, I need some flow ..
 if its working for u  ?


Regards
T.Pugazhendhi

chhil

unread,
Nov 27, 2012, 1:25:21 AM11/27/12
to jpos-...@googlegroups.com
Hi,

Would this serial setup be used for production?
Based on experience I have seen a serial to tcp converter (hardware)
used in setups like this and the switch see tcp clients connecting
into the switch. The POS devices connect to the modem pool and the
hardware does the translation.

Writing a standalone utility to convert serial to TCP (and TCP to
serial) should not be that difficult. I had done something like this
eons ago when testting with dialup atms. Just a suggestion.

-chhil
> --
> --
> jPOS is licensed under AGPL - free for community usage for your open-source
> project. Licenses are also available for commercial usage.
> Please support jPOS, contact: sa...@jpos.org

Didik Rawandi

unread,
Nov 28, 2012, 1:59:59 AM11/28/12
to jpos-...@googlegroups.com
Hi There,

it depends on 'your scenario', to make that code working you need to setup javax.comm api (maybe you can read my blog how to setup it)


--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage.
Please support jPOS, contact: sa...@jpos.org

You received this message because you are subscribed to the "jPOS Users" group.
Please see http://jpos.org/wiki/JPOS_Mailing_List_Readme_first
To post to this group, send email to jpos-...@googlegroups.com
To unsubscribe, send email to jpos-users+...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/jpos-users
 
 
 



--
Best Regards,

Didik Rawandi
Together we will success!

Pugazhendhi T

unread,
Nov 29, 2012, 2:37:38 AM11/29/12
to jpos-...@googlegroups.com
Hi Didik ,

Thanks for your reply.

We have Ingenico terminal, We are not able to configure Ethernet configuration in that Eg. Destination IP & port .

We tried to recieve the Data using com interfcae when any transaction is done. we used hyper terminal in windows.  its able to recieve the datas. under some Eg. COM3

My question is if i need to wrtie the ACH Simulator in jpos using COM Interface , What and all i should do ?

--------------


Regards
T.Pugazhendh.

Mark Salter

unread,
Nov 30, 2012, 2:12:57 AM11/30/12
to jpos-...@googlegroups.com
On 29/11/2012 07:37, Pugazhendhi T wrote:
> We tried to recieve the Data using com interfcae when any transaction is
> done. we used hyper terminal in windows. its able to recieve the datas.
> under some Eg. COM3

This reads like you are trying to 'discover' how to communicate with a
device.

Do you have the manuals for the device; the technical ones that:-

1. Say what is possible
2. Tell you how to do it

?

> My question is if i need to wrtie the ACH Simulator in jpos using COM
> Interface , What and all i should do ?
ACH?

You will need to get the technical documentation from Ingenico.

Please start with this, or confirm that you have it.

What Ingenico device do you have?

Why can't you use tcp/ip?


http://www.catb.org/esr/faqs/smart-questions.html

--
Mark

Pugazhendhi T

unread,
Nov 30, 2012, 4:05:28 AM11/30/12
to jpos-...@googlegroups.com
Hi

Do you have the manuals for the device?
--> No we dont have.

ACH?
--> Acquirer Host System .


What Ingenico device do you have?
---> EFT Smart 240 Series (PayPass Terminal )

Why can't you use tcp/ip?
-> Because we dont know how to configure the TCP/IP Configuration in that terminal .

Regards
T.Pugazhendhi

Mark Salter

unread,
Nov 30, 2012, 5:28:13 AM11/30/12
to jpos-...@googlegroups.com
On 30/11/2012 09:05, Pugazhendhi T wrote:
> Do you have the manuals for the device?
> --> No we dont have.
Ok, so speak to your terminal supplier or Ingenico directly first, to
get the documentation you need.

>
> ACH?
> --> Acquirer Host System .
>
Ok, thanks.

Is that your company, or are you an IHS (Issuer Host System)?

> What Ingenico device do you have?
> ---> EFT Smart 240 Series (PayPass Terminal )
Does this support tcp/ip - it looks like it does not.

>
> Why can't you use tcp/ip?
> -> Because we dont know how to configure the TCP/IP Configuration in
> that terminal .
The manual may tell you that it does not have a TCP/IP Configuration.

Please get the manual's from the vendor first and you will be much
better placed to determine what you need to do to get this devices
connected to your system.

What is it you are really trying to do?

--
Mark

Pablo Rogina

unread,
Nov 30, 2012, 8:37:54 AM11/30/12
to jpos-...@googlegroups.com
Pugazhendhi T
>
> We tried to recieve the Data using com interfcae when any transaction is
> done. we used hyper terminal in windows. its able to recieve the datas.
> under some Eg. COM3

Could this project "COM port to TCP redirector" be of help for you?

http://com0com.sourceforge.net/

Thanks.

Pablo J. Rogina
Reply all
Reply to author
Forward
0 new messages