obd-parser-bluetooth-connection

1.0.1 • Public • Published

obd-parser-bluetooth-connection

Connection module for use with odb-parser.

Install

npm install obd-parser-bluetooth-connection

Usage

The typical usage scenario is described in the obd-parser module docs, but if you want to use this module to get a plain OBD connection you can use the example code below as a start.

var getConnector = require('obd-parser-bluetooth-connection');

// Returns a function that will allow us to connect to the serial port
var connect = getConnector({
  name: 'obd'
});

connect(configureFunction)
  .then(function () {
    console.log('connected to bluetooth obd adapter!')
  })
  .catch(function (err) {
    console.error('oh noes');
  });


function configureFunction (connection) {
  return new Promise(function (resolve, reject) {
    // Set up the obd connection etc.
    conn.write('ATZ');
    conn.write('ATE0');
  });
}

Package Sidebar

Install

npm i obd-parser-bluetooth-connection

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • coderocket