chiark / gitweb /
factory reset
authorian <ian>
Wed, 30 Aug 2006 16:18:11 +0000 (16:18 +0000)
committerian <ian>
Wed, 30 Aug 2006 16:18:11 +0000 (16:18 +0000)
hostside/factory-reset-svc [new file with mode: 0755]
hostside/nmra-packets.h

diff --git a/hostside/factory-reset-svc b/hostside/factory-reset-svc
new file mode 100755 (executable)
index 0000000..3034a79
--- /dev/null
@@ -0,0 +1,31 @@
+#!/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
index 2728caa6938b080dd5f40ee0abd16697516188f7..3d6b6072afa75014f8d2bee1d8d64539b5c8a189 100644 (file)
@@ -96,6 +96,13 @@ NMRA(svc_factoryreset, Anone, {
    */
   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