├── src ├── Geely_VF11_V1.7.dbc └── can │ └── tools │ └── dbc2xml │ ├── DBCParser.java │ ├── DBC2XML.java │ ├── Nodes.java │ ├── Signal.java │ ├── Messages.java │ ├── TestUint.java │ ├── SimpleRead.java │ ├── Blah.java │ ├── BetterRead.java │ └── can_db.xml ├── .classpath ├── README.md ├── .gitignore ├── .project └── .settings └── org.eclipse.jdt.core.prefs /src/Geely_VF11_V1.7.dbc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZFChen/DBC2XML/HEAD/src/Geely_VF11_V1.7.dbc -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/DBCParser.java: -------------------------------------------------------------------------------- 1 | package can.tools.dbc2xml; 2 | 3 | public class DBCParser { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/DBC2XML.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZFChen/DBC2XML/HEAD/src/can/tools/dbc2xml/DBC2XML.java -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/Nodes.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZFChen/DBC2XML/HEAD/src/can/tools/dbc2xml/Nodes.java -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/Signal.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZFChen/DBC2XML/HEAD/src/can/tools/dbc2xml/Signal.java -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/Messages.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZFChen/DBC2XML/HEAD/src/can/tools/dbc2xml/Messages.java -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/TestUint.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZFChen/DBC2XML/HEAD/src/can/tools/dbc2xml/TestUint.java -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/SimpleRead.java: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ZFChen/DBC2XML/HEAD/src/can/tools/dbc2xml/SimpleRead.java -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DBC2XML 2 | 3 | The DBC file describes the communication of a single CAN network. (refer to Vector "DBC File Format Documentation Version 01/2007") 4 | The DBC file can also be used to develop the communication software of an electronic control unit which shall be part of the CAN network. 5 | 6 | This applicaiton is convert the dbc file to xml file. 7 | 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.ear 17 | *.zip 18 | *.tar.gz 19 | *.rar 20 | 21 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 22 | hs_err_pid* -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | DBC2XML 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve 5 | org.eclipse.jdt.core.compiler.compliance=1.7 6 | org.eclipse.jdt.core.compiler.debug.lineNumber=generate 7 | org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 | org.eclipse.jdt.core.compiler.debug.sourceFile=generate 9 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 10 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 11 | org.eclipse.jdt.core.compiler.source=1.7 12 | -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/Blah.java: -------------------------------------------------------------------------------- 1 | package can.tools.dbc2xml; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | 7 | public enum Blah { 8 | NETWORK_NODE("BU_:"), 9 | MESSAGE("BO_"), 10 | SIGNAL("SG_"), 11 | ATTRIBUTE("BA_"), 12 | COMMENT("CM_"), 13 | VALUE_TABLE("VAL_"); 14 | 15 | private String text; 16 | 17 | Blah(String text) { 18 | this.text = text; 19 | } 20 | 21 | public String getText() { 22 | return this.text; 23 | } 24 | 25 | // Implementing a fromString method on an enum type 26 | private static final Map stringToEnum = new HashMap(); 27 | 28 | static { 29 | // Initialize map from constant name to enum constant 30 | for(Blah blah : values()) { 31 | stringToEnum.put(blah.toString(), blah); //Key-Value: String-Blsh 32 | } 33 | } 34 | 35 | // Returns Blah for string, or null if string is invalid 36 | public static Blah fromString(String symbol) { 37 | return stringToEnum.get(symbol); 38 | } 39 | 40 | @Override 41 | public String toString() { 42 | return text; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/BetterRead.java: -------------------------------------------------------------------------------- 1 | package can.tools.dbc2xml; 2 | 3 | //: strings/BetterRead.java 4 | import java.util.*; 5 | 6 | public class BetterRead { 7 | public static void main(String[] args) { 8 | Scanner stdin = new Scanner(SimpleRead.input); //input = "Sir Robin of Camelot\n22 1.61803" 9 | System.out.println("What is your name?"); 10 | String name = stdin.nextLine(); //Sir Robin of Camelot 11 | System.out.println(name); 12 | System.out.println( 13 | "How old are you? What is your favorite double?"); 14 | System.out.println("(input: )"); 15 | int age = stdin.nextInt(); //age = 22 16 | double favorite = stdin.nextDouble(); //favorite = 1.61803 17 | System.out.println(age); 18 | System.out.println(favorite); 19 | System.out.format("Hi %s.\n", name); 20 | System.out.format("In 5 years you will be %d.\n", 21 | age + 5); 22 | System.out.format("My favorite double is %f.", favorite / 2); 23 | stdin.close(); 24 | } 25 | } /* Output: 26 | What is your name? 27 | Sir Robin of Camelot 28 | How old are you? What is your favorite double? 29 | (input: ) 30 | 22 31 | 1.61803 32 | Hi Sir Robin of Camelot. 33 | In 5 years you will be 27. 34 | My favorite double is 0.809015. 35 | *///:~ 36 | 37 | -------------------------------------------------------------------------------- /src/can/tools/dbc2xml/can_db.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | NMNode 4 | 5 | NWM_MSG 6 | 8 7 | 1024 8 | 9 | NWM_RMR 10 | 8 11 | 1 12 | bit 13 | 1.0 14 | 0.0 15 | 16 | 17 | 18 | NWM_NMSts 19 | 16 20 | 1 21 | bit 22 | 1.0 23 | 0.0 24 | 25 | 26 | 27 | NWM_Wakeup 28 | 31 29 | 8 30 | bit 31 | 1.0 32 | 0.0 33 | 34 | 35 | 36 | NWM_Staywake_reasons 37 | 39 38 | 32 39 | bit 40 | 1.0 41 | 0.0 42 | 43 | 44 | 45 | NWM_AWB 46 | 12 47 | 1 48 | bit 49 | 1.0 50 | 0.0 51 | 52 | 53 | 54 | NWM_Address 55 | 7 56 | 8 57 | bit 58 | 1.0 59 | 0.0 60 | 61 | 62 | 63 | 64 | 65 | CCPTester 66 | 67 | CCP_TesterReq 68 | 8 69 | 1677 70 | 71 | CCP_Req 72 | 7 73 | 64 74 | 75 | 1.0 76 | 0.0 77 | 78 | 79 | 80 | 81 | 82 | DigTester 83 | 84 | 85 | AC 86 | 87 | CCP_ACResp 88 | 8 89 | 1676 90 | 91 | CCP_Resp 92 | 7 93 | 64 94 | 95 | 1.0 96 | 0.0 97 | 98 | 99 | 100 | 101 | AC_ReqSts 102 | 8 103 | 753 104 | 105 | AC_InsideTemperatureInvalid 106 | 7 107 | 1 108 | bit 109 | 1.0 110 | 0.0 111 | 112 | 113 | 114 | AC_InsideTemperature 115 | 55 116 | 8 117 | °C 118 | 0.5 119 | -40.0 120 | 121 | 122 | 123 | AC_SSM_StartReq 124 | 3 125 | 1 126 | bit 127 | 1.0 128 | 0.0 129 | 130 | 0 131 | No request 132 | 1 133 | Auto start request 134 | 135 | 136 | 137 | AC_SSM_Allowance 138 | 2 139 | 1 140 | bit 141 | 1.0 142 | 0.0 143 | 144 | 0 145 | Allowance engine auto stop 146 | 1 147 | Prohibit engine auto stop 148 | 149 | 150 | 151 | AC_ACCompReq 152 | 0 153 | 1 154 | bit 155 | 1.0 156 | 0.0 157 | 158 | 0 159 | AC Compress Req OFF 160 | 1 161 | AC Compress Req ON 162 | 163 | 164 | 165 | AC_AmbientTemperatureInvalid 166 | 1 167 | 1 168 | bit 169 | 1.0 170 | 0.0 171 | 172 | 173 | 174 | AC_ACCompReqInvalid 175 | 4 176 | 1 177 | bit 178 | 1.0 179 | 0.0 180 | 181 | 0 182 | Valid 183 | 1 184 | Invalid 185 | 186 | 187 | 188 | AC_FanStatus 189 | 5 190 | 1 191 | bit 192 | 1.0 193 | 0.0 194 | 195 | 196 | 197 | AC_AmbientTemperature 198 | 15 199 | 8 200 | °C 201 | 0.5 202 | -40.0 203 | 204 | 205 | 206 | AC_PM25InDen 207 | 23 208 | 12 209 | ug/m^3 210 | 1.0 211 | 0.0 212 | 213 | 214 | 215 | AC_PM25OutDen 216 | 27 217 | 12 218 | ug/m^3 219 | 1.0 220 | 0.0 221 | 222 | 223 | 224 | AC_AirInQLevel 225 | 42 226 | 3 227 | bit 228 | 1.0 229 | 0.0 230 | 231 | 0 232 | Level 1 233 | 1 234 | Level 2 235 | 2 236 | Level 3 237 | 3 238 | Level 4 239 | 4 240 | Level 5 241 | 5 242 | Level 6 243 | 6 244 | Reserved 245 | 7 246 | Invalid 247 | 248 | 249 | 250 | AC_AirOutQLevel 251 | 45 252 | 3 253 | bit 254 | 1.0 255 | 0.0 256 | 257 | 0 258 | Level 1 259 | 1 260 | Level 2 261 | 2 262 | Level 3 263 | 3 264 | Level 4 265 | 4 266 | Level 5 267 | 5 268 | Level 6 269 | 6 270 | Reserved 271 | 7 272 | Invalid 273 | 274 | 275 | 276 | AC_PM25Sts 277 | 47 278 | 2 279 | bit 280 | 1.0 281 | 0.0 282 | 283 | 0 284 | Initial 285 | 1 286 | Collecting 287 | 2 288 | Complete 289 | 3 290 | Error 291 | 292 | 293 | 294 | 295 | AC_Status_Info 296 | 8 297 | 754 298 | 299 | AC_AutoState 300 | 0 301 | 1 302 | bit 303 | 1.0 304 | 0.0 305 | 306 | 307 | 308 | AC_DisplayActive 309 | 1 310 | 1 311 | 312 | 1.0 313 | 0.0 314 | 315 | 316 | 317 | AC_RCPState 318 | 7 319 | 1 320 | 321 | 1.0 322 | 0.0 323 | 324 | 325 | 326 | AC_MaxAcState 327 | 2 328 | 1 329 | bit 330 | 1.0 331 | 0.0 332 | 333 | 334 | 335 | AC_FrontDefrostState 336 | 3 337 | 1 338 | bit 339 | 1.0 340 | 0.0 341 | 342 | 343 | 344 | AC_IntakeAirState 345 | 5 346 | 2 347 | bit 348 | 1.0 349 | 0.0 350 | 351 | 352 | 353 | AC_AqsState 354 | 6 355 | 1 356 | bit 357 | 1.0 358 | 0.0 359 | 360 | 361 | 362 | AC_BlowerLevel 363 | 11 364 | 4 365 | bit 366 | 1.0 367 | 0.0 368 | 369 | 370 | 371 | AC_DualState 372 | 13 373 | 1 374 | bit 375 | 1.0 376 | 0.0 377 | 378 | 379 | 380 | AC_IONIZERState 381 | 15 382 | 2 383 | bit 384 | 1.0 385 | 0.0 386 | 387 | 388 | 389 | AC_AirDistributionMode 390 | 18 391 | 3 392 | bit 393 | 1.0 394 | 0.0 395 | 396 | 0 397 | Face 398 | 1 399 | Foot face 400 | 2 401 | Foot 402 | 3 403 | Foot Screen 404 | 4 405 | Screen 406 | 5 407 | Reserved 408 | 6 409 | Reserved 410 | 7 411 | Invalid 412 | 413 | 414 | 415 | AC_OnState 416 | 20 417 | 1 418 | bit 419 | 1.0 420 | 0.0 421 | 422 | 423 | 424 | AC_RearKeyLockSts 425 | 22 426 | 1 427 | bit 428 | 1.0 429 | 0.0 430 | 431 | 432 | 433 | AC_LeftSetTemperature 434 | 28 435 | 5 436 | 437 | 0.5 438 | 17.0 439 | 440 | 441 | 442 | AC_AirCleanState 443 | 31 444 | 1 445 | bit 446 | 1.0 447 | 0.0 448 | 449 | 450 | 451 | AC_RightSetTemperature 452 | 36 453 | 5 454 | 455 | 0.5 456 | 17.0 457 | 458 | 459 | 460 | AC_RemoteControlSt 461 | 39 462 | 1 463 | bit 464 | 1.0 465 | 0.0 466 | 467 | 0 468 | Not Remote control mode 469 | 1 470 | Remote control mode 471 | 472 | 473 | 474 | 475 | NWM_AC 476 | 8 477 | 1030 478 | 479 | AC_Staywake_reasons 480 | 39 481 | 32 482 | bit 483 | 1.0 484 | 0.0 485 | 486 | 487 | 488 | AC_Address 489 | 7 490 | 8 491 | bit 492 | 1.0 493 | 0.0 494 | 495 | 496 | 497 | AC_RMR 498 | 8 499 | 1 500 | bit 501 | 1.0 502 | 0.0 503 | 504 | 505 | 506 | AC_AWB 507 | 12 508 | 1 509 | bit 510 | 1.0 511 | 0.0 512 | 513 | 514 | 515 | AC_NMSts 516 | 24 517 | 1 518 | bit 519 | 1.0 520 | 0.0 521 | 522 | 523 | 524 | AC_Wakeup_reasons 525 | 23 526 | 8 527 | bit 528 | 1.0 529 | 0.0 530 | 531 | 532 | 533 | 534 | AC_DiagResp 535 | 8 536 | 1998 537 | 538 | AC_Physical_Diagnostic_Tx 539 | 7 540 | 64 541 | 542 | 1.0 543 | 0.0 544 | 545 | 546 | 547 | 548 | 549 | BCM 550 | 551 | PEPS_Message_Sts 552 | 8 553 | 482 554 | 555 | PEPS_RKE_RemoteACControl 556 | 19 557 | 2 558 | bit 559 | 1.0 560 | 0.0 561 | 562 | 563 | 564 | PEPS_PowerModeValidity 565 | 1 566 | 2 567 | bit 568 | 1.0 569 | 0.0 570 | 571 | 572 | 573 | PEPS_PowerMode 574 | 4 575 | 3 576 | bit 577 | 1.0 578 | 0.0 579 | 580 | 581 | 582 | PEPS_RemoteControlSt 583 | 7 584 | 1 585 | bit 586 | 1.0 587 | 0.0 588 | 589 | 590 | 591 | 592 | BCM_LightChimeReq 593 | 8 594 | 496 595 | 596 | BCM_SolarRightSens_ADValue 597 | 39 598 | 8 599 | W/m2 600 | 4.015749931335449 601 | 0.0 602 | 603 | 604 | 605 | BCM_SolarLeftSens_ADValue 606 | 47 607 | 8 608 | W/m2 609 | 4.015749931335449 610 | 0.0 611 | 612 | 613 | 614 | 615 | 616 | GW 617 | 618 | EMS_EngineStatus 619 | 8 620 | 134 621 | 622 | EMS_ACStatus 623 | 48 624 | 1 625 | bit 626 | 1.0 627 | 0.0 628 | 629 | 630 | 631 | 632 | MMI_AC_Command 633 | 8 634 | 677 635 | 636 | MMI_RCPSet 637 | 30 638 | 2 639 | bit 640 | 1.0 641 | 0.0 642 | 643 | 644 | 645 | MMI_RightSetTemp 646 | 36 647 | 5 648 | 649 | 0.5 650 | 17.0 651 | 652 | 653 | 654 | MMI_LeftSetTemp 655 | 28 656 | 5 657 | 658 | 0.5 659 | 17.0 660 | 661 | 662 | 663 | MMI_RearKeyLockSet 664 | 23 665 | 2 666 | bit 667 | 1.0 668 | 0.0 669 | 670 | 671 | 672 | MMI_AirConditionerPowerKey 673 | 20 674 | 1 675 | bit 676 | 1.0 677 | 0.0 678 | 679 | 680 | 681 | MMI_AirDistributionModeReq 682 | 18 683 | 3 684 | bit 685 | 1.0 686 | 0.0 687 | 688 | 689 | 690 | MMI_IONIZERKey 691 | 15 692 | 1 693 | bit 694 | 1.0 695 | 0.0 696 | 697 | 698 | 699 | MMI_DualKey 700 | 13 701 | 1 702 | bit 703 | 1.0 704 | 0.0 705 | 706 | 707 | 708 | MMI_BlowerFanLevel 709 | 11 710 | 4 711 | bit 712 | 1.0 713 | 0.0 714 | 715 | 716 | 717 | MMI_AcKey 718 | 7 719 | 1 720 | bit 721 | 1.0 722 | 0.0 723 | 724 | 725 | 726 | MMI_AqsKey 727 | 6 728 | 1 729 | bit 730 | 1.0 731 | 0.0 732 | 733 | 734 | 735 | MMI_FreshReciKey 736 | 5 737 | 1 738 | bit 739 | 1.0 740 | 0.0 741 | 742 | 743 | 744 | MMI_FrontDefrostKey 745 | 3 746 | 1 747 | bit 748 | 1.0 749 | 0.0 750 | 751 | 752 | 753 | MMI_MaxAcKey 754 | 2 755 | 1 756 | bit 757 | 1.0 758 | 0.0 759 | 760 | 761 | 762 | MMI_AC_OnKey 763 | 1 764 | 1 765 | bit 766 | 1.0 767 | 0.0 768 | 769 | 770 | 771 | MMI_AutoKey 772 | 0 773 | 1 774 | bit 775 | 1.0 776 | 0.0 777 | 778 | 779 | 780 | 781 | EMS_EngineRPM 782 | 8 783 | 133 784 | 785 | EMS_SSMStatus 786 | 42 787 | 3 788 | bit 789 | 1.0 790 | 0.0 791 | 792 | 793 | 794 | EMS_EngineSpeedRPM 795 | 23 796 | 16 797 | RPM 798 | 0.25 799 | 0.0 800 | 801 | 802 | 803 | EMS_EngineSpeedRPMInvalid 804 | 44 805 | 1 806 | bit 807 | 1.0 808 | 0.0 809 | 810 | 811 | 812 | EMS_EngStatus 813 | 47 814 | 3 815 | bit 816 | 1.0 817 | 0.0 818 | 819 | 820 | 821 | 822 | EMS_EngineDriverInfo 823 | 8 824 | 648 825 | 826 | EMS_EngineCoolantTemperature 827 | 7 828 | 8 829 | °C 830 | 0.75 831 | -36.79999923706055 832 | 833 | 834 | 835 | EMS_EngineCoolantTempInvalid 836 | 8 837 | 1 838 | bit 839 | 1.0 840 | 0.0 841 | 842 | 843 | 844 | 845 | ESC_Status 846 | 8 847 | 293 848 | 849 | ESC_VehicleSpeed 850 | 15 851 | 13 852 | KPH 853 | 0.05624999850988388 854 | 0.0 855 | 856 | 857 | 858 | ESC_VehicleSpeedInvalid 859 | 18 860 | 1 861 | bit 862 | 1.0 863 | 0.0 864 | 865 | 866 | 867 | 868 | TBOX_RemCon 869 | 8 870 | 658 871 | 872 | TBOX_Inquire_PM25 873 | 10 874 | 1 875 | bit 876 | 1.0 877 | 0.0 878 | 879 | 880 | 881 | TBOX_AirCleanerReq 882 | 12 883 | 2 884 | bit 885 | 1.0 886 | 0.0 887 | 888 | 889 | 890 | TBOX_TempReq 891 | 28 892 | 5 893 | 894 | 0.5 895 | 17.0 896 | 897 | 898 | 899 | TBOX_AirConditionerReq 900 | 31 901 | 2 902 | bit 903 | 1.0 904 | 0.0 905 | 906 | 907 | 908 | 909 | AC_DiagReq 910 | 8 911 | 1990 912 | 913 | AC_Physical_Diagnostic_Rx 914 | 7 915 | 64 916 | 917 | 1.0 918 | 0.0 919 | 920 | 921 | 922 | 923 | Func_DiagReq 924 | 8 925 | 2015 926 | 927 | Tester_FunAddressingReq 928 | 7 929 | 64 930 | 931 | 1.0 932 | 0.0 933 | 934 | 935 | 936 | 937 | 938 | PTG 939 | 940 | 941 | ESCL 942 | 943 | 944 | --------------------------------------------------------------------------------