From 8bed28f84a946958992246331b47f8921e3564c5 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Fri, 16 Oct 2015 15:40:49 +0200 Subject: Add module description --- csta/escape-service.go | 3 +++ parse/parse.go | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 csta/escape-service.go diff --git a/csta/escape-service.go b/csta/escape-service.go new file mode 100644 index 0000000..e4a86fa --- /dev/null +++ b/csta/escape-service.go @@ -0,0 +1,3 @@ +package csta + +const EscapeServiceOpcode = 51 diff --git a/parse/parse.go b/parse/parse.go index 3d74e58..f8ad251 100644 --- a/parse/parse.go +++ b/parse/parse.go @@ -41,7 +41,11 @@ func main() { if err != nil { fmt.Println(err) } - if opcode == csta.SystemStatusOpcode { + if m, ok := csta.Modules[opcode]; ok { + fmt.Println("Opcode:", m) + } + switch opcode { + case csta.SystemStatusOpcode: ss := &csta.SystemStatusArg{} asn1.Unmarshal(buf, ss) fmt.Println("Status", ss.SystemStatus) @@ -52,7 +56,10 @@ func main() { } fmt.Printf("%x\n", s) fmt.Printf("%x\n", res) - } else { + case csta.EscapeServiceOpcode: + fmt.Println("Escape") + fallthrough + default: unmarshal(s, &rose.Invoke{}) } case 0xa2: -- cgit v1.2.3