Skip to content

Commit

Permalink
uk-k5(99) variant
Browse files Browse the repository at this point in the history
Updated comment to foldable. Referred DTCS and CTCSS tone codes to the chirp_common as they are the same. Made a bunch of other changes but reverted.
Added a registered radio variant with the firmward code of my handset only.
Tested it with connect radio, download memories (ca. 10 of), replace memories (ca. 125 of - repeaters, marine, pmr, etc), wrote to radio.
Radio still works so far.
  • Loading branch information
ei2081 committed Aug 15, 2024
1 parent 82633f7 commit 0409de8
Showing 1 changed file with 42 additions and 47 deletions.
89 changes: 42 additions & 47 deletions chirp/drivers/uvk5.py
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
# Quansheng UV-K5 driver (c) 2023 Jacek Lipkowski <sq5bpf@lipkowski.org>
#
# based on template.py Copyright 2012 Dan Smith <dsmith@danplanet.com>
#
#
# This is a preliminary version of a driver for the UV-K5
# It is based on my reverse engineering effort described here:
# https://github.com/sq5bpf/uvk5-reverse-engineering
#
# Warning: this driver is experimental, it may brick your radio,
# eat your lunch and mess up your configuration.
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

"""
# Quansheng UV-K5 driver (c) 2023 Jacek Lipkowski <sq5bpf@lipkowski.org>
#
# based on template.py Copyright 2012 Dan Smith <dsmith@danplanet.com>
#
#
# This is a preliminary version of a driver for the UV-K5
# It is based on my reverse engineering effort described here:
# https://github.com/sq5bpf/uvk5-reverse-engineering
#
# Warning: this driver is experimental, it may brick your radio,
# eat your lunch and mess up your configuration.
#
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
"""

import struct
import logging
Expand Down Expand Up @@ -272,29 +273,11 @@
TONE_RDCS = 3


CTCSS_TONES = [
67.0, 69.3, 71.9, 74.4, 77.0, 79.7, 82.5, 85.4,
88.5, 91.5, 94.8, 97.4, 100.0, 103.5, 107.2, 110.9,
114.8, 118.8, 123.0, 127.3, 131.8, 136.5, 141.3, 146.2,
151.4, 156.7, 159.8, 162.2, 165.5, 167.9, 171.3, 173.8,
177.3, 179.9, 183.5, 186.2, 189.9, 192.8, 196.6, 199.5,
203.5, 206.5, 210.7, 218.1, 225.7, 229.1, 233.6, 241.8,
250.3, 254.1
]
CTCSS_TONES = chirp_common.TONES # yes they were an exact match.

# lifted from ft4.py
DTCS_CODES = [
23, 25, 26, 31, 32, 36, 43, 47, 51, 53, 54,
65, 71, 72, 73, 74, 114, 115, 116, 122, 125, 131,
132, 134, 143, 145, 152, 155, 156, 162, 165, 172, 174,
205, 212, 223, 225, 226, 243, 244, 245, 246, 251, 252,
255, 261, 263, 265, 266, 271, 274, 306, 311, 315, 325,
331, 332, 343, 346, 351, 356, 364, 365, 371, 411, 412,
413, 423, 431, 432, 445, 446, 452, 454, 455, 462, 464,
465, 466, 503, 506, 516, 523, 526, 532, 546, 565, 606,
612, 624, 627, 631, 632, 654, 662, 664, 703, 712, 723,
731, 732, 734, 743, 754
]
DTCS_CODES = chirp_common.DTCS_CODES # yes, they were an exact match also


FLOCK_LIST = ["Off", "FCC", "CE", "GB", "430", "438"]

Expand Down Expand Up @@ -2083,3 +2066,15 @@ class RA79Radio(UVK5Radio):
"""Retevis RA79"""
VENDOR = "Retevis"
MODEL = "RA79"

# EI2081
# This is from a radio i purchased from AliExperess store "Eagle Store"
# which was quoted as both "Quansheng UV-K6" (in title) and "Quansheng UV-K5(99)" in the imagery.
# I'm not 100% sure it's legit Quansheng!
@directory.register
class UVK5_99_Radio(UVK5Radio):
MODEL = "UV-K5(99)"
@classmethod
def k5_approve_firmware(cls, firmware):
approved_prefixes = ('OSFW-bd90ca3')
return any(firmware.startswith(x) for x in approved_prefixes)

0 comments on commit 0409de8

Please sign in to comment.