UNPKG

obd-raw-data-parser

Version:

A lightweight TypeScript library for parsing OBD-II raw data into human readable format. Based on the excellent work of obd-utils by Nishkalkashyap.

22 lines (21 loc) 682 B
export interface IObdPID { mode: Modes; pid: string | undefined; bytes: 1 | 2 | 3 | 4 | 5 | 6 | 8 | 9; name: string; description: string; min: number; max: number; unit: string; convertToUseful?: (...args: string[]) => number | string | Record<string, number> | boolean[] | Record<string, number | undefined>; } export declare enum Modes { "01" = "01", "03" = "03", "04" = "04", "09" = "09" } export interface IParsedOBDResponse extends Partial<Pick<IObdPID, "mode" | "pid" | "name" | "unit">> { value?: number | string | Record<string, number> | boolean[]; } export type IObdPIDDescriptor = Omit<IObdPID, "convertToUseful">;