diff --git a/chirp/drivers/vx170.py b/chirp/drivers/vx170.py index 0f81c8b7..ba9764bd 100644 --- a/chirp/drivers/vx170.py +++ b/chirp/drivers/vx170.py @@ -13,10 +13,14 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -from chirp.drivers import yaesu_clone, ft7800 -from chirp import chirp_common, directory, bitwise +import logging +from chirp.drivers import yaesu_clone, ft7800 +from chirp import chirp_common, directory, bitwise, errors + +LOG = logging.getLogger(__name__) MEM_FORMAT = """ +char model[6]; #seekto 0x018A; struct { u16 in_use; @@ -82,7 +86,7 @@ struct { class VX170Radio(ft7800.FTx800Radio): """Yaesu VX-170""" MODEL = "VX-170" - _model = "AH022" + _model = "AH022$" _memsize = 6057 _block_lengths = [8, 6048, 1] _block_size = 32 @@ -92,7 +96,7 @@ class VX170Radio(ft7800.FTx800Radio): chirp_common.PowerLevel("Lo", watts=0.50)] MODES = ["FM", "NFM"] - TMODES = ["", "Tone", "TSQL", "DTCS"] + TMODES = ["", "Tone", "TSQL", "TSQL-R", "DTCS"] @classmethod def get_prompts(cls): @@ -123,6 +127,11 @@ class VX170Radio(ft7800.FTx800Radio): def process_mmap(self): self._memobj = bitwise.parse(MEM_FORMAT, self._mmap) + if str(self._memobj.model) != self._model: + LOG.debug('Expected %r, found %r' % (self._model, + str(self._memobj.model))) + raise errors.RadioError( + 'Invalid model - radio is not %s' % self.MODEL) def get_features(self): rf = super(VX170Radio, self).get_features() @@ -132,3 +141,17 @@ class VX170Radio(ft7800.FTx800Radio): rf.memory_bounds = (1, 200) rf.valid_bands = [(137000000, 174000000)] return rf + + +@directory.register +class VX177Radio(VX170Radio): + MODEL = 'VX-177' + _model = 'AH022U' + POWER_LEVELS_UHF = [chirp_common.PowerLevel("Hi", watts=5.00), + chirp_common.PowerLevel("Med", watts=2.00), + chirp_common.PowerLevel("Lo", watts=0.50)] + + def get_features(self): + rf = super().get_features() + rf.valid_bands = [(420000000, 470000000)] + return rf diff --git a/tests/images/Yaesu_VX-177.img b/tests/images/Yaesu_VX-177.img new file mode 100644 index 00000000..05ce6411 Binary files /dev/null and b/tests/images/Yaesu_VX-177.img differ