New Model #11168 » uv17Pro-add-uv18Max.patch
chirp/drivers/baofeng_uv17Pro.py 2024-02-28 15:30:22.977713484 +0100 | ||
---|---|---|
d = bfc._rawrecv(radio, radio.BLOCK_SIZE + 4)
|
||
LOG.debug("Response Data= " + util.hexprint(d))
|
||
d = _crypt(1, d[4:])
|
||
d = _crypt(radio._enc_key_idx, d[4:])
|
||
# Aggregate the data
|
||
data += d
|
||
... | ... | |
for addr in range(MEM_START, MEM_START + MEM_SIZE,
|
||
radio.BLOCK_SIZE):
|
||
data = radio_mem[data_addr:data_addr + radio.BLOCK_SIZE]
|
||
data = _crypt(1, data)
|
||
data = _crypt(radio._enc_key_idx, data)
|
||
data_addr += radio.BLOCK_SIZE
|
||
frame = radio._make_frame(b"W", addr, radio.BLOCK_SIZE, data)
|
||
... | ... | |
_has_when_to_send_aniid = True
|
||
_vfoscan = False
|
||
_has_gps = False
|
||
_enc_key_idx = 1
|
||
_has_voxsw = False
|
||
_has_pilot_tone = False
|
||
_has_send_id_delay = False
|
||
... | ... | |
VALID_BANDS = [UV17Pro._airband, UV17Pro._vhf_range, UV17Pro._vhf2_range,
|
||
UV17Pro._uhf_range, UV17Pro._uhf2_range]
|
||
def check_set_memory_immutable_policy(self, existing, new):
|
||
if (self._airband[0] <= new.freq <= self._airband[1] and
|
||
new.mode == 'AM'):
|
||
# This is valid, so mark mode as immutable so it doesn't get
|
||
# blocked, and let the radio override it during set.
|
||
new.immutable.append('mode')
|
||
existing.immutable = []
|
||
elif existing.mode == 'AM' and new.mode in self.MODES:
|
||
# If we're going from a forced-AM channel to some valid one,
|
||
# clear immutable so we allow the change.
|
||
try:
|
||
existing.immutable.remove('mode')
|
||
except ValueError:
|
||
pass
|
||
super().check_set_memory_immutable_policy(existing, new)
|
||
@directory.register
|
||
class UV18ProMaxGPS(UV17Pro):
|
||
VENDOR = "Baofeng"
|
||
MODEL = "UV-18ProMAXGPS"
|
||
_enc_key_idx = 6 # "RVB " key used
|
||
_has_support_for_banknames = True # Yes
|
||
_has_workmode_support = True # No idea
|
||
_magic = MSTRING_UV17PROGPS # ANS: 0x06 (ACK)
|
||
_magics = [(b"\x46", 16),
|
||
# ANS: "\x016\x01t\x04\x00\x05 \x02\x00\x02`\x01\x03P\x03"
|
||
# (\x01\x03 may be SW version 1.03)
|
||
(b"\x4d", 7), # A: UV18PRO
|
||
(b"SEND\x23\x06\x04\x11\x03\x0f\x09\x09\x06" +
|
||
b"\x0e\x0f\x03\x09\x08\x02\x01\x06\x11\x12\x0e\x00", 1)]
|
||
# 21 Bytes after SEND seem to be random, ANS: 0x06
|
||
_has_when_to_send_aniid = False
|
||
_vfoscan = True # No idea
|
||
_has_gps = True # Yes
|
||
_has_voxsw = True # No idea
|
||
_has_pilot_tone = True # No idea
|
||
_has_send_id_delay = True # No idea
|
||
_has_skey2_short = True # No idea
|
||
VALID_BANDS = [UV17Pro._airband, UV17Pro._vhf_range, UV17Pro._vhf2_range,
|
||
UV17Pro._uhf_range, UV17Pro._uhf2_range]
|
||
def check_set_memory_immutable_policy(self, existing, new):
|
||
if (self._airband[0] <= new.freq <= self._airband[1] and
|
||
new.mode == 'AM'):
|