tk103

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: Apache-2.0 Imports: 8 Imported by: 0 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 tk103 is the TK103 / Coban (GPS103) text tracker protocol: frame reading, decoding into track.Message, and command framing. Frames end with ';':

##,imei:<imei>,A;                 login, answered LOAD
<imei>;                           heartbeat, answered ON
imei:<imei>,<keyword>,<yyMMddHHmm local>,<phone>,F|L,<hhmmss.sss UTC>,A|V,<ddmm.mmmm>,N|S,<dddmm.mmmm>,E|W,<knots>,<heading>,…;

Keywords become alerts: "help me" emergency, "low battery", "speed" over-speed, "stockade" geofence exit, "acc on"/"acc off" ignition, "ac alarm" main power removed, "sensor alarm" vibration, "door alarm" door open, "move" movement; "tracker" is a periodic report. Commands are {"text": "B"} sent as **,imei:<imei>,B; the protocol has no answer frame, so Command reports that none is expected and a command can only be known to be written, not carried out.

The profile (NewCodec; Profile):

commandTerminator: ";"   # default ";"; "" sends commands without it (as Traccar does)
namedCommands: {interval: "C,{seconds}s"}   # replaces a named command's text

Named commands (track.Named), Coban GPRS command letters: engineStop "J", engineResume "K", locate "B", interval "C,<seconds>s" (10 to 86400 s). Coban has no reboot over GPRS.

Index

Constants

This section is empty.

Variables

View Source
var (

	// Interval bounds the interval command, in seconds.
	Interval = track.IntervalRange{Min: 10, Max: 86400}
	// NamedActions are the named commands TK103 has: all but reboot.
	NamedActions = []string{track.ActionEngineStop, track.ActionEngineResume, track.ActionLocate, track.ActionInterval}
)

Named commands as Coban (GPS103) GPRS command letters.

Functions

func NewCodec

func NewCodec(raw json.RawMessage) (func() track.Codec, error)

NewCodec validates a profile (empty for the defaults) and returns a factory of codecs, one per connection.

Types

type Profile

type Profile struct {
	// CommandTerminator ends a command (default ";"); some firmware takes
	// commands only without it, others only with it.
	CommandTerminator *string `json:"commandTerminator,omitempty"`
	// NamedCommands replaces the text of a named command (the part after
	// "**,imei:<imei>,"). Placeholders {seconds} and {imei}; "" turns one
	// off.
	NamedCommands track.NamedTemplates `json:"namedCommands,omitempty"`
}

Profile is the manufacturer-variation settings.

Jump to

Keyboard shortcuts

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