- lb = len(burst)
- try:
- nbits = {25:12, 31:15, 41:20}[len(burst)]
- except IndexError:
- pass
- else:
- detected = True
- if detected:
- print('Sony {}bit'.format(nbits))
-
- elif burst[0] < 1200:
- print('Philips RC-5')
- detected = True
- if not detected:
- print('Unknown protocol')
+ ok = True
+ print('Sony {}bit'.format(nbits))
+
+ if not ok and near(burst[0], 889): # Maybe RC-5
+ if near(duration, 24892) and near(max(burst), 1778):
+ print('Philps RC-5')
+ ok = True
+
+ if not ok and near(burst[0], 2666) and near(burst[1], 889): # RC-6?
+ if near(duration, 22205) and near(burst[1], 889) and near(burst[2], 444):
+ print('Philips RC-6 mode 0')
+ ok = True
+
+ if not ok and near(burst[0], 2056) and near(burst[1], 945):
+ if near(duration, 19000):
+ print('Microsoft MCE edition protocol. Not yet supported.')
+ # Constant duration, variable burst length, presumably bi-phase
+ print('Protocol start {} {} Burst length {} duration {}'.format(burst[0], burst[1], lb, duration))
+ ok = True
+
+ if not ok and near(burst[0], 4500) and near(burst[1], 4500): # Samsung?
+ print('Unsupported protocol. Samsung?')
+ ok = True
+
+ if not ok and near(burst[0], 3500) and near(burst[1], 1680): # Panasonic?
+ print('Unsupported protocol. Panasonic?')
+ ok = True
+
+ if not ok:
+ print('Unknown protocol start {} {} Burst length {} duration {}'.format(burst[0], burst[1], lb, duration))