Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evanshortiss/obd-parser-development-connection
A fake connection that can be used to simulate polling for PIDs during development
https://github.com/evanshortiss/obd-parser-development-connection
Last synced: 21 days ago
JSON representation
A fake connection that can be used to simulate polling for PIDs during development
- Host: GitHub
- URL: https://github.com/evanshortiss/obd-parser-development-connection
- Owner: evanshortiss
- Created: 2016-12-07T02:56:55.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-16T02:39:55.000Z (over 7 years ago)
- Last Synced: 2024-10-06T20:35:01.447Z (about 1 month ago)
- Language: TypeScript
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# obd-parser-development-connection
A connetion for the *obd-parser* module that is useful when developing. It will
return random data for any PID being requested.## Usage
See the _/examples_ folder in *obd-parser* for a full example:```ts
// In your code this should be changed to 'obd-parser'
import * as OBD from 'obd-parser';// Use a serial connection to connect
var getConnector = require('obd-parser-fake-connection');// Returns a function that will allow us to connect to the serial port
var connect:Function = getConnector({});// Need to initialise the OBD module with a "connector" before starting
OBD.init(connect)
.then(function () {
// Do your polling stuff here!
})
```The above code will work exactly the same as JavaScript, just remove the type
annotation and change the _import_ line to _var OBD = require('obd-parser')_.## CHANGELOG
* 0.2.1 - Add missing dependency
* 0.2.0 - Add random delay for responses similar to a real car
* 0.1.3 - Remove comment that is no longer valid
* 0.1.2 - Fix to include dist JS files
* 0.1.1 - Fix to include dist JS files
* 0.1.0 - Initial release