scantool

package
v2.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2026 License: MIT Imports: 10 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scantool drives ScanTool.net STN11xx/STN21xx based adapters (OBDLink SX/EX, generic STN1170/STN2120 boards) over their virtual COM port. Importing the package registers the "OBDLink SX", "OBDLink EX", "STN1170" and "STN2120" adapters.

The device is a command/response ELM-compatible interpreter: frames are transmitted with STPX (hex header/data, optional t: timeout and r: reply count) and any reply frames come back as response lines terminated by the '>' prompt — there is no free-running monitor. Send therefore performs the whole exchange synchronously and delivers reply frames to the bus before returning; the reply-count hint is taken from gocan.ExpectedResponses and the timeout from the context deadline.

Open hunts for the adapter across the known baud rates and switches it to 2 Mbit with STBR before running the init sequence (echo/spaces off, STP protocol + bit-rate, headers on, flow control off, ATCF/ATCM filter).

Index

Constants

View Source
const (
	OBDLinkSX = "OBDLink SX"
	OBDLinkEX = "OBDLink EX"
	STN1170   = "STN1170"
	STN2120   = "STN2120"
)

Variables

This section is empty.

Functions

func New

func New(name string, cfg gocan.Config) (gocan.Adapter, error)

Types

type Scantool

type Scantool struct {
	// contains filtered or unexported fields
}

func (*Scantool) Close

func (st *Scantool) Close() error

func (*Scantool) Open

func (st *Scantool) Open(ctx context.Context, bus *gocan.Bus) error

func (*Scantool) Send

func (st *Scantool) Send(ctx context.Context, f gocan.Frame) error

Send transmits one frame with STPX and processes the response lines. Reply frames ride in the command response (there is no monitor mode), so they are delivered to the bus here before Send returns.

func (*Scantool) SetFilter

func (st *Scantool) SetFilter(filters []uint32) error

SetFilter reprograms the ATCF/ATCM acceptance filter at runtime; the protocol must be closed (STPC) while setting it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL