Skip to content

Commit

Permalink
h777.py: add Baofeng BF-1909 - fixes #9760
Browse files Browse the repository at this point in the history
  • Loading branch information
KC9HI committed May 11, 2024
1 parent e95140f commit 9874e0d
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 6 deletions.
31 changes: 28 additions & 3 deletions chirp/drivers/h777.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def _h777_enter_programming_mode(radio):
except:
raise errors.RadioError("Error communicating with radio")

if not ident.startswith(b"P3107"):
if not ident.startswith(radio.IDENT):
LOG.debug(util.hexprint(ident))
raise errors.RadioError("Radio returned unknown identification string")

Expand Down Expand Up @@ -285,6 +285,7 @@ class H777Radio(chirp_common.CloneModeRadio):
VENDOR = "Baofeng"
MODEL = "BF-888"
PROGRAM_CMD = b'PROGRAM'
IDENT = b"P3107"
BAUD_RATE = 9600
NEEDS_COMPAT_SERIAL = False

Expand Down Expand Up @@ -399,12 +400,12 @@ def get_memory(self, number):
mem.empty = True
return mem

if _mem.rxfreq.get_raw(asbytes=False) == "\xFF\xFF\xFF\xFF":
if _mem.rxfreq.get_raw() == b"\xFF\xFF\xFF\xFF":
mem.freq = 0
mem.empty = True
return mem

if _mem.txfreq.get_raw(asbytes=False) == "\xFF\xFF\xFF\xFF":
if _mem.txfreq.get_raw() == b"\xFF\xFF\xFF\xFF":
mem.duplex = "off"
mem.offset = 0
elif int(_mem.rxfreq) == int(_mem.txfreq):
Expand Down Expand Up @@ -736,6 +737,30 @@ def match_model(cls, filedata, filename):
return False


@directory.register
class BF1909Radio(BF1901Radio):
VENDOR = "Baofeng"
MODEL = "BF-1909"
ALIASES = []
IDENT = b"P320h"
_ranges = [
(0x0000, 0x0110),
(0x0250, 0x0260),
(0x02B0, 0x02C0),
(0x03C0, 0x03E0),
]
_memsize = 0x03F0

# TODO: Is it 1 watt?
POWER_LEVELS = [chirp_common.PowerLevel("Low", watts=1.00),
chirp_common.PowerLevel("High", watts=10.00)]

@classmethod
def match_model(cls, filedata, filename):
# This model is only ever matched via metadata
return False


@directory.register
class MAVERICKRA100Radio(BFM4Radio):
VENDOR = "Maverick"
Expand Down
7 changes: 4 additions & 3 deletions tests/Python3_Driver_Testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
| <a name="Baofeng_5RX"></a> Baofeng_5RX | [@KC9HI](https://github.com/KC9HI) | 16-Jan-2024 | Yes | |
| <a name="Baofeng_BF-1901"></a> Baofeng_BF-1901 | [@cetinajero](https://github.com/cetinajero) | 3-Jul-2023 | Yes | |
| <a name="Baofeng_BF-1904"></a> Baofeng_BF-1904 | [@cetinajero](https://github.com/cetinajero) | 3-Jul-2023 | Yes | |
| <a name="Baofeng_BF-1909"></a> Baofeng_BF-1909 | [@KC9HI](https://github.com/KC9HI) | 10-May-2024 | Yes | |
| <a name="Baofeng_BF-888"></a> Baofeng_BF-888 | [@kk7ds](https://github.com/kk7ds) | 13-Feb-2019 | Yes | **15.53%** |
| <a name="Baofeng_BF-A58"></a> Baofeng_BF-A58 | [@KC9HI](https://github.com/KC9HI) | 3-Dec-2022 | Yes | **1.46%** |
| <a name="Baofeng_BF-A58S"></a> Baofeng_BF-A58S | [@KC9HI](https://github.com/KC9HI) | 3-Dec-2022 | Yes | 0.59% |
Expand Down Expand Up @@ -457,11 +458,11 @@
| <a name="Zastone_ZT-X6"></a> Zastone_ZT-X6 | [Implied by Retevis_RT22](#user-content-Retevis_RT22) | 9-Dec-2022 | Yes | 0.11% |
## Stats

**Drivers:** 454
**Drivers:** 455

**Tested:** 87% (398/56) (93% of usage stats)
**Tested:** 87% (399/56) (93% of usage stats)

**Byte clean:** 91% (415/39)
**Byte clean:** 91% (416/39)

## Meaning of this testing

Expand Down
Binary file added tests/images/Baofeng_BF-1909.img
Binary file not shown.
1 change: 1 addition & 0 deletions tests/py3_driver_testers.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ Baofeng_5RM,@vdwel,7-Dec-2023
Baofeng_5RX,@KC9HI,16-Jan-2024
Baofeng_BF-1901,@cetinajero,3-Jul-2023
Baofeng_BF-1904,@cetinajero,3-Jul-2023
Baofeng_BF-1909,@KC9HI,10-May-2024
Baofeng_BF-888,@kk7ds,13-Feb-2019
Baofeng_BF-A58,@KC9HI,3-Dec-2022
Baofeng_BF-A58S,@KC9HI,3-Dec-2022
Expand Down

0 comments on commit 9874e0d

Please sign in to comment.