summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Berg <christoph.berg@credativ.de>2020-01-13 12:14:06 +0100
committerChristoph Berg <christoph.berg@credativ.de>2020-01-13 12:14:06 +0100
commitfde7dff07bcc378297bf5a2988329f75e5a770b9 (patch)
tree596ff853f95f3d7e03997ddcc93187d53d85bbb6
parent497a604af31aeac68ad9de3cf471e32593fa175f (diff)
parent00d681381b37ac12674669e37713365f3145b9b9 (diff)
Update upstream source from tag 'upstream/20200107'
Update to upstream version '20200107' with Debian dir 08079a64634fd812d999f308ce4aa619e27737e6
-rw-r--r--PKG-INFO2
-rw-r--r--chirp/__init__.py2
-rw-r--r--chirp/drivers/baofeng_wp970i.py8
-rw-r--r--chirp/drivers/h777.py15
-rw-r--r--chirp/drivers/vx8.py28
5 files changed, 48 insertions, 7 deletions
diff --git a/PKG-INFO b/PKG-INFO
index e2107b3..8f2a0f8 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: chirp
-Version: daily-20191221
+Version: daily-20200107
Summary: UNKNOWN
Home-page: UNKNOWN
Author: UNKNOWN
diff --git a/chirp/__init__.py b/chirp/__init__.py
index acae797..a5c0a4c 100644
--- a/chirp/__init__.py
+++ b/chirp/__init__.py
@@ -17,7 +17,7 @@ import os
import sys
from glob import glob
-CHIRP_VERSION="daily-20191221"
+CHIRP_VERSION="daily-20200107"
module_dir = os.path.dirname(sys.modules["chirp"].__file__)
__all__ = []
diff --git a/chirp/drivers/baofeng_wp970i.py b/chirp/drivers/baofeng_wp970i.py
index 7eb1fb2..6feda61 100644
--- a/chirp/drivers/baofeng_wp970i.py
+++ b/chirp/drivers/baofeng_wp970i.py
@@ -902,3 +902,11 @@ class BFA58S(WP970I):
(200000000, 260000000),
self._uhf_range]
return rf
+
+
+@directory.register
+class UV9R(WP970I):
+ """Baofeng UV-9R"""
+ VENDOR = "Baofeng"
+ MODEL = "UV-9R"
+ LENGTH_NAME = 7
diff --git a/chirp/drivers/h777.py b/chirp/drivers/h777.py
index 36284f2..35ad1aa 100644
--- a/chirp/drivers/h777.py
+++ b/chirp/drivers/h777.py
@@ -109,11 +109,19 @@ def _h777_enter_programming_mode(radio):
elif ack != CMD_ACK:
raise errors.RadioError("Radio refused to enter programming mode")
+ original_timeout = serial.timeout
try:
serial.write("\x02")
+ # At least one version of the Baofeng BF-888S has a consistent
+ # ~0.33s delay between sending the first five bytes of the
+ # version data and the last three bytes. We need to raise the
+ # timeout so that the read doesn't finish early.
+ serial.timeout = 0.5
ident = serial.read(8)
except:
raise errors.RadioError("Error communicating with radio")
+ finally:
+ serial.timeout = original_timeout
if not ident.startswith("P3107"):
LOG.debug(util.hexprint(ident))
@@ -172,13 +180,20 @@ def _h777_write_block(radio, block_addr, block_size):
LOG.debug("Writing Data:")
LOG.debug(util.hexprint(cmd + data))
+ original_timeout = serial.timeout
try:
serial.write(cmd + data)
+ # Time required to write data blocks varies between individual
+ # radios of the Baofeng BF-888S model. The longest seen is
+ # ~0.31s.
+ serial.timeout = 0.5
if serial.read(1) != CMD_ACK:
raise Exception("No ACK")
except:
raise errors.RadioError("Failed to send block "
"to radio at %04x" % block_addr)
+ finally:
+ serial.timeout = original_timeout
def do_download(radio):
diff --git a/chirp/drivers/vx8.py b/chirp/drivers/vx8.py
index a87e415..56620a1 100644
--- a/chirp/drivers/vx8.py
+++ b/chirp/drivers/vx8.py
@@ -152,7 +152,9 @@ struct {
#seekto 0x328A;
struct {
- u8 unknown1;
+ u8 unknown1a:2,
+ half_deviation:1,
+ unknown1b:5;
u8 mode:2,
duplex:2,
tune_step:4;
@@ -167,7 +169,12 @@ struct {
tone:6;
u8 unknown6:1,
dcs:7;
- u8 unknown7[3];
+ u8 pr_frequency;
+ u8 unknown7;
+ u8 unknown8a:3,
+ unknown8b:1,
+ rx_mode_auto:1,
+ unknown8c:3;
} memory[900];
#seekto 0xC0CA;
@@ -332,7 +339,7 @@ u8 checksum;
TMODES = ["", "Tone", "TSQL", "DTCS"]
DUPLEX = ["", "-", "+", "split"]
-MODES = ["FM", "AM", "WFM"]
+MODES = ["FM", "AM", "WFM", "NFM"]
STEPS = list(chirp_common.TUNING_STEPS)
STEPS.remove(30.0)
STEPS.append(100.0)
@@ -494,7 +501,9 @@ class VX8BankModel(chirp_common.BankModel):
def _wipe_memory(mem):
mem.set_raw("\x00" * (mem.size() / 8))
- mem.unknown1 = 0x05
+ mem.pr_frequency = 0x1d # default PR frequency of 1600 Hz
+ mem.unknown8b = 1 # This bit must be 1, but its meaning is unknown
+ mem.rx_mode_auto = 1 # rx auto mode bit defaults to 1
@directory.register
@@ -653,7 +662,10 @@ class VX8Radio(yaesu_clone.YaesuCloneModeRadio):
mem.duplex = DUPLEX[_mem.duplex]
if mem.duplex == "split":
mem.offset = chirp_common.fix_rounded_step(mem.offset)
- mem.mode = MODES[_mem.mode]
+ if _mem.mode == "FM" and _mem.half_deviation == 1:
+ mem.mode = "NFM"
+ else:
+ mem.mode = MODES[_mem.mode]
mem.dtcs = chirp_common.DTCS_CODES[_mem.dcs]
mem.tuning_step = STEPS[_mem.tune_step]
mem.power = POWER_LEVELS[3 - _mem.power]
@@ -699,6 +711,12 @@ class VX8Radio(yaesu_clone.YaesuCloneModeRadio):
_mem.tone = chirp_common.TONES.index(mem.rtone)
_mem.tone_mode = TMODES.index(mem.tmode)
_mem.duplex = DUPLEX.index(mem.duplex)
+ if mem.mode == "NFM":
+ _mem.mode = 0 # Yaesu's NFM, i.e. regular FM
+ _mem.half_deviation = 1 # but half bandwidth
+ else:
+ _mem.mode = MODES.index(mem.mode)
+ _mem.half_deviation = 0
_mem.mode = MODES.index(mem.mode)
_mem.dcs = chirp_common.DTCS_CODES.index(mem.dtcs)
_mem.tune_step = STEPS.index(mem.tuning_step)