Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
app-notes:fmstoip-itxpt [2022/12/15 16:05] dodenhoeftapp-notes:fmstoip-itxpt [2024/05/23 10:22] (current) klueppel
Line 1: Line 1:
 ====== FMStoIP ====== ====== FMStoIP ======
  
-In this example enable ITxPT on Netmodule NG800 and receive specific CAN Data of the router via ITxPT implementation. As a client, we use a pc with linux-debian 11+In this example enable ITxPT on Netmodule NG800 and receive specific CAN Data of the router via ITxPT implementation. As a client, we use a pc with linux-debian 10
  
 Requirements:  Requirements: 
Line 31: Line 31:
 usr = ""; usr = "";
 pwd = ""; pwd = "";
 +path = "";
 pp = ""; pp = "";
 resp = ""; resp = "";
Line 41: Line 42:
 for(i=0; i<length(pgn); i++) { for(i=0; i<length(pgn); i++) {
      // POST request      // POST request
-     req = nb_transfer_post(usr,pwd,url,"fms", pp, resp, header);+     f = fopen("content", "w"); 
 +     fwrite(f, '<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n'); 
 +     fwrite(f, sprintf("<PGNReq>%s</PGNReq>", pgn[i])); 
 +     fclose(f); 
 +     req = nb_transfer_post(usr ,pwd ,url ,path ,pp ,resp ,header);
      printf("added PGN:%s\n\n", pgn[i]);      printf("added PGN:%s\n\n", pgn[i]);
 } }
Line 85: Line 90:
 Now we can start mrecevie, with multiacast IP and port: Now we can start mrecevie, with multiacast IP and port:
 ./mreceive -g 239.255.42.21  -p 15015 ./mreceive -g 239.255.42.21  -p 15015
-<konsole>+ 
 +<code sh output.txt>
 timm@debian:~/git/mtools$ ./mreceive -g 239.255.42.21 -p 15015 timm@debian:~/git/mtools$ ./mreceive -g 239.255.42.21 -p 15015
 Now receiving from multicast group: 239.255.42.21 Now receiving from multicast group: 239.255.42.21
 Receive msg 1 from 192.168.1.1:60429: <?xml version="1.0"?><FMStoIPDelivery version="1.1a"><FMStoIP FMSVersion="0000"><Frame Status="OK"><PGN>F001</PGN><Data>FF0000FFFFFFFFDD</Data><RelativeTime>1671119801118</RelativeTime><SPN id="1243"><Name>ABS Fully Operational</Name><Value>Not available</Value></SPN></Frame><Frame Status="OK"><PGN>F001</PGN><Data>FF0000FFFFFFFFDD</Data><RelativeTime>1671119801118</RelativeTime><SPN id="1243"><Name>ABS Fully Operational</Name><Value>Not available</Value></SPN></Frame></FMStoIP></FMStoIPDelivery> Receive msg 1 from 192.168.1.1:60429: <?xml version="1.0"?><FMStoIPDelivery version="1.1a"><FMStoIP FMSVersion="0000"><Frame Status="OK"><PGN>F001</PGN><Data>FF0000FFFFFFFFDD</Data><RelativeTime>1671119801118</RelativeTime><SPN id="1243"><Name>ABS Fully Operational</Name><Value>Not available</Value></SPN></Frame><Frame Status="OK"><PGN>F001</PGN><Data>FF0000FFFFFFFFDD</Data><RelativeTime>1671119801118</RelativeTime><SPN id="1243"><Name>ABS Fully Operational</Name><Value>Not available</Value></SPN></Frame></FMStoIP></FMStoIPDelivery>
 Receive msg 2 from 192.168.1.1:60429: <?xml version="1.0"?><FMStoIPDelivery version="1.1a"><FMStoIP FMSVersion="0000"><Frame Status="OK"><PGN>F002</PGN><Data>FF0000FFFFFFFFDD</Data><RelativeTime>1671119811052</RelativeTime><SPN id="522"><Name>Percent Clutch Slip</Name><Unit>%</Unit><Value>102.0</Value></SPN></Frame><Frame Status="OK"><PGN>F002</PGN><Data>FF0000FFFFFFFFDD</Data><RelativeTime>1671119811051</RelativeTime><SPN id="522"><Name>Percent Clutch Slip</Name><Unit>%</Unit><Value>102.0</Value></SPN></Frame></FMStoIP></FMStoIPDelivery> Receive msg 2 from 192.168.1.1:60429: <?xml version="1.0"?><FMStoIPDelivery version="1.1a"><FMStoIP FMSVersion="0000"><Frame Status="OK"><PGN>F002</PGN><Data>FF0000FFFFFFFFDD</Data><RelativeTime>1671119811052</RelativeTime><SPN id="522"><Name>Percent Clutch Slip</Name><Unit>%</Unit><Value>102.0</Value></SPN></Frame><Frame Status="OK"><PGN>F002</PGN><Data>FF0000FFFFFFFFDD</Data><RelativeTime>1671119811051</RelativeTime><SPN id="522"><Name>Percent Clutch Slip</Name><Unit>%</Unit><Value>102.0</Value></SPN></Frame></FMStoIP></FMStoIPDelivery>
-</konsole>+</code> 
  
 <code xml result.xml> <code xml result.xml>