global td
global master
global speed
-
td=td+[ts.timestamp()]
master=master+[1+(sa-31)/10]
- for i in range(4):
- speed[i]=speed[i]+[val5[i]/254]
+ for i in range(len(ids5)):
+ if ids5[i] in range(67,71):
+ speed[ids5[i]-67]=speed[ids5[i]-67]+[val5[i]/254]
return td,master,speed
-# section: checkline {{{1
+# section: checkcrc {{{1
######################################################
-def checkline(line):
+def checkcrc(line):
ok=False
if len(line)>16 and not "ERR" in line.upper():
ok=True
print(ts)
return ts,line
+# section: checkglowpan {{{1
+######################################################
+def checkglowpan(line):
+ isgenidata=False
+ line=line[32:]
+ #print(repr(line))
+ mac_hi,line=readbyte(line)
+ mac_lo,line=readbyte(line)
+ #print(mac_hi,mac_lo)
+ #print(repr(line))
+ if mac_hi==8 and mac_lo==4:
+ isgenidata=True
+ #print(repr(line))
+ #print(isgenidata)
+ return isgenidata,line
+
# section: readbyte {{{1
######################################################
def readbyte(line):
# section: process_header {{{1
######################################################
def process_header(line):
+
+# print(repr(line))
+
sd,line=readbyte(line)
if sd==gf.DATA_REQUEST:
typ="DATA_REQUEST --->"
le,line=readbyte(line)
os=(le&0xC0)>>6
le=le&0x3F
- print(gf.operation[os],"Class:",cl,"Length:",le)
+ print(gf.operation[os],"Cl.",cl,"Len.",le)
+# print(gf.operation[os],"Cl. {02}",cl)
return cl,os,le,line
# section: process_data {{{1
string=''.join(chr(i) for i in val)
string=string[:-1]
if size1>0 and size2>0:
- print(gf.params[cl][ids],"=",repr(string))
+ print("Id:",ids,repr(gf.params[cl][ids]),"=",repr(string))
elif size1>0:
- print(gf.params[cl][ids])
+ print("Id:",ids,repr(gf.params[cl][ids]))
elif size2>0:
print("=",repr(string))
return ids,val,line
val[i],line=readbyte(line)
if size1>0 and size2>0:
- print(gf.params[cl][ids],"=",val)
+ print("Id:",ids,repr(gf.params[cl][ids]),"=",val)
elif size1>0:
- print(gf.params[cl][ids])
+ print("Id:",ids,repr(gf.params[cl][ids]))
elif size2>0:
print("=",val)
return ids,val,line
global cl
# Check if timestamp exists
ts,line=readtimestamp(line)
+ # Filter non geni data if glowpan frame
+ isgenidata,line=checkglowpan(line)
+ if not isgenidata: return
# Check if line is ok
- ok=checkline(line)
- if not ok: return
- # Process telegram
+ iscrcok=checkcrc(line)
+ if not iscrcok: return
+ # Process geni data
typ,ds,le,da,sa,line=process_header(line)
numbytes=le-2
while numbytes>0 and len(line)>=2*numbytes:
# print(line)
process_telegram(line)
-# section: plotting {{{1
+# section: plot {{{1
######################################################
# Calculate timedelta
-# dotfiles
+# dotfiles
What you need to do on the new box is this:
$ cd $HOME
- $ alias dot='git --git-dir=$HOME/.dot --work-tree=$HOME'
- $ git init --bare $HOME/.dot
- $ dot remote add origin git@bitbucket.org:jannikz/dotfiles.git
- $ dot fetch
- $ dot reset --hard origin/master
- $ dot branch -u origin/master
\ No newline at end of file
+ $ git init
+ $ git remote add origin https://github.com/jannikz/dotfiles.git
+ $ git fetch origin master
+ $ git reset --hard origin/master
+ $ git branch -u origin/master