- self.curslave = databyte
- self.curdirection = cmd[8:].lower()
- elif cmd in ('STOP', 'START REPEAT'):
- # If this chunk was not for the correct slave, drop it.
- if self.options['address'] == 0:
- pass
- elif self.curslave != self.options['address']:
- self.packets = []
- return
-
- # If this chunk was not in the right direction, drop it.
- if self.options['direction'] == 'both':
- pass
- elif self.options['direction'] != self.curdirection:
- self.packets = []
- return
-
- # TODO: START->STOP chunks with both read and write (Repeat START)
- # Otherwise, send out the whole chunk of I²C packets.
- for p in self.packets:
- self.put(p[0], p[1], self.out_python, p[2])
+ direction = cmd[len('ADDRESS '):]
+ _, slave_addr = data
+ self.do_forward = self._need_to_forward(slave_addr, direction)
+ return