reformatted encoding algorithm

This commit is contained in:
strawmanbobi
2016-11-13 13:52:57 +08:00
parent c169499e3a
commit fb7c06afa6
40 changed files with 663 additions and 483 deletions

View File

@@ -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)

View File

@@ -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)

View File

@@ -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