aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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)
}