# section: process_string {{{1
######################################################
-def process_string(line,le):
- val=[0]*le
- ids,line=readbyte(line)
- for i in range(0,le-1):
+def process_string(line,le,size1,size2):
+ ids=[0]*size1
+ val=[0]*size2
+ if size1>0:
+ ids,line=readbyte(line)
+ for i in range(0,size2):
val[i],line=readbyte(line)
string=''.join(chr(i) for i in val)
- print("Id:",ids, "Value:",string)
+
+ if size1>0 and size2>0:
+ print("Id:",ids,"Value:",val,"String:",repr(string[:-1]))
+ elif size1>0:
+ print("Id:",ids)
+ elif size2>0:
+ print("Value:",val,"String:",repr(string[:-1]))
return ids,string,line
# section: process_object {{{1
# section: class 3 {{{2
elif cl==3 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
ids3,val3,line=process_data(line,ale,1,0)
- elif cl==3 and ds==gf.DATA_REPLY and os==gf.OS_SET:
- ids3,val3,line=process_data(line,ale,0,0)
elif cl==3 and ds==gf.DATA_REQUEST and os==gf.OS_INFO:
ids3,val3,line=process_data(line,ale,1,0)
elif cl==3 and ds==gf.DATA_REPLY and os==gf.OS_INFO:
ids4,val4,line=process_data(line,ale,0,1)
elif cl==4 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
ids4,val4,line=process_data(line,ale,1,1)
- elif cl==4 and ds==gf.DATA_REPLY and os==gf.OS_SET:
- ids4,val4,line=process_data(line,ale,0,0)
elif cl==4 and ds==gf.DATA_REQUEST and os==gf.OS_INFO:
ids4,val4,line=process_data(line,ale,1,0)
elif cl==4 and ds==gf.DATA_REPLY and os==gf.OS_INFO:
ids5,val5,line=process_data(line,ale,0,1)
elif cl==5 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
ids5,val5,line=process_data(line,ale,1,1)
- elif cl==5 and ds==gf.DATA_REPLY and os==gf.OS_SET:
- ids5,val5,line=process_data(line,ale,0,0)
elif cl==5 and ds==gf.DATA_REQUEST and os==gf.OS_INFO:
ids5,val5,line=process_data(line,ale,1,0)
elif cl==5 and ds==gf.DATA_REPLY and os==gf.OS_INFO:
for i in range(4):
speed[i]=speed[i]+[val5[i]/254]
# section: class 7 {{{2
-# elif cl==7:
-# ids7,val7,line=process_string(line,ale)
+ elif cl==7 and ds==gf.DATA_REQUEST and os==gf.OS_GET:
+ ids7,val7,line=process_string(line,ale,1,0)
+ elif cl==7 and ds==gf.DATA_REPLY and os==gf.OS_GET:
+ ids7,val7,line=process_string(line,ale,0,ale)
+ elif cl==7 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
+ ids7,val7,line=process_string(line,ale,1,ale-1)
# section: class 10 {{{2
# elif cl==10:
# ids10,val10,line=process_object(line,ale)
ids11,val11,line=process_data(line,ale,0,2)
elif cl==11 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
ids11,val11,line=process_data(line,ale,1,2)
- elif cl==11 and ds==gf.DATA_REPLY and os==gf.OS_SET:
- ids11,val11,line=process_data(line,ale,0,0)
elif cl==11 and ds==gf.DATA_REQUEST and os==gf.OS_INFO:
ids11,val11,line=process_data(line,ale,1,0)
elif cl==11 and ds==gf.DATA_REPLY and os==gf.OS_INFO:
ids12,val12,line=process_data(line,ale,0,2)
elif cl==12 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
ids12,val12,line=process_data(line,ale,1,2)
- elif cl==12 and ds==gf.DATA_REPLY and os==gf.OS_SET:
- ids12,val12,line=process_data(line,ale,0,0)
elif cl==12 and ds==gf.DATA_REQUEST and os==gf.OS_INFO:
ids12,val12,line=process_data(line,ale,1,0)
elif cl==12 and ds==gf.DATA_REPLY and os==gf.OS_INFO:
ids13,val13,line=process_data(line,ale,0,2)
elif cl==13 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
ids13,val13,line=process_data(line,ale,1,2)
- elif cl==13 and ds==gf.DATA_REPLY and os==gf.OS_SET:
- ids13,val13,line=process_data(line,ale,0,0)
elif cl==13 and ds==gf.DATA_REQUEST and os==gf.OS_INFO:
ids13,val13,line=process_data(line,ale,1,0)
elif cl==13 and ds==gf.DATA_REPLY and os==gf.OS_INFO:
ids14,val14,line=process_data(line,ale,0,3)
elif cl==14 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
ids14,val14,line=process_data(line,ale,1,3)
- elif cl==14 and ds==gf.DATA_REPLY and os==gf.OS_SET:
- ids14,val14,line=process_data(line,ale,0,0)
elif cl==14 and ds==gf.DATA_REQUEST and os==gf.OS_INFO:
ids14,val14,line=process_data(line,ale,1,0)
elif cl==14 and ds==gf.DATA_REPLY and os==gf.OS_INFO:
ids15,val15,line=process_data(line,ale,0,3)
elif cl==15 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
ids15,val15,line=process_data(line,ale,1,3)
- elif cl==15 and ds==gf.DATA_REPLY and os==gf.OS_SET:
- ids15,val15,line=process_data(line,ale,0,0)
elif cl==15 and ds==gf.DATA_REQUEST and os==gf.OS_INFO:
ids15,val15,line=process_data(line,ale,1,0)
elif cl==15 and ds==gf.DATA_REPLY and os==gf.OS_INFO:
ids16,val16,line=process_data(line,ale,0,3)
elif cl==16 and (ds==gf.DATA_REQUEST or ds==gf.DATA_MESSAGE) and os==gf.OS_SET:
ids16,val16,line=process_data(line,ale,1,3)
- elif cl==16 and ds==gf.DATA_REPLY and os==gf.OS_SET:
- ids16,val16,line=process_data(line,ale,0,0)
elif cl==16 and ds==gf.DATA_REQUEST and os==gf.OS_INFO:
ids16,val16,line=process_data(line,ale,1,0)
elif cl==16 and ds==gf.DATA_REPLY and os==gf.OS_INFO: