149 |
149 |
d = bfc._rawrecv(radio, radio.BLOCK_SIZE + 4)
|
150 |
150 |
|
151 |
151 |
LOG.debug("Response Data= " + util.hexprint(d))
|
152 |
|
d = _crypt(1, d[4:])
|
|
152 |
d = _crypt(radio._enc_key_idx, d[4:])
|
153 |
153 |
|
154 |
154 |
# Aggregate the data
|
155 |
155 |
data += d
|
... | ... | |
181 |
181 |
for addr in range(MEM_START, MEM_START + MEM_SIZE,
|
182 |
182 |
radio.BLOCK_SIZE):
|
183 |
183 |
data = radio_mem[data_addr:data_addr + radio.BLOCK_SIZE]
|
184 |
|
data = _crypt(1, data)
|
|
184 |
data = _crypt(radio._enc_key_idx, data)
|
185 |
185 |
data_addr += radio.BLOCK_SIZE
|
186 |
186 |
|
187 |
187 |
frame = radio._make_frame(b"W", addr, radio.BLOCK_SIZE, data)
|
... | ... | |
242 |
242 |
_has_when_to_send_aniid = True
|
243 |
243 |
_vfoscan = False
|
244 |
244 |
_has_gps = False
|
|
245 |
_enc_key_idx = 1
|
245 |
246 |
_has_voxsw = False
|
246 |
247 |
_has_pilot_tone = False
|
247 |
248 |
_has_send_id_delay = False
|
... | ... | |
1286 |
1287 |
VALID_BANDS = [UV17Pro._airband, UV17Pro._vhf_range, UV17Pro._vhf2_range,
|
1287 |
1288 |
UV17Pro._uhf_range, UV17Pro._uhf2_range]
|
1288 |
1289 |
|
|
1290 |
def check_set_memory_immutable_policy(self, existing, new):
|
|
1291 |
if (self._airband[0] <= new.freq <= self._airband[1] and
|
|
1292 |
new.mode == 'AM'):
|
|
1293 |
# This is valid, so mark mode as immutable so it doesn't get
|
|
1294 |
# blocked, and let the radio override it during set.
|
|
1295 |
new.immutable.append('mode')
|
|
1296 |
existing.immutable = []
|
|
1297 |
elif existing.mode == 'AM' and new.mode in self.MODES:
|
|
1298 |
# If we're going from a forced-AM channel to some valid one,
|
|
1299 |
# clear immutable so we allow the change.
|
|
1300 |
try:
|
|
1301 |
existing.immutable.remove('mode')
|
|
1302 |
except ValueError:
|
|
1303 |
pass
|
|
1304 |
super().check_set_memory_immutable_policy(existing, new)
|
|
1305 |
|
|
1306 |
@directory.register
|
|
1307 |
class UV18ProMaxGPS(UV17Pro):
|
|
1308 |
VENDOR = "Baofeng"
|
|
1309 |
MODEL = "UV-18ProMAXGPS"
|
|
1310 |
|
|
1311 |
_enc_key_idx = 6 # "RVB " key used
|
|
1312 |
_has_support_for_banknames = True # Yes
|
|
1313 |
_has_workmode_support = True # No idea
|
|
1314 |
_magic = MSTRING_UV17PROGPS # ANS: 0x06 (ACK)
|
|
1315 |
_magics = [(b"\x46", 16),
|
|
1316 |
# ANS: "\x016\x01t\x04\x00\x05 \x02\x00\x02`\x01\x03P\x03"
|
|
1317 |
# (\x01\x03 may be SW version 1.03)
|
|
1318 |
(b"\x4d", 7), # A: UV18PRO
|
|
1319 |
(b"SEND\x23\x06\x04\x11\x03\x0f\x09\x09\x06" +
|
|
1320 |
b"\x0e\x0f\x03\x09\x08\x02\x01\x06\x11\x12\x0e\x00", 1)]
|
|
1321 |
# 21 Bytes after SEND seem to be random, ANS: 0x06
|
|
1322 |
_has_when_to_send_aniid = False
|
|
1323 |
_vfoscan = True # No idea
|
|
1324 |
_has_gps = True # Yes
|
|
1325 |
_has_voxsw = True # No idea
|
|
1326 |
_has_pilot_tone = True # No idea
|
|
1327 |
_has_send_id_delay = True # No idea
|
|
1328 |
_has_skey2_short = True # No idea
|
|
1329 |
VALID_BANDS = [UV17Pro._airband, UV17Pro._vhf_range, UV17Pro._vhf2_range,
|
|
1330 |
UV17Pro._uhf_range, UV17Pro._uhf2_range]
|
|
1331 |
|
1289 |
1332 |
def check_set_memory_immutable_policy(self, existing, new):
|
1290 |
1333 |
if (self._airband[0] <= new.freq <= self._airband[1] and
|
1291 |
1334 |
new.mode == 'AM'):
|