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 ¶
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 ¶
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.