react-native-obd-retriver
Version:
A React Native hook library to manage Bluetooth Low Energy connections and communication with ELM327 OBD-II adapters.
52 lines • 1.37 kB
TypeScript
/**
* Defines the structure for configuring CAN protocol headers and filters.
*/
export interface HeaderFormatConfig {
format: 'CAN' | 'ISO' | 'KWP' | 'J1850' | 'OTHER';
addressingMode?: 'physical' | 'functional';
defaultTxHeader?: string;
defaultRxHeader?: string;
defaultFilter?: string;
defaultMask?: string;
}
/**
* Defines the structure for configuring message timing parameters.
*/
export interface TimingConfig {
p1Max: number;
p2Max: number;
p3Min: number;
p4Min: number;
adaptiveMode: 0 | 1 | 2;
responseTimeoutMs: number;
isoW1?: number;
isoW2?: number;
isoW3?: number;
isoW4?: number;
isoW5?: number;
}
/**
* Defines the structure for configuring ISO-TP (CAN) flow control.
*/
export interface FlowControlConfig {
blockSize: number;
separationTime: number;
flowControlHeader?: string;
flowControlMode: 0 | 1 | 2;
}
/**
* Defines the overall configuration for a specific OBD-II protocol.
*/
export interface ProtocolConfig {
protocolNumber: number;
description: string;
baudRate: number;
headerFormatConfig?: HeaderFormatConfig;
flowControlEnabled: boolean;
flowControlConfig?: FlowControlConfig;
timing: TimingConfig;
initSequence?: string[];
supportedModes: string[];
errorPatterns: RegExp[];
}
//# sourceMappingURL=types.d.ts.map