reformatted encoding algorithm
This commit is contained in:
@@ -73,7 +73,7 @@ def create_binary(ac_device):
|
||||
tags_max_size[i] = ac_device.tags[j].len;
|
||||
find = 1
|
||||
break
|
||||
|
||||
|
||||
if find == 0:
|
||||
f_head.write(struct.pack("H", 0xffff))
|
||||
# f.write(ac_device)
|
||||
|
||||
@@ -115,7 +115,7 @@ def printProtocol(file):
|
||||
else:
|
||||
mode = 1
|
||||
|
||||
print "{%d, \"%s\", %d, %d, %s}" % (index, i.getAttribute('bits'), \
|
||||
print "{%d, \"%s\", %d, %d, %s}" % (index, i.getAttribute('bits'),
|
||||
lsb, mode, i.firstChild.data)
|
||||
flag = IRDAData(int(i.getAttribute('bits')), lsb, mode, int(i.firstChild.data))
|
||||
irda_frame.append(flag)
|
||||
|
||||
@@ -97,7 +97,9 @@ def printProtocol(file):
|
||||
mode = 0
|
||||
flag = 0
|
||||
irda_frame = []
|
||||
flag_tab_dict = {"boot": 0, "stop": 1, "separator": 2, "one": 3, "zero": 4, "flip": 5, "two": 6, "three": 7, "four": 8, "five": 9, "six": 10, "seven": 11, "eight": 12, "nine": 13, "A": 14, "B": 15, "C": 16, "D": 17, "E": 18, "F": 19}
|
||||
flag_tab_dict = {"boot": 0, "stop": 1, "separator": 2, "one": 3, "zero": 4, "flip": 5, "two": 6, "three": 7,
|
||||
"four": 8, "five": 9, "six": 10, "seven": 11, "eight": 12, "nine": 13,
|
||||
"A": 14, "B": 15, "C": 16, "D": 17, "E": 18, "F": 19}
|
||||
for i in frame[0].childNodes:
|
||||
if i.nodeType == i.ELEMENT_NODE:
|
||||
index += 1
|
||||
|
||||
Reference in New Issue
Block a user