Chapter 7: Wired UART Transport and Force Stop (v0.3.5 update) - zymbia-carpm/garagepro_sdk GitHub Wiki

This update (SDK version 32, 0.3.5) adds a wired UART (serial) transport, a way to stop a scan on demand, and improved reliability for NLC400 BLE scanners. All changes are additive — existing integrations continue to work unchanged.

Module 1: Wired UART (serial) transport

Alongside BLE and classic Bluetooth, the SDK can now run diagnostics over a wired serial (UART) connection — for example an on-board OBD serial port on a head unit or embedded device. You provide only the serial device path and baud rate; the SDK opens, manages and closes the port for you.

Step 1: Create a UART connection

GProDeviceConnection connection = GProDeviceConnection.forUart("/dev/ttyS1", 115200);

The first argument is the serial device node (e.g. /dev/ttyS1) and the second is the baud rate (e.g. 115200).

Step 2: Pass it to the scan process and start as usual

GProScanProcess gProScanProcess = new GProScanProcess(context, connection, scanListener);
gProScanProcess.initScan(makeName, registrationNumber, jobCardId);

Live data works the same way:

GProLiveScanProcess gProLiveScanProcess = new GProLiveScanProcess(context, connection, liveListener);

NOTE — Every result and failure is delivered through the same 'GProScanListener' / 'GProLiveScanListener' callbacks you already use. VIN check, full scan, clear codes and live data are all supported over UART.

Module 2: Stop a scan on demand (Force Stop)

You can now stop an in-progress scan or live scan immediately and release the connection.

Change 1: Call 'forceStop()' to stop and release

gProScanProcess.forceStop();

The same method is available on 'GProLiveScanProcess'.

Change 2 (optional): Get notified once the connection is closed

Pass a 'GProConnectionClosedListener' to be told, exactly once, after the connection has been closed:

gProScanProcess.forceStop(new GProConnectionClosedListener() {
    @Override
    public void onConnectionClosed(String message) {
        Log.d(TAG, "Connection closed: " + message);
        // safe to reconnect / start a new scan from here
    }
});

NOTE — The listener is passed as a parameter to 'forceStop(...)'; it does not change your existing 'GProScanListener' / 'GProLiveScanListener'. The callback is delivered on the main thread.

Module 3: NLC400 BLE reliability

Connecting to and retrieving data from NLC400 BLE scanners is now more reliable. No integration changes are required — continue to connect exactly as before.

Upgrade

implementation ('com.github.zymbia-carpm:garagepro_sdk:v0.3.5') {
    transitive = true
}

Fully backward compatible — no code changes are required for existing integrations.