can-message
v0.1.0
Published
utility functions for handling CAN data from comma.ai panda
Downloads
19
Readme
can-message
Pack and unpack CAN bus data.
This library is designed for use with the Panda OBD-II Dongle as part of pandajs.
Installation
npm i --save can-message
or
yarn add can-message
Usage
import { canToObject, objectToCan } from 'can-message';
// parse raw buffer into can data
var messageArray = canToObject(buffer);
// messageArray is an array of { address, busTime, data, bus }
// create a buffer containing a can message
var buffer = objectToCan(myCanMessage);
const CanMessage = require('can-message');
// parse raw buffer into can data
var messageArray = CanMessage.canToObject(buffer);
// messageArray is an array of { address, busTime, data, bus }
// create a buffer containing a can message
var buffer = CanMessage.objectToCan(myCanMessage);
Contributing
yarn run test
License
MIT @ comma.ai
Read more about how to get started hacking your car with Panda here.