ft50: Fix clone out for python3

Note this is not 100% confirmed by the reporter due to some cable or
driver issues, but this is definitely more right than it was, and will
be updated if needed.

Fixes #10824
This commit is contained in:
Dan Smith 2023-09-05 14:53:53 -07:00 committed by Dan Smith
parent 30c3c20590
commit 7ac0a15981
3 changed files with 10 additions and 8 deletions

View File

@ -592,6 +592,7 @@ def _clone_out(radio):
def __clone_out(radio):
pipe = radio.pipe
pipe.timeout = 1
block_lengths = radio._block_lengths
total_written = 0
@ -609,27 +610,27 @@ def __clone_out(radio):
for block in radio._block_lengths:
blocks += 1
data = radio.get_mmap()[pos:pos + block]
# LOG.debug(util.hexprint(data))
# LOG.debug("Sending block: %s" % util.hexprint(data))
recvd = ""
recvd = b""
# Radio echos every block received
for byte in data:
time.sleep(0.01)
pipe.write(byte)
pipe.write(bytes([byte]))
# flush & sleep so don't loose ack
pipe.flush()
time.sleep(0.015)
recvd += pipe.read(1) # chew the echo
# LOG.debug(util.hexprint(recvd))
# LOG.debug("Echo was %s" % util.hexprint(recvd))
LOG.debug("Bytes sent: %i" % len(data))
# Radio does not ack last block
if (blocks < 8):
buf = pipe.read(block)
LOG.debug("ACK attempt: " + util.hexprint(buf))
if buf and buf[0] != chr(yaesu_clone.CMD_ACK):
if buf and buf[0] != yaesu_clone.CMD_ACK:
buf = pipe.read(block)
if not buf or buf[-1] != chr(yaesu_clone.CMD_ACK):
if not buf or buf[-1] != yaesu_clone.CMD_ACK:
raise errors.RadioError("Radio did not ack block %i" % blocks)
total_written += len(data)

View File

@ -385,7 +385,7 @@
| <a name="Yaesu_FT-4VR"></a> Yaesu_FT-4VR | [Implied by Yaesu_FT-4XE](#user-content-Yaesu_FT-4XE) | 24-Dec-2022 | Yes | 0.01% |
| <a name="Yaesu_FT-4XE"></a> Yaesu_FT-4XE | Unit tested; needs confirm | 24-Dec-2022 | Yes | 0.14% |
| <a name="Yaesu_FT-4XR"></a> Yaesu_FT-4XR | [Implied by Yaesu_FT-4XE](#user-content-Yaesu_FT-4XE) | 24-Dec-2022 | Yes | 0.11% |
| <a name="Yaesu_FT-50"></a> Yaesu_FT-50 | | | Yes | 0.04% |
| <a name="Yaesu_FT-50"></a> Yaesu_FT-50 | [Reported working](https://chirp.danplanet.com/issues/10824) | 5-Sep-2023 | Yes | 0.04% |
| <a name="Yaesu_FT-60"></a> Yaesu_FT-60 | N0EYE | 9-Jan-2023 | Yes | 0.49% |
| <a name="Yaesu_FT-65E"></a> Yaesu_FT-65E | [@kwirk](https://github.com/kwirk) | 27-Jan-2023 | Yes | 0.08% |
| <a name="Yaesu_FT-65R"></a> Yaesu_FT-65R | [Reported working](https://chirp.danplanet.com/issues/10266) | 13-Jan-2022 | Yes | 0.18% |
@ -424,7 +424,7 @@
**Drivers:** 419
**Tested:** 86% (364/55) (93% of usage stats)
**Tested:** 87% (365/54) (93% of usage stats)
**Byte clean:** 90% (379/40)

View File

@ -348,6 +348,7 @@ Yaesu_FT-4VR,+Yaesu_FT-4XE,24-Dec-2022
Yaesu_FT-65R,#10266,13-Jan-2022
Yaesu_FT-65E,@kwirk,27-Jan-2023
Yaesu_FT-25R,+Yaesu_FT-4XE,24-Dec-2022
Yaesu_FT-50,#10824,5-Sep-2023
Yaesu_FT-60,N0EYE,9-Jan-2023
Yaesu_FT-70D,@n8sqt,05-Dec-2022
Yaesu_FT-7800_7900,@kk7ds,24-Oct-2022