npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@viriciti/dbc-to-json

v0.0.16

Published

Converts a .dbc file to a JSON object that contains all BO_, SG_, VAL_ and CM_ information.

Downloads

214

Readme

dbc-to-json

Converts a .dbc file to a JSON object that contains all BO_, SG_, VAL_ and CM_ information.

Will also provide a list of possibly incorrect signal definitions (like having both a postfix and a VAL_ entry for the same signal).

Usage

Go to https://viriciti.github.io/dbc-to-json/ and upload a .dbc file. Open your browser's console to see if there's any mistakes in the .dbc file. Fix those (using the line number provided) and reupload.

Example input

See meta/test-input/00_ReadmeExample.dbc

BO_ 123 StandardMessage: 8 Vector__XXX
 SG_ Normal : 0|8@1+ (1,0) [0|0] "A" Vector__XXX
 SG_ Special : 43|12@0- (0.5,-50) [0|0] "V" Vector__XXX
 SG_ States : 8|2@1+ (1,0) [0|0] "" Vector__XXX

BO_ 2566906689 ExtendedMessage: 8 Vector__XXX
 SG_ Multiplexor M : 0|8@1+ (1,0) [0|0] "" Vector__XXX
 SG_ BatteryCell1Voltage m0 : 8|16@1+ (1,0) [0|0] "V" Vector__XXX
 SG_ BatteryCell2Voltage m1 : 8|16@1+ (1,0) [0|0] "V" Vector__XXX

VAL_ 123 States 0 "Off" 1 "On" 2 "Blinking" 3 "Unavailable" ;

CM_ BO_ 123 "Small description on BO";
CM_ SG_ 123 Normal "Small description on SG";

Example output

[
    {
        "canId": 123,
        "pgn": 123,
        "name": "StandardMessage",
        "isExtendedFrame": false,
        "dlc": 8,
        "comment": "Small description on BO",
        "signals": [
            {
                "name": "Normal",
                "label": "standard_message.normal",
                "startBit": 0,
                "bitLength": 8,
                "isLittleEndian": true,
                "isSigned": false,
                "factor": 1,
                "offset": 0,
                "min": 0,
                "max": 0,
                "sourceUnit": "A",
                "dataType": "int",
                "comment": "Small description on SG"
            },
            {
                "name": "Special",
                "label": "standard_message.special",
                "startBit": 43,
                "bitLength": 12,
                "isLittleEndian": true,
                "isSigned": true,
                "factor": 0.5,
                "offset": -50,
                "min": 0,
                "max": 0,
                "sourceUnit": "V",
                "dataType": "int",
                "comment": null
            },
            {
                "name": "States",
                "label": "standard_message.states",
                "startBit": 8,
                "bitLength": 2,
                "isLittleEndian": true,
                "isSigned": false,
                "factor": 1,
                "offset": 0,
                "min": 0,
                "max": 0,
                "dataType": "int",
                "states": [
                    {
                        "value": 0,
                        "state": "Off"
                    },
                    {
                        "value": 1,
                        "state": "On"
                    },
                    {
                        "value": 2,
                        "state": "Blinking"
                    },
                    {
                        "value": 3,
                        "state": "Unavailable"
                    }
                ],
                "comment": null
            }
        ],
        "lineInDbc": 31,
        "label": "standard_message"
    },
    {
        "canId": 2566906689,
        "pgn": 65507,
        "source": 65,
        "name": "ExtendedMessage",
        "priority": 152,
        "isExtendedFrame": true,
        "dlc": 8,
        "signals": [
            {
                "name": "Multiplexor",
                "label": "extended_message.multiplexor",
                "startBit": 0,
                "bitLength": 8,
                "isLittleEndian": true,
                "isSigned": false,
                "factor": 1,
                "offset": 0,
                "min": 0,
                "max": 0,
                "isMultiplexor": true,
                "dataType": "int",
                "comment": null
            },
            {
                "name": "BatteryCell1Voltage",
                "label": "extended_message.battery_cell1_voltage",
                "startBit": 8,
                "bitLength": 16,
                "isLittleEndian": true,
                "isSigned": false,
                "factor": 1,
                "offset": 0,
                "min": 0,
                "max": 0,
                "sourceUnit": "V",
                "multiplexerValue": 0,
                "dataType": "int",
                "comment": null
            },
            {
                "name": "BatteryCell2Voltage",
                "label": "extended_message.battery_cell2_voltage",
                "startBit": 8,
                "bitLength": 16,
                "isLittleEndian": true,
                "isSigned": false,
                "factor": 1,
                "offset": 0,
                "min": 0,
                "max": 0,
                "sourceUnit": "V",
                "multiplexerValue": 1,
                "dataType": "int",
                "comment": null
            }
        ],
        "lineInDbc": 36,
        "label": "extended_message"
    }
]