Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. iso_8583 message

iso_8583 message

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
12 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Marco Bertschi

    There is only one reference page which is reliable when it is about ISO, and this is ISO.org. Have a look at the standard as it is scripted there[^] and you will find the answer by yourself.

    cheers Marco Bertschi


    Software Developer Twitter | Facebook | Articles


    You have absolutely no idea how glad I am that I have no idea at all. - OriginalGriff

    K Offline
    K Offline
    khushboo gupta
    wrote on last edited by
    #3

    I have sent the packet through tcp socket. when i was analyzing the packet through wireshark i was getting the packet in the server side like below : 2E 60 01 23 06 08 20 20 01 c0 00 .5 .#.... ..... 92 12 01 23 48 30 30 30 30 30 30 ...#H000009 39 53 31 30 30 30 30 30 30 30 30 30 30 30 30 35 9S10000000000005 while my actual packet is 00 2E 60 01 23 06 00 08 00 20 20 01 00 00 c0 00 .5 .#.... ..... 00 92 00 00 00 00 12 01 23 48 30 30 30 30 30 30 ........#H000009 39 53 31 30 30 30 30 30 30 30 30 30 30 30 30 35 9S10000000000005 Why all 00 bytes are not getting sent..Can anybody tell me. Please Help !!!!!

    M 1 Reply Last reply
    0
    • M Marco Bertschi

      There is only one reference page which is reliable when it is about ISO, and this is ISO.org. Have a look at the standard as it is scripted there[^] and you will find the answer by yourself.

      cheers Marco Bertschi


      Software Developer Twitter | Facebook | Articles


      You have absolutely no idea how glad I am that I have no idea at all. - OriginalGriff

      K Offline
      K Offline
      khushboo gupta
      wrote on last edited by
      #4

      The code which i am Using for creating the Packet is

      #include
      #include
      #include
      #include
      #include
      #include

      char cHexDigit_to_Nibble1(unsigned char c)
      {

      //if((!isxdigit(c)) || (c != 0x3D))
      
      if(!isxdigit(c))
      
      	return (0);
      
      if(isdigit(c))
      
      	return (c - '0');
      
      c = toupper(c);
      
      // adjust hexadecimal 'A' to 0x0A
      
      return (c - 55);
      

      }

      void vAscii2BCD(unsigned char *pucSrc, unsigned char *pucDst, int inSize)
      {

      for (; inSize > 0; inSize -= 2, pucDst++) 
      {
      
      	if(!memcmp(pucSrc, "3D", 2))
      	{
      
      		pucSrc += 2;
      
      		\*pucDst = '=';
      
      	}
      
      	else
      	{
      
      		\*pucDst = cHexDigit\_to\_Nibble1(\*pucSrc++) << 4;
      
      
      		\*pucDst |= cHexDigit\_to\_Nibble1(\*pucSrc++);
      
      		
      	}
      	
      }
      
      printf("data is %s\\n\\n",pucDst);
      

      }

      int main()
      {
      int sock_desc, status;
      struct sockaddr_in client;
      struct addrinfo hints;
      WSADATA Data;

      int bytesSent;
      int bytesRecv = SOCKET\_ERROR;
      //char sendbuf\[32\] = "Client: Sending data.";
      //char sendbuf\[\] = "002F600123060008002020010000c0000092000000001201234830303030303039533130303030303030303030303035";
      //char sendbuf\[\] = "002F600123060008002020010000c000009200000000120123H0000009S10000000000005";
      //char sendbuf\[\] = "0111011110000000010000110110100000110010010101110111000000110010100000001001011000010011011101000101010101110011000010001000000000000000000101000110000000000000000000011000000100110101H0000009S10000000000005";
      char recvbuf\[256\] = "";
      
      
      
      unsigned char \*pucSrc  = (unsigned char\*) malloc (100) ;
      unsigned char \*pucDst  = (unsigned char\*) malloc (256) ;
      //unsigned char \*Output\_Buff = (unsigned char\*) malloc (20) ;
      int inSize = 12 ;
      
      
      //memset(Output\_Buff,0,20) ;
      memset(pucSrc,0,256);
      
      memset(pucDst,0,256);
      vAscii2BCD((unsigned char\*)"00" ,pucDst, 1) ;//
      strcpy((char\*)pucSrc,(char\*)pucDst) ;
      
      
      memset(pucDst,0,256);
      vAscii2BCD((unsigned char\*)"2E" ,pucDst, 1) ;//
      //vAscii2BCD((unsigned char\*)"002E" ,pucDst, 4) ;//
      strcat((char\*)pucSrc,(char\*)pucDst) ;
      
      
      memset(pucDst,0,256);
      //vAscii2BCD((unsigned char\*)"60012306  " ,pucDst, 12) ;//
      vAscii2BCD((unsigned char\*)"6001230600" ,pucDst, 5) ;//
      strcat((char\*)pucSrc,(char\*)pucDst) ;
      
      memset(pucDst,0,256);
      //vAscii2BCD((unsigned char\*)" 8 " ,pucDst, 4) ;//48564848
      vAscii2BCD((unsigned char\*)"0800" ,pucDst, 2) ;//48564848
      strcat((char\*)pucSrc,(char\*)pucDst);
      
      
      memset(pucDst,0,256);
      //vAscii2BCD((unsigned char\*)"2020010000C0
      
      L 1 Reply Last reply
      0
      • K khushboo gupta

        I have sent the packet through tcp socket. when i was analyzing the packet through wireshark i was getting the packet in the server side like below : 2E 60 01 23 06 08 20 20 01 c0 00 .5 .#.... ..... 92 12 01 23 48 30 30 30 30 30 30 ...#H000009 39 53 31 30 30 30 30 30 30 30 30 30 30 30 30 35 9S10000000000005 while my actual packet is 00 2E 60 01 23 06 00 08 00 20 20 01 00 00 c0 00 .5 .#.... ..... 00 92 00 00 00 00 12 01 23 48 30 30 30 30 30 30 ........#H000009 39 53 31 30 30 30 30 30 30 30 30 30 30 30 30 35 9S10000000000005 Why all 00 bytes are not getting sent..Can anybody tell me. Please Help !!!!!

        M Offline
        M Offline
        Marco Bertschi
        wrote on last edited by
        #5

        Once again, read the ISO standard carefully, it is explained nicely there. And you might want to learn about sockets, or post the problem with the socket separately.

        cheers Marco Bertschi


        Software Developer Twitter | Facebook | Articles


        You have absolutely no idea how glad I am that I have no idea at all. - OriginalGriff

        1 Reply Last reply
        0
        • K khushboo gupta

          The code which i am Using for creating the Packet is

          #include
          #include
          #include
          #include
          #include
          #include

          char cHexDigit_to_Nibble1(unsigned char c)
          {

          //if((!isxdigit(c)) || (c != 0x3D))
          
          if(!isxdigit(c))
          
          	return (0);
          
          if(isdigit(c))
          
          	return (c - '0');
          
          c = toupper(c);
          
          // adjust hexadecimal 'A' to 0x0A
          
          return (c - 55);
          

          }

          void vAscii2BCD(unsigned char *pucSrc, unsigned char *pucDst, int inSize)
          {

          for (; inSize > 0; inSize -= 2, pucDst++) 
          {
          
          	if(!memcmp(pucSrc, "3D", 2))
          	{
          
          		pucSrc += 2;
          
          		\*pucDst = '=';
          
          	}
          
          	else
          	{
          
          		\*pucDst = cHexDigit\_to\_Nibble1(\*pucSrc++) << 4;
          
          
          		\*pucDst |= cHexDigit\_to\_Nibble1(\*pucSrc++);
          
          		
          	}
          	
          }
          
          printf("data is %s\\n\\n",pucDst);
          

          }

          int main()
          {
          int sock_desc, status;
          struct sockaddr_in client;
          struct addrinfo hints;
          WSADATA Data;

          int bytesSent;
          int bytesRecv = SOCKET\_ERROR;
          //char sendbuf\[32\] = "Client: Sending data.";
          //char sendbuf\[\] = "002F600123060008002020010000c0000092000000001201234830303030303039533130303030303030303030303035";
          //char sendbuf\[\] = "002F600123060008002020010000c000009200000000120123H0000009S10000000000005";
          //char sendbuf\[\] = "0111011110000000010000110110100000110010010101110111000000110010100000001001011000010011011101000101010101110011000010001000000000000000000101000110000000000000000000011000000100110101H0000009S10000000000005";
          char recvbuf\[256\] = "";
          
          
          
          unsigned char \*pucSrc  = (unsigned char\*) malloc (100) ;
          unsigned char \*pucDst  = (unsigned char\*) malloc (256) ;
          //unsigned char \*Output\_Buff = (unsigned char\*) malloc (20) ;
          int inSize = 12 ;
          
          
          //memset(Output\_Buff,0,20) ;
          memset(pucSrc,0,256);
          
          memset(pucDst,0,256);
          vAscii2BCD((unsigned char\*)"00" ,pucDst, 1) ;//
          strcpy((char\*)pucSrc,(char\*)pucDst) ;
          
          
          memset(pucDst,0,256);
          vAscii2BCD((unsigned char\*)"2E" ,pucDst, 1) ;//
          //vAscii2BCD((unsigned char\*)"002E" ,pucDst, 4) ;//
          strcat((char\*)pucSrc,(char\*)pucDst) ;
          
          
          memset(pucDst,0,256);
          //vAscii2BCD((unsigned char\*)"60012306  " ,pucDst, 12) ;//
          vAscii2BCD((unsigned char\*)"6001230600" ,pucDst, 5) ;//
          strcat((char\*)pucSrc,(char\*)pucDst) ;
          
          memset(pucDst,0,256);
          //vAscii2BCD((unsigned char\*)" 8 " ,pucDst, 4) ;//48564848
          vAscii2BCD((unsigned char\*)"0800" ,pucDst, 2) ;//48564848
          strcat((char\*)pucSrc,(char\*)pucDst);
          
          
          memset(pucDst,0,256);
          //vAscii2BCD((unsigned char\*)"2020010000C0
          
          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #6

          Pleas edit this entry and remove the blockquote surrounding the code and replace with <pre> tags, so your code is readable.

          Use the best guess

          K 2 Replies Last reply
          0
          • L Lost User

            Pleas edit this entry and remove the blockquote surrounding the code and replace with <pre> tags, so your code is readable.

            Use the best guess

            K Offline
            K Offline
            khushboo gupta
            wrote on last edited by
            #7

            Please check #include #include #include #include #include #include void Print_Debug(char *str) { printf("%s", str); ///change this prtES with your print API. } void Print_HexDump(char *Title, unsigned char * ucBuf, unsigned int uiSize) { unsigned int uiLoop; unsigned int uiChars = 0; char buffer[100]; if(uiSize == 0) return; Print_Debug(Title); memset(buffer, 0, 40); memset(buffer, '-', 39); Print_Debug(buffer); memset(buffer, ' ', 39); for (uiLoop = 0; uiLoop < uiSize; uiLoop++) { sprintf(&buffer[(uiChars * 3)], "%02X", ucBuf[uiLoop]); buffer[2 + (uiChars * 3)] = ' '; buffer[30 + uiChars] = ((ucBuf[uiLoop] > 32) && (ucBuf[uiLoop] < 125)) ? ucBuf[uiLoop] : '.'; uiChars++; if((uiChars == 10) || ((uiLoop + 1) == uiSize)) { buffer[29] = '|'; // column separater buffer[30 + uiChars] = 0; // null terminate string Print_Debug(buffer); memset(buffer, ' ', 40); uiChars = 0; } } memset(buffer, '-', 39); Print_Debug(buffer); } char cHexDigit_to_Nibble1(unsigned char c) { //if((!isxdigit(c)) || (c != 0x3D)) if(!isxdigit(c)) return (0); if(isdigit(c)) return (c - '0'); c = toupper(c); // adjust hexadecimal 'A' to 0x0A return (c - 55); } void vAscii2BCD(unsigned char *pucSrc, unsigned char *pucDst, int inSize) { for (; inSize > 0; inSize -= 2, pucDst++) { if(!memcmp(pucSrc, "3D", 2)) { pucSrc += 2; *pucDst = '='; } else { *pucDst = cHexDigit_to_Nibble1(*pucSrc++) << 4; *pucDst |= cHexDigit_to_Nibble1(*pucSrc++); } } printf("data is %s\n\n",pucDst); } //////////////////////////////////NUMERIC TO BCD///////////////////////////////// void numerictoBCD() { unsigned int uiValue = 920000; unsigned int uiResult = 0; while (uiValue > 0) { uiResult <<= 4; uiResult |= uiValue % 10; uiValue /= 10; } } unsigned long toPackedBcd (unsigned int val) { unsigned long bcdresult = 0; char i; for (i = 0; val; i++) { ((char*)&bcdresult)[i / 2] |= i & 1 ? (val % 10) << 4 : (val % 10) & 0xf; val /= 10; } return bcdresult; } int main() { int sock_desc, status; struct sockaddr_in client; struct addrinfo hints; WSADATA Data; int bytesSent; int bytesRecv = SOCKET_ERROR; //char sendbuf[32] = "Client: Sending data."; //char sendbuf[] = "002F600123060008002020010000c0000092000000001201234830303030303039533130303030303030303030303035"; //char sendbuf[] = "002F600123060008002020010000c000009200000000120123H0000009S10000000000

            L 1 Reply Last reply
            0
            • K khushboo gupta

              Please check #include #include #include #include #include #include void Print_Debug(char *str) { printf("%s", str); ///change this prtES with your print API. } void Print_HexDump(char *Title, unsigned char * ucBuf, unsigned int uiSize) { unsigned int uiLoop; unsigned int uiChars = 0; char buffer[100]; if(uiSize == 0) return; Print_Debug(Title); memset(buffer, 0, 40); memset(buffer, '-', 39); Print_Debug(buffer); memset(buffer, ' ', 39); for (uiLoop = 0; uiLoop < uiSize; uiLoop++) { sprintf(&buffer[(uiChars * 3)], "%02X", ucBuf[uiLoop]); buffer[2 + (uiChars * 3)] = ' '; buffer[30 + uiChars] = ((ucBuf[uiLoop] > 32) && (ucBuf[uiLoop] < 125)) ? ucBuf[uiLoop] : '.'; uiChars++; if((uiChars == 10) || ((uiLoop + 1) == uiSize)) { buffer[29] = '|'; // column separater buffer[30 + uiChars] = 0; // null terminate string Print_Debug(buffer); memset(buffer, ' ', 40); uiChars = 0; } } memset(buffer, '-', 39); Print_Debug(buffer); } char cHexDigit_to_Nibble1(unsigned char c) { //if((!isxdigit(c)) || (c != 0x3D)) if(!isxdigit(c)) return (0); if(isdigit(c)) return (c - '0'); c = toupper(c); // adjust hexadecimal 'A' to 0x0A return (c - 55); } void vAscii2BCD(unsigned char *pucSrc, unsigned char *pucDst, int inSize) { for (; inSize > 0; inSize -= 2, pucDst++) { if(!memcmp(pucSrc, "3D", 2)) { pucSrc += 2; *pucDst = '='; } else { *pucDst = cHexDigit_to_Nibble1(*pucSrc++) << 4; *pucDst |= cHexDigit_to_Nibble1(*pucSrc++); } } printf("data is %s\n\n",pucDst); } //////////////////////////////////NUMERIC TO BCD///////////////////////////////// void numerictoBCD() { unsigned int uiValue = 920000; unsigned int uiResult = 0; while (uiValue > 0) { uiResult <<= 4; uiResult |= uiValue % 10; uiValue /= 10; } } unsigned long toPackedBcd (unsigned int val) { unsigned long bcdresult = 0; char i; for (i = 0; val; i++) { ((char*)&bcdresult)[i / 2] |= i & 1 ? (val % 10) << 4 : (val % 10) & 0xf; val /= 10; } return bcdresult; } int main() { int sock_desc, status; struct sockaddr_in client; struct addrinfo hints; WSADATA Data; int bytesSent; int bytesRecv = SOCKET_ERROR; //char sendbuf[32] = "Client: Sending data."; //char sendbuf[] = "002F600123060008002020010000c0000092000000001201234830303030303039533130303030303030303030303035"; //char sendbuf[] = "002F600123060008002020010000c000009200000000120123H0000009S10000000000

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #8

              1. I guess you did not understand what "please edit the above entry" means. 2. Check what?

              Use the best guess

              K 1 Reply Last reply
              0
              • L Lost User

                1. I guess you did not understand what "please edit the above entry" means. 2. Check what?

                Use the best guess

                K Offline
                K Offline
                khushboo gupta
                wrote on last edited by
                #9

                Hello Sir, I really did not understand what "please edit the above entry" means. Can you pls tell me.. Do I need to edit something in the code or is this not the write way to post the code? Thanks

                J 1 Reply Last reply
                0
                • K khushboo gupta

                  Hello Sir, I really did not understand what "please edit the above entry" means. Can you pls tell me.. Do I need to edit something in the code or is this not the write way to post the code? Thanks

                  J Offline
                  J Offline
                  Jochen Arndt
                  wrote on last edited by
                  #10

                  He kindly asked you to edit your existing post (there is a button to do so) and format the source code so that it is readable. To do so, select the code section and click the 'code' button above the editor window or place a <pre> tag at the begin of the code and a </pre> at the end (when clicking the 'code' button this is done automatically). In all cases, check the preview window below the editor window. In the editor window it should look like this:

                  <pre lang="c++"> // A comment #include <stdio.h> int main() {     return 0; }</pre>

                  Then the preview (and the final post) will look like this:

                  // A comment
                  #include <stdio.h>

                  int main()
                  {
                  return 0;
                  }

                  1 Reply Last reply
                  0
                  • L Lost User

                    Pleas edit this entry and remove the blockquote surrounding the code and replace with <pre> tags, so your code is readable.

                    Use the best guess

                    K Offline
                    K Offline
                    khushboo gupta
                    wrote on last edited by
                    #11

                    I am using the below code for packing the data in iso 8583 format 00 2E 60 01 23 06 00 08 00 20 20 01 00 00 c0 00 00 92 00 00 00 00 12 01 23 48 30 30 30 30 30 30 39 53 31 30 30 30 30 30 30 30 30 30 30 30 30 35

                    #include 
                    #include 
                    #include 
                    #include 
                    #include 
                    #include 
                    
                    char cHexDigit\_to\_Nibble1(unsigned char c) 
                    {
                    if(!isxdigit(c))
                    	return (0);
                    if(isdigit(c))
                    	return (c - '0');
                    c = toupper(c);
                    
                    return (c - 55);
                    }
                    
                    void vAscii2BCD(unsigned char \*pucSrc, unsigned char \*pucDst, int inSize)
                    {
                    
                    for (; inSize > 0; inSize -= 2, pucDst++) 
                    {
                    	if(!memcmp(pucSrc, "3D", 2))
                    	{
                    		pucSrc += 2;
                    		\*pucDst = '=';
                    	}
                    
                    	else
                    	{
                    		\*pucDst = cHexDigit\_to\_Nibble1(\*pucSrc++) << 4;
                    		\*pucDst |= cHexDigit\_to\_Nibble1(\*pucSrc++);
                    	}
                    }
                    printf("data is %s\\n\\n",pucDst);
                    }
                    
                    int main()
                    {
                    int sock\_desc, status;
                    struct sockaddr\_in client; 
                    struct addrinfo hints;
                    WSADATA Data;
                        int bytesSent;
                        int bytesRecv = SOCKET\_ERROR;
                    
                    unsigned char \*pucSrc  = (unsigned char\*) malloc (100) ;
                    unsigned char \*pucDst  = (unsigned char\*) malloc (256) ;
                    
                    memset(pucSrc,0,256);
                    
                    memset(pucDst,0,256);
                    vAscii2BCD((unsigned char\*)"00" ,pucDst, 1) ;//
                    strcpy((char\*)pucSrc,(char\*)pucDst) ;
                    
                    
                    memset(pucDst,0,256);
                    vAscii2BCD((unsigned char\*)"2E" ,pucDst, 1) ;//
                    //vAscii2BCD((unsigned char\*)"002E" ,pucDst, 4) ;//
                    strcat((char\*)pucSrc,(char\*)pucDst) ;
                    
                    
                    memset(pucDst,0,256);
                    //vAscii2BCD((unsigned char\*)"60012306  " ,pucDst, 12) ;//
                    vAscii2BCD((unsigned char\*)"6001230600" ,pucDst, 5) ;//
                    strcat((char\*)pucSrc,(char\*)pucDst) ;
                    
                    memset(pucDst,0,256);
                    //vAscii2BCD((unsigned char\*)" 8 " ,pucDst, 4) ;//48564848
                    vAscii2BCD((unsigned char\*)"0800" ,pucDst, 2) ;//48564848
                    strcat((char\*)pucSrc,(char\*)pucDst);
                    
                    
                    memset(pucDst,0,256);
                    //vAscii2BCD((unsigned char\*)"2020010000C00000" ,pucDst, 16) ;
                    vAscii2BCD((unsigned char\*)"2020010000" ,pucDst, 5) ;
                    strcat((char\*)pucSrc,(char\*)pucDst);
                    
                    
                    
                    memset(pucDst,0,256);
                    //vAscii2BCD((unsigned char\*)"2020010000C00000" ,pucDst, 16) ;
                    vAscii2BCD((unsigned char\*)"C00000" ,pucDst, 3) ;
                    strcat((char\*)pucSrc,(char\*)pucDst);
                    
                    
                    
                    memset(pucDst,0,256);
                    //vAscii2BCD((unsigned char\*)"92" ,pucDst, 2) ;//575048484848
                    vAscii2BCD((unsigned char\*)"920000" ,pucDst, 3) ;
                    strcat((char\*)pucSrc,(char\*)pucDst);
                    //strcat((char\*)pucSrc,"00000000") ;
                    printf("si
                    
                    L 1 Reply Last reply
                    0
                    • K khushboo gupta

                      I am using the below code for packing the data in iso 8583 format 00 2E 60 01 23 06 00 08 00 20 20 01 00 00 c0 00 00 92 00 00 00 00 12 01 23 48 30 30 30 30 30 30 39 53 31 30 30 30 30 30 30 30 30 30 30 30 30 35

                      #include 
                      #include 
                      #include 
                      #include 
                      #include 
                      #include 
                      
                      char cHexDigit\_to\_Nibble1(unsigned char c) 
                      {
                      if(!isxdigit(c))
                      	return (0);
                      if(isdigit(c))
                      	return (c - '0');
                      c = toupper(c);
                      
                      return (c - 55);
                      }
                      
                      void vAscii2BCD(unsigned char \*pucSrc, unsigned char \*pucDst, int inSize)
                      {
                      
                      for (; inSize > 0; inSize -= 2, pucDst++) 
                      {
                      	if(!memcmp(pucSrc, "3D", 2))
                      	{
                      		pucSrc += 2;
                      		\*pucDst = '=';
                      	}
                      
                      	else
                      	{
                      		\*pucDst = cHexDigit\_to\_Nibble1(\*pucSrc++) << 4;
                      		\*pucDst |= cHexDigit\_to\_Nibble1(\*pucSrc++);
                      	}
                      }
                      printf("data is %s\\n\\n",pucDst);
                      }
                      
                      int main()
                      {
                      int sock\_desc, status;
                      struct sockaddr\_in client; 
                      struct addrinfo hints;
                      WSADATA Data;
                          int bytesSent;
                          int bytesRecv = SOCKET\_ERROR;
                      
                      unsigned char \*pucSrc  = (unsigned char\*) malloc (100) ;
                      unsigned char \*pucDst  = (unsigned char\*) malloc (256) ;
                      
                      memset(pucSrc,0,256);
                      
                      memset(pucDst,0,256);
                      vAscii2BCD((unsigned char\*)"00" ,pucDst, 1) ;//
                      strcpy((char\*)pucSrc,(char\*)pucDst) ;
                      
                      
                      memset(pucDst,0,256);
                      vAscii2BCD((unsigned char\*)"2E" ,pucDst, 1) ;//
                      //vAscii2BCD((unsigned char\*)"002E" ,pucDst, 4) ;//
                      strcat((char\*)pucSrc,(char\*)pucDst) ;
                      
                      
                      memset(pucDst,0,256);
                      //vAscii2BCD((unsigned char\*)"60012306  " ,pucDst, 12) ;//
                      vAscii2BCD((unsigned char\*)"6001230600" ,pucDst, 5) ;//
                      strcat((char\*)pucSrc,(char\*)pucDst) ;
                      
                      memset(pucDst,0,256);
                      //vAscii2BCD((unsigned char\*)" 8 " ,pucDst, 4) ;//48564848
                      vAscii2BCD((unsigned char\*)"0800" ,pucDst, 2) ;//48564848
                      strcat((char\*)pucSrc,(char\*)pucDst);
                      
                      
                      memset(pucDst,0,256);
                      //vAscii2BCD((unsigned char\*)"2020010000C00000" ,pucDst, 16) ;
                      vAscii2BCD((unsigned char\*)"2020010000" ,pucDst, 5) ;
                      strcat((char\*)pucSrc,(char\*)pucDst);
                      
                      
                      
                      memset(pucDst,0,256);
                      //vAscii2BCD((unsigned char\*)"2020010000C00000" ,pucDst, 16) ;
                      vAscii2BCD((unsigned char\*)"C00000" ,pucDst, 3) ;
                      strcat((char\*)pucSrc,(char\*)pucDst);
                      
                      
                      
                      memset(pucDst,0,256);
                      //vAscii2BCD((unsigned char\*)"92" ,pucDst, 2) ;//575048484848
                      vAscii2BCD((unsigned char\*)"920000" ,pucDst, 3) ;
                      strcat((char\*)pucSrc,(char\*)pucDst);
                      //strcat((char\*)pucSrc,"00000000") ;
                      printf("si
                      
                      L Offline
                      L Offline
                      Lost User
                      wrote on last edited by
                      #12

                      You are using string functions (strcpy() etc.) to copy your data (which are not strings) from one buffer to another, so each copy will stop as soon as it hits a zero character. Use memcpy() and ensure you copy the exact number of bytes that you wish to transfer.

                      Use the best guess

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups