id = 'qi'
name = 'Qi'
longname = 'Qi charger protocol'
- desc = 'Protocol used by Qi receiver'
+ desc = 'Protocol used by Qi receiver.'
license = 'gplv2+'
inputs = ['logic']
outputs = ['qi']
)
def __init__(self):
+ self.reset()
+
+ def reset(self):
self.samplerate = None
self.reset_variables()
'C: PC = %d MP = %d P = %d C = %d WS = %d WO = %d' %
(powerclass, maxpower, prop, count, winsize, winoff),
'Configuration', 'C'])
- elif self.packet[0] == 0x71: # Identification
+ elif self.packet[0] == 0x71: # Identification
version = '%d.%d' % ((self.packet[1] & 0xf0) >> 4, self.packet[1] & 0x0f)
mancode = '%02x%02x' % (self.packet[2], self.packet[3])
devid = '%02x%02x%02x%02x' % (self.packet[4] & ~0x80,
if not self.samplerate:
raise SamplerateError('Cannot decode without samplerate.')
- (qi,) = self.wait({'skip': 1})
+ (qi,) = self.wait()
self.handle_transition(self.samplenum, qi == 0)
while True:
prev = self.samplenum