Iso8583 - ISO 8583 C Library Unpack Message - Stack Overflow
Iso8583 - ISO 8583 C Library Unpack Message - Stack Overflow
Iso8583 - ISO 8583 C Library Unpack Message - Stack Overflow
I want to know how I can unpack an ISO 8583 message using DL ISO-8583 Library (C
Language) written by oscarsanderson?
1 For example, if I have such message: Here's my code
#include "dl_iso8583.h"
#include "dl_iso8583_defs_1993.h"
#include "dl_output.h" // for 'DL_OUTPUT_Hex'
#define ISOHEADER 4
#define ISOHEADERSTR "%04d"
// Unpack message
DL_ISO8583_MSG_Init(NULL,0,&isoMsg);
(void)DL_ISO8583_MSG_Unpack(&isoHandler,msg,strlen(msg),&isoMsg);
DL_ISO8583_MSG_Dump(stdout,NULL,&isoHandler,&isoMsg);
DL_ISO8583_MSG_Free(&isoMsg);
return 0;
[000]: 210
[003]: 380000
[004]: 000000000000
[007]: 0420050805
[011]: 011392
[012]: 120805
[013]: 0420
[015]: 0422
[018]: 5132
https://stackoverflow.com/questions/25242055/iso-8583-c-library-unpack-message 1/3
19/12/2022 17:26 iso8583 - ISO 8583 c library unpack message - Stack Overflow
[039]: 00
[049]: 000
c iso8583
Share Improve this question edited Aug 15, 2014 at 21:35 asked Aug 11, 2014 at 11:21
2 What have you tried so far? How did it work? How didn't it work? Is there something specific that you
get stuck on? I also recommend you read the help pages and the Stack Overflow question checklist. You
might also want to learn how to create a Minimal, Complete, and Verifiable example.
– Some programmer dude Aug 11, 2014 at 11:28
1 I might have formatted msg incorrectly. – Mike Sherrill 'Cat Recall' Aug 11, 2014 at 11:45
1 Your char msg[] is not a valid ISO8583 message. I think you meant char msg[] = "\x02\x10\x03" ...
. And don't use strlen , this is not a string. – M.M Dec 17, 2014 at 20:27
1 You are right Matt McNabb my message was not right but the problem i have is how to send \00 in a
socket because once i write "\x02\x00\x03" and i send through the socket i am receiving \5c00 instead
of \00.any idea? i am using m2m switch from morocco – knk Feb 10, 2015 at 13:42
Sorted by:
2 Answers
Highest score (default)
you must convert your msg from hex format to binary. like this
2 binMsg[0]=0x02
binMsg[1]=0x10
binMsg[2]=0x32
binMsg[3]=0x3A
binMsg[4]=0x40
and use :
(void)DL_ISO8583_MSG_Unpack(&isoHandler,binMsg,strlen(msg)/2,&isoMsg);
Share Improve this answer Follow answered Feb 14, 2016 at 15:19
che.moor
39 4
https://stackoverflow.com/questions/25242055/iso-8583-c-library-unpack-message 2/3
19/12/2022 17:26 iso8583 - ISO 8583 c library unpack message - Stack Overflow
To my knowledge DL iso 8583 library written by oscarsanderson does not work with
hexadecimal bitmap.So first you need to convert hexadecimal bitmap to binary then you need
1 to know the properties of iso structure fields(i.e element type
(numeric,binary,alphanumeric,ascii etc),length,length type(fixed length or variable
length)).After knowing this you can retrieve the fields
Share Improve this answer Follow answered Dec 17, 2014 at 19:13
Saurabh Daga
11 1
https://stackoverflow.com/questions/25242055/iso-8583-c-library-unpack-message 3/3