aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2015-06-26 15:16:19 +0200
committerDimitri Sokolyuk <demon@dim13.org>2015-06-26 15:16:19 +0200
commitec9d807316f573d692c7a54cf7dadf62ab697180 (patch)
treecb0c802c5e683ce714ab1fbe9953128939f715fd /misc
parentfc721495cf739df568ed9cc523941fe32d22bc7e (diff)
Add partial response
Diffstat (limited to 'misc')
-rw-r--r--misc/main.go37
1 files changed, 27 insertions, 10 deletions
diff --git a/misc/main.go b/misc/main.go
index cc23b9f..1bc9897 100644
--- a/misc/main.go
+++ b/misc/main.go
@@ -141,6 +141,18 @@ var status = []byte{
* 0A 01 02 networkInterface
*/
+/* Request CO lines response
+ * A2 17 ROSE-ResultReturn
+ * 02 02 00 E0 invokeId: 224
+ * 30 11 result
+ * 02 01 33 opcode local: 51
+ * 7E 0C
+ * A1 0A
+ * A4 08
+ * A4 06
+ * 04 04 30 41 31 36 OCTET STRING: '0A16'
+ */
+
var co = []byte{
0xA1, 0x16,
0x02, 0x02, 0x00, 0xE0,
@@ -218,19 +230,20 @@ func dump(b []byte) {
fmt.Println(hex.Dump(b))
}
-func Ask(c net.Conn, b []byte) []byte {
+func Ask(c net.Conn, out []byte) []byte {
log.Println("Ask")
- dump(b)
- send(c, b)
- r := recv(c)
- log.Println("Reply length", len(r))
- dump(r)
- return r
+ dump(out)
+ send(c, out)
+ in := recv(c)
+ log.Printf("Packet length: 0x%.2X\n", len(in))
+ dump(in)
+ return in
}
func Status(c net.Conn) {
log.Println("Status")
in := recv(c)
+ log.Printf("Packet length: 0x%.2X\n", len(in))
dump(in)
out := status
out[4] = in[4]
@@ -249,9 +262,13 @@ func main() {
Status(conn)
defer Ask(conn, release)
- //Ask(conn, co)
- //Status(conn)
+ Ask(conn, co)
+ Status(conn)
//Ask(conn, ext)
- //Status(conn)
+ Status(conn)
+ Status(conn)
+ Status(conn)
+ Status(conn)
+ Status(conn)
}