(self)
| 168 | self._radio.version) |
| 169 | |
| 170 | def run(self): |
| 171 | while True: |
| 172 | command = self._cmd_queue.get() |
| 173 | |
| 174 | if command[1] == _RadioCommands.STOP: |
| 175 | with self._lock: |
| 176 | del self._rsp_queues[command[0]] |
| 177 | if len(self._rsp_queues) == 0: |
| 178 | self._radio.close() |
| 179 | _RadioManager.remove(self._devid) |
| 180 | return |
| 181 | elif command[1] == _RadioCommands.SEND_PACKET: |
| 182 | channel, address, datarate, data = command[2] |
| 183 | self._radio.set_channel(channel) |
| 184 | self._radio.set_address(address) |
| 185 | self._radio.set_data_rate(datarate) |
| 186 | ack = self._radio.send_packet(data) |
| 187 | self._rsp_queues[command[0]].put(ack) |
| 188 | elif command[1] == _RadioCommands.SET_ARC: |
| 189 | self._radio.set_arc(command[2]) |
| 190 | elif command[1] == _RadioCommands.SCAN_SELECTED: |
| 191 | datarate, address, selected, data = command[2] |
| 192 | self._radio.set_data_rate(datarate) |
| 193 | self._radio.set_address(address) |
| 194 | resp = self._radio.scan_selected(selected, data) |
| 195 | self._rsp_queues[command[0]].put(resp) |
| 196 | elif command[1] == _RadioCommands.SCAN_CHANNELS: |
| 197 | datarate, address, start, stop, packet = command[2] |
| 198 | self._radio.set_data_rate(datarate) |
| 199 | self._radio.set_address(address) |
| 200 | resp = self._radio.scan_channels(start, stop, packet) |
| 201 | self._rsp_queues[command[0]].put(resp) |
| 202 | |
| 203 | |
| 204 | class _RadioManager: |
nothing calls this directly
no test coverage detected