rxjs-obd
Version:
RxJS Implementation for OBD (On Board Diagnostics) of vehicles via ELM 327 connections.
16 lines • 511 B
JavaScript
import { Observable } from "rxjs";
/**
* Observable adapter to list bluetooth devices.
*/
export const fromBluetoothSerialList = () => new Observable(subscriber => {
// declare successful handler
const next = (value) => {
subscriber.next(value);
subscriber.complete();
};
// declare failure handler
const error = (message) => subscriber.error(message);
// invoke Cordova plugin.
bluetoothSerial.list(next, error);
});
//# sourceMappingURL=fromBluetoothSerial.js.map