elm327
Version:
Node.js/TypeScript library for ELM327 OBD2 adapters over USB, Bluetooth and WiFi
34 lines • 1.22 kB
TypeScript
import { OBD2Connection } from './connection';
import { ConnectionConfig } from './types';
/**
* Bluetooth connection to an ELM327 adapter.
*
* In browsers: uses the Web Bluetooth API (BLE only).
* In Node.js: not natively supported — use SerialConnection with a paired
* device via rfcomm (Linux: /dev/rfcomm0) or /dev/tty.* (macOS).
*
* Updated to use ResponseMatcher for better request/response matching.
* Implements smart discovery with multiple known UUIDs for clone compatibility.
*/
export declare class BluetoothConnection extends OBD2Connection {
private socket;
private buffer;
private _btHandler;
private _characteristic;
private _device;
constructor(config: ConnectionConfig);
connect(): Promise<void>;
disconnect(): Promise<void>;
sendRaw(data: string): Promise<void>;
isConnectionOpen(): boolean;
protected clearBuffer(): void;
private hasWebBluetooth;
private connectWebBluetooth;
private connectNativeBluetooth;
private handleBluetoothData;
/**
* Checks if Bluetooth is available in the current environment.
*/
static isBluetoothAvailable(): Promise<boolean>;
}
//# sourceMappingURL=bluetooth-connection.d.ts.map