def __init__(self):
self.oldsck = 1
- self.rxcount = 0
+ self.bitcount = 0
self.rxdata = 0
self.bytesreceived = 0
continue
# If this is the first bit, save timestamp.
- if self.rxcount == 0:
+ if self.bitcount == 0:
self.time = samplenum
# Receive bit into our shift register.
if sdata == 1:
- self.rxdata |= 1 << (7 - self.rxcount)
+ self.rxdata |= 1 << (7 - self.bitcount)
- self.rxcount += 1
+ self.bitcount += 1
# Continue to receive if not a byte yet.
- if self.rxcount != 8:
+ if self.bitcount != 8:
continue
# self.put(0, 0, self.out_proto, out_proto) # TODO
# Reset decoder state.
self.rxdata = 0
- self.rxcount = 0
+ self.bitcount = 0
# Keep stats for summary.
self.bytesreceived += 1