]> git.zndr.dk Git - dotfiles.git/commitdiff
Add defines for BROADCAST
authorJannik ZANDER <jzander@grundfos.com>
Fri, 17 Jun 2016 14:57:47 +0000 (16:57 +0200)
committerJannik ZANDER <jzander@grundfos.com>
Fri, 17 Jun 2016 14:57:47 +0000 (16:57 +0200)
.local/bin/gf.py
.local/bin/gf_config.py

index 9565536b139cbdf086bed8d0461fccedfd20bffc..79fcfdeea17e99bab6054cb0224584ead605ea2c 100755 (executable)
@@ -120,11 +120,11 @@ def process_header(line):
   le,line=readbyte(line)
   da,line=readbyte(line)
   sa,line=readbyte(line)
-  if sd==gf.DATA_REQUEST and da==0xFE:
+  if sd==gf.DATA_REQUEST and da==gf.DA_BROADCAST_CONNECT:
     typ="CONNECTION_REQUEST ===>"
-  if sd==gf.DATA_REQUEST and da==0xFF:
+  if sd==gf.DATA_REQUEST and da==gf.DA_BROADCAST_REQUEST:
     typ="DATA_REQUEST  ===>"
-  if sd==gf.DATA_MESSAGE and da==0xF7:
+  if sd==gf.DATA_MESSAGE and da==gf.DA_BROADCAST_MESSAGE:
     typ="DATA_MESSAGE  ===>"
   print(typ)
   print("Length:",le,"Destination Addr:",da,"Source Addr:",sa)
@@ -155,9 +155,9 @@ def process_data(line,le,size1,size2):
       tmp,line=readbyte(line)
       val[i]=(val[i]<<8)+tmp
     if size1>0 and size2>0:
-        print("Id:",ids[i],repr(gf.params[cl][ids[i]]),"=",val[i])
+      print("Id:",ids[i],repr(gf.params[cl][ids[i]]),"=",val[i])
     elif size1>0:
-        print("Id:",ids[i],repr(gf.params[cl][ids[i]]))
+      print("Id:",ids[i],repr(gf.params[cl][ids[i]]))
     elif size2>0:
       print("=",val[i])
   return ids,val,line
index e48b60a788f76e1716c8acdb8e05d5593d13579e..6dcd853c3e4637366a312a1f9182a537c8680f78 100644 (file)
@@ -6,6 +6,10 @@ DATA_REQUEST=0x27
 DATA_MESSAGE=0x26
 DATA_REPLY=0x24
 
+DA_BROADCAST_CONNECT=0xFE
+DA_BROADCAST_REQUEST=0xFF
+DA_BROADCAST_MESSAGE=0xF7
+
 OS_GET=0
 OS_SET=2
 OS_INFO=3