code: def ReadUntil(self, expected_ids, *finish_ids):
          
          while True:
              cmd_id, header, data = self.Read(expected_ids + finish_ids)
              yield cmd_id, header, data
              if cmd_id in finish_ids:
                  break
docs: Useful wrapper around Read.