tasbihmr | 24 Feb 13:03
Picon
Favicon

using jPOS to parse messages of serial port

Dear All,
I have previously also posted about reading and writing from serial 
port. Now since I have also looked at the jPOS again very recently, I 
have a new question. How can we pass the data read from serial port in 
hexadecimal format, and parse this via jPOS? As you know, the ISO 
message has many parts, there is also the header or TPDU, and there is 
bitmap which itself has a lot of meaning and each it signifies 
something, a component for example. Can you give me a good example of 
parsing a message such as this, provided we know the length and content 
of each field ?
Thank you in advance,
tasbihmr

 
Mark Salter | 24 Feb 15:42

Re: using jPOS to parse messages of serial port

tasbihmr wrote:
> How can we pass the data read from serial port in hexadecimal format,
> and parse this via jPOS? As you know, the ISO message has many parts,
> there is also the header or TPDU, and there is bitmap which itself
> has a lot of meaning and each it signifies something, a component for
> example.
I think you are thinking at too low a level.

Let's assume you build a piece of code (Channel) for talking and 
listening to your serial connection.  This jPOS Channel will use a 
packager to interpret the bits and bytes arriving on the Channel.

The result of a call to receive is an ISOMsg, the parameter into send is 
also an ISOMsg.

Field 7 in an ISOMsg (msg) can be examined :-

	String dateTime = msg.getString(7);

And field 39 could be set thus:-

	msg.set(39,"00");

Thus the hard work (ignoring - for now - the serial port handling) is 
getting the packager to match the structure of your messages.

Do you have a technical specification of the messages you are wanting to 
send and receive that goes down the the level of each field?

Andy provided an excellent post in jpos-users (on google groups) in 
(Continue reading)


Gmane