UNPKG

rxjs-obd

Version:

RxJS Implementation for OBD (On Board Diagnostics) of vehicles via ELM 327 connections.

49 lines (48 loc) 1.58 kB
import { Observable } from 'rxjs'; import { BluetoothSerialDevice } from "../observables"; import { OBDConnection } from './OBDConnection'; /** * The wrapper of Bluetooth Serial plugin for Cordova. */ export declare class BluetoothOBDConnection extends OBDConnection { /** * Subject of data incoming from OBD Reader connection. */ private data$; /** * Open connection to OBD Reader. * @returns the observable of opening connection. */ open(config: { device: BluetoothSerialDevice; }): Observable<any>; /** * Close and dispose resources of OBD Reader connection. * @returns the observable of close operation. * The events emitted are ignored, wait for complete (successful) or error (failure). */ close(): Observable<any>; /** * Listener for data received from OBD Reader. * @returns Observable of data received from OBD Reader. */ onData(): Observable<string>; /** * Send a command to OBD Reader. * @returns the observable of send operation. * The events emitted are ignored, wait for complete (successful) or error (failure). */ send(command: string): Observable<any>; /** * Marshall the string data into bytes array. * @param data the string data. * @returns the bytes array. */ static marshall(data: string): Uint8Array; /** * Unmarshall the bytes array into data string. * @param bytes the bytes array. * @returns the string data. */ static unmarshall(bytes: Uint8Array): string; }