--- /dev/null
+#!/bin/sh
+
+set -e
+
+if [ $# != 1 ]; then cat >&2 <<END; exit 1; fi
+ usage:
+ ./factory-reset-svc /dev/ttyS0
+END
+
+port="$1"; shift
+
+ho () { ./hostside-old -s"$port" -w20000 -i0 -d "$@"; }
+
+# Packet Sequence for Command Stations/Programmers using
+# Physical Register Addressing
+# RP 9.2.3 E l.166-
+# as mandated by Decoder Factory Reset
+# RP 9.2.3 E l.276-
+
+rc () { ho -i10 "$@"; sleep 1; }
+
+ho command 10
+sleep 1
+ho command 11
+sleep 1
+rc reset
+rc svc_pagepreset
+rc reset
+rc reset
+rc svc_factoryreset
+rc reset
*/
CONST(0x7f, 0x40);
})
+NMRA(svc_pagepreset, Anone, {
+ /* Service Mode Page Preset Instruction
+ * RP 9.2.3 E l.90-91
+ * used in various packet sequences.
+ */
+ CONST(0x7d, 0x01);
+})
#undef Aint
#undef Abitmap