(self)
| 62 | self.need_data = True |
| 63 | |
| 64 | def run(self): |
| 65 | while self.need_data: |
| 66 | if self.package_num % 256 == 0: |
| 67 | self.package_num = 0 |
| 68 | |
| 69 | package = list() |
| 70 | package.append(0xA0) |
| 71 | package.append(self.package_num) |
| 72 | for i in range(2, self.package_size - 1): |
| 73 | package.append(randint(0, 255)) |
| 74 | package.append(0xC0) |
| 75 | logging.debug('package is %s' % ' '.join([str(x) for x in package])) |
| 76 | self.write(self.port, bytes(package)) |
| 77 | |
| 78 | self.package_num = self.package_num + 1 |
| 79 | time.sleep(self.delay) |
nothing calls this directly
no outgoing calls
no test coverage detected