diff options
| author | Christoph Berg <christoph.berg@credativ.de> | 2020-02-28 13:16:10 +0100 |
|---|---|---|
| committer | Christoph Berg <christoph.berg@credativ.de> | 2020-02-28 13:16:10 +0100 |
| commit | 966c8c98e21de5698e491a15a4d11b40ae8cecae (patch) | |
| tree | 1bcafc6193ca67ca07cbb09a2f0709e532e836f4 | |
| parent | b255867dd3e05fff714c5d3325c02596bf5854c8 (diff) | |
New upstream version 20200227upstream/20200227
| -rw-r--r-- | PKG-INFO | 2 | ||||
| -rw-r--r-- | chirp/__init__.py | 2 | ||||
| -rw-r--r-- | chirp/drivers/bj9900.py | 2 | ||||
| -rw-r--r-- | chirp/drivers/ft4.py | 49 | ||||
| -rw-r--r-- | chirp/drivers/radioddity_r2.py | 18 | ||||
| -rw-r--r-- | chirp/drivers/template.py | 6 |
6 files changed, 63 insertions, 16 deletions
@@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: chirp -Version: daily-20200213 +Version: daily-20200227 Summary: UNKNOWN Home-page: UNKNOWN Author: UNKNOWN diff --git a/chirp/__init__.py b/chirp/__init__.py index 7c35bda..ff597d3 100644 --- a/chirp/__init__.py +++ b/chirp/__init__.py @@ -17,7 +17,7 @@ import os import sys from glob import glob -CHIRP_VERSION="daily-20200213" +CHIRP_VERSION="daily-20200227" module_dir = os.path.dirname(sys.modules["chirp"].__file__) __all__ = [] diff --git a/chirp/drivers/bj9900.py b/chirp/drivers/bj9900.py index ef92d64..ff121fb 100644 --- a/chirp/drivers/bj9900.py +++ b/chirp/drivers/bj9900.py @@ -214,7 +214,7 @@ class BJ9900Radio(chirp_common.CloneModeRadio, rf.valid_cross_modes = list(self.CROSS_MODES) rf.valid_duplexes = list(self.DUPLEX) rf.has_tuning_step = False - # rf.valid_tuning_steps = list(self.STEPS) + rf.valid_tuning_steps = list(self.STEPS) rf.valid_bands = self.VALID_BANDS rf.valid_skips = [""] rf.valid_power_levels = self.POWER_LEVELS diff --git a/chirp/drivers/ft4.py b/chirp/drivers/ft4.py index 0b7f319..d41196a 100644 --- a/chirp/drivers/ft4.py +++ b/chirp/drivers/ft4.py @@ -469,10 +469,23 @@ class YaesuSC35GenericBankModel(chirp_common.BankModel): # the values in these lists must also be in the canonical UI list # we can re-arrange the order, and we don't need to have all # the values, but we cannot add our own values here. -DUPLEX = ["+", "", "-", "", "off", "", "split"] # (0,2,4,5)= (+,-,0, auto) -# the radio implements duplex "auto" as 5. we map to "" It appears to be -# a convienience function in the radio that affects the offset, but I do not -# understand it. + +DUPLEX = ["+", "", "-", "", "off", "", "split"] # (0,2,4,5) = (+, -, 0, auto) +# The radio implements duplex "auto" as 5. We map to "". It is a convenience +# function in the radio that affects the offset, which sets the duplex value +# according to the frequency in use. Yaesu doesn't entirely adhere to the band +# plans; but worse, they save the value 'auto' instead of + or -. Why Yaesu +# is doing such a thing is beyond me. [AE6YN] +DUPLEX_AUTO_US = [ + [145100000, 145495000, 2], + [146000000, 146395000, 0], + [146600000, 146995000, 2], + [147000000, 147395000, 0], + [147600000, 147995000, 2]] +# (There are no automatic duplex values in IARU-2 70CM.) +DUPLEX_AUTO_EU = [ + [145600000, 145800000, 2], + [438200000, 439425000, 2]] SKIPS = ["", "S"] @@ -1047,6 +1060,17 @@ class YaesuSC35GenericRadio(chirp_common.CloneModeRadio, name += chr(y) return name.rstrip() + def get_duplex(freq): # auto duplex to real duplex + """ + Select the duplex direction if duplex == 'auto'. + 0 is +, 2 is -, and 4 is none. + """ + return_value = 4 # off, if not in auto range + for x in self.DUPLEX_AUTO: + if freq in range(x[0], x[1]): + return_value = x[2] + return return_value + mem = chirp_common.Memory() _mem, ndx, num, regtype, sname = self.slotloc(memref) mem.number = num @@ -1081,12 +1105,14 @@ class YaesuSC35GenericRadio(chirp_common.CloneModeRadio, else: mem.freq = int(_mem.freq) * 10 txfreq = int(self._memobj.txfreqs[ndx].freq) * 10 - if (txfreq != 0) and (txfreq != mem.freq): - mem.duplex = "split" + if _mem.duplex == 5: # auto offset + mem.duplex = DUPLEX[get_duplex(mem.freq)] + else: + mem.duplex = DUPLEX[_mem.duplex] + if _mem.duplex == 6: # split: offset is tx frequency mem.offset = txfreq else: mem.offset = int(_mem.offset) * self.freq_offset_scale - mem.duplex = DUPLEX[_mem.duplex] self.decode_sql(mem, _mem) mem.power = POWER_LEVELS[2 - _mem.tx_pwr] mem.mode = ["FM", "NFM"][_mem.tx_width] @@ -1137,7 +1163,6 @@ class YaesuSC35GenericRadio(chirp_common.CloneModeRadio, self._memobj.names[ndx].chrs = bytearray(nametrim, "ascii") if mem.duplex == "split": txfreq = mem.offset / 10 - duplex = "off" # radio ignores when tx != rx self._memobj.txfreqs[num-1].freq = txfreq _mem.duplex = DUPLEX.index(duplex) if regtype in ["vfo", "home"]: @@ -1210,6 +1235,7 @@ class YaesuFT4XRRadio(YaesuFT4GenericRadio): MODEL = "FT-4XR" id_str = b'IFT-35R\x00\x00V100\x00\x00' valid_bands = VALID_BANDS_DUAL + DUPLEX_AUTO = DUPLEX_AUTO_US legal_steps = US_LEGAL_STEPS BAND_ASSIGNMENTS = BAND_ASSIGNMENTS_DUALBAND @@ -1222,6 +1248,7 @@ class YaesuFT4XERadio(YaesuFT4GenericRadio): MODEL = "FT-4XE" id_str = b'IFT-35R\x00\x00V100\x00\x00' valid_bands = VALID_BANDS_DUAL + DUPLEX_AUTO = DUPLEX_AUTO_EU legal_steps = STEP_CODE BAND_ASSIGNMENTS = BAND_ASSIGNMENTS_DUALBAND @@ -1234,6 +1261,7 @@ class YaesuFT4VRRadio(YaesuFT4GenericRadio): MODEL = "FT-4VR" id_str = b'IFT-15R\x00\x00V100\x00\x00' valid_bands = VALID_BANDS_VHF + DUPLEX_AUTO = DUPLEX_AUTO_US legal_steps = US_LEGAL_STEPS BAND_ASSIGNMENTS = BAND_ASSIGNMENTS_MONO_VHF @@ -1247,6 +1275,7 @@ class YaesuFT4VRRadio(YaesuFT4GenericRadio): # MODEL = "FT-4VE" # id_str = b'IFT-15R\x00\x00V100\x00\x00' # valid_bands = VALID_BANDS_VHF +# DUPLEX_AUTO = DUPLEX_AUTO_EU # legal_steps = STEP_CODE # BAND_ASSIGNMENTS = BAND_ASSIGNMENTS_MONO_VHF @@ -1259,6 +1288,7 @@ class YaesuFT65RRadio(YaesuFT65GenericRadio): MODEL = "FT-65R" id_str = b'IH-420\x00\x00\x00V100\x00\x00' valid_bands = VALID_BANDS_DUAL + DUPLEX_AUTO = DUPLEX_AUTO_US legal_steps = US_LEGAL_STEPS BAND_ASSIGNMENTS = BAND_ASSIGNMENTS_DUALBAND @@ -1271,6 +1301,7 @@ class YaesuFT65ERadio(YaesuFT65GenericRadio): MODEL = "FT-65E" id_str = b'IH-420\x00\x00\x00V100\x00\x00' valid_bands = VALID_BANDS_DUAL + DUPLEX_AUTO = DUPLEX_AUTO_EU legal_steps = STEP_CODE BAND_ASSIGNMENTS = BAND_ASSIGNMENTS_DUALBAND @@ -1283,6 +1314,7 @@ class YaesuFT25RRadio(YaesuFT65GenericRadio): MODEL = "FT-25R" id_str = b'IFT-25R\x00\x00V100\x00\x00' valid_bands = VALID_BANDS_VHF + DUPLEX_AUTO = DUPLEX_AUTO_US legal_steps = US_LEGAL_STEPS BAND_ASSIGNMENTS = BAND_ASSIGNMENTS_MONO_VHF @@ -1296,5 +1328,6 @@ class YaesuFT25RRadio(YaesuFT65GenericRadio): # MODEL = "FT-25E" # id_str = b'IFT-25R\x00\x00V100\x00\x00' # valid_bands = VALID_BANDS_VHF +# DUPLEX_AUTO = DUPLEX_AUTO_EU # legal_steps = STEP_CODE # BAND_ASSIGNMENTS = BAND_ASSIGNMENTS_MONO_VHF diff --git a/chirp/drivers/radioddity_r2.py b/chirp/drivers/radioddity_r2.py index ca2a13e..2ca8a70 100644 --- a/chirp/drivers/radioddity_r2.py +++ b/chirp/drivers/radioddity_r2.py @@ -90,6 +90,7 @@ struct { """ CMD_ACK = "\x06" +CMD_ALT_ACK = "\x53" CMD_STX = "\x02" CMD_ENQ = "\x05" @@ -146,8 +147,8 @@ def _r2_enter_programming_mode(radio): raise errors.RadioError("Error communicating with radio") # No idea yet what the next 7 bytes stand for - # as long as they start with ACK we are fine - if not ident.startswith(CMD_ACK): + # as long as they start with ACK (or ALT_ACK on some devices) we are fine + if not ident.startswith(CMD_ACK) and not ident.startswith(CMD_ALT_ACK): _r2_exit_programming_mode(radio) LOG.debug(util.hexprint(ident)) raise errors.RadioError("Radio returned unknown identification string") @@ -297,8 +298,7 @@ def do_upload(radio): _r2_exit_programming_mode(radio) -@directory.register -class RadioddityR2Radio(chirp_common.CloneModeRadio): +class RadioddityR2(chirp_common.CloneModeRadio): """Radioddity R2""" VENDOR = "Radioddity" MODEL = "R2" @@ -620,3 +620,13 @@ class RadioddityR2Radio(chirp_common.CloneModeRadio): # This radio has always been post-metadata, so never do # old-school detection return False + + +class RT24Alias(chirp_common.Alias): + VENDOR = "Retevis" + MODEL = "RT24" + + +@directory.register +class RadioddityR2Generic(RadioddityR2): + ALIASES = [RT24Alias] diff --git a/chirp/drivers/template.py b/chirp/drivers/template.py index 381b103..9802dc2 100644 --- a/chirp/drivers/template.py +++ b/chirp/drivers/template.py @@ -88,12 +88,16 @@ class TemplateRadio(chirp_common.CloneModeRadio): # Do a download of the radio from the serial port def sync_in(self): self._mmap = do_download(self) - self._memobj = bitwise.parse(MEM_FORMAT, self._mmap) + self.process_mmap() # Do an upload of the radio to the serial port def sync_out(self): do_upload(self) + # Convert the raw byte array into a memory object structure + def process_mmap(self): + self._memobj = bitwise.parse(MEM_FORMAT, self._mmap) + # Return a raw representation of the memory object, which # is very helpful for development def get_raw_memory(self, number): |
