Search by

webservco / icarsoft

ariademur

A PHP library. Parses the text log files saved by iCarsoft car diagnostic tools into arrays: header, title, info, and either the module information or the live data frames.

Package info

github.com/webservco/icarsoft

pkg:composer/webservco/icarsoft

Statistics

Installs: 11

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v0.8.4 2024-06-22 20:14 UTC

This package is auto-updated.

Last update: 2026-10-12 15:05:28 UTC


README

A PHP library.

Parses the text log files saved by iCarsoft car diagnostic tools into arrays: header, title, info, and either the module information or the live data frames.

  • Requires: PHP 8.3+, ext-mbstring

Installation

composer require webservco/icarsoft

Usage

Live data log

use WebServCo\ICarsoft\Processors\Data\Processor;

// Throws RuntimeException if the file can't be read.
$processor = new Processor($filePath);
// Throws OutOfBoundsException or UnexpectedValueException if the file isn't in the expected format.
$processor->run();

$header = $processor->getHeader();
$title = $processor->getTitle();
$info = $processor->getInfo();
$frames = $processor->getFrames();

Each frame maps a parameter name to a list of readings. The number and its unit are kept apart:

[
    'Frame' => [['value' => '1', 'units' => null]],
    // A reading of "812 rpm".
    'Example parameter' => [['value' => '812', 'units' => 'rpm']],
]

Module information log

use WebServCo\ICarsoft\Processors\Info\Processor;

$processor = new Processor($filePath);
$processor->run();

// ['Example key' => 'value', ...]
$content = $processor->getContent();

getHeader(), getTitle() and getInfo() work the same way for both log types.

Contracts

Class Purpose
Processors\Data\Processor Live data logs, split into frames.
Processors\Info\Processor Module information logs, one key: value per line.
Processors\AbstractProcessor Reads the file and runs the parsing steps. Extend it for another log type.
Delimiter The separators the log files use between sections and values.

Namespaces are relative to WebServCo\ICarsoft\.

Notes

Some logs repeat a key. In the header, info and module content arrays the last value wins. Frames keep every value, so each parameter holds a list.

Fault code logs (Processors\Type::FAULT) aren't supported yet.

Development

# Lint.
composer lint
# Code style.
composer check:style
# Static analysis.
composer check:phpstan
composer check:phan
composer check:psalm
composer check:phpmd

License

MIT