UNPKG

rxjs-obd

Version:

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

41 lines (40 loc) 1.21 kB
import { Observable } from 'rxjs'; import { OBDConnection } from './OBDConnection'; /** * The wrapper net.Socket connection. */ export declare class NodeOBDConnection implements OBDConnection { /** * Wrapped net.Socket instance. */ private socket; /** * Subject of data incomming from OBD Reader connection. */ private data$; /** * Open connection to OBD Reader. * @returns the observable of opening connection. */ open(config: { host: string; port: number; }): Observable<any>; /** * 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>; /** * Listener for data received from OBD Reader. * @returns Observable of data received from OBD Reader. */ onData(): Observable<string>; /** * 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>; }