From ee32bbd7edabd87f741236c3abb65886f4f5d389 Mon Sep 17 00:00:00 2001 From: Johannessen Date: Wed, 18 Jul 2018 19:37:07 +0200 Subject: [PATCH 1/5] Fix GitHub URLs --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index af35732..a9f9571 100755 --- a/setup.py +++ b/setup.py @@ -43,8 +43,8 @@ 'hx890', 'hx890e', 'firmware', 'flashing', 'mmsi', 'atis'], author='Christiane Ruetten', author_email='cr@23bit.net', - url='https://github.com/cr/pyhx870', - download_url='https://github.com/cr/pyhx870/archive/master.tar.gz', + url='https://github.com/cr/hx870', + download_url='https://github.com/cr/hx870/archive/master.tar.gz', license='GPLv3', packages=find_packages(exclude=["tests"]), include_package_data=True, # See MANIFEST.in From 352ecfc19ee0d4b6bd8c2841609295177c6260c4 Mon Sep 17 00:00:00 2001 From: Johannessen Date: Wed, 18 Jul 2018 19:38:09 +0200 Subject: [PATCH 2/5] Fix CLI 'dump' mode parsing in convert.py --- convert.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/convert.py b/convert.py index bfce8fc..97083e2 100755 --- a/convert.py +++ b/convert.py @@ -58,7 +58,7 @@ for dev, direction, string in protocol: print("%s %s%s" % (dev, "> " if direction == "0" else " < ", repr(string)[1:-1])) -elif mode == "extract": +elif mode == "dump": start_address = None prev_address = None for dev, direction, string in protocol: From 9de1c7fdf0ce88e9a751b41e2838830613e4eba6 Mon Sep 17 00:00:00 2001 From: Johannessen Date: Wed, 18 Jul 2018 20:28:36 +0200 Subject: [PATCH 3/5] Fix lamp and noise cancel level in template While porting the new fields discovered by @cr over to the HTML page at @johannessen/hx870 I spotted some minor errors in the template. By now the HTML page also contains a number of additional new fields, but I don't own 010 Editor and don't feel confident enough about its syntax to try and do more here than fix these two simple errors. --- hx870dat.bt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/hx870dat.bt b/hx870dat.bt index 62b274b..8dfae3a 100644 --- a/hx870dat.bt +++ b/hx870dat.bt @@ -4,11 +4,11 @@ // File: hx870dat.bt // Authors: Christiane Ruetten // E-Mail: cr@23bit.net -// Version: 0.1a +// Version: 0.1.1a // Purpose: Parsing Standard Horizon HX870 DAT files // Category: HF Radio // File Mask: *.dat -// ID Bytes: 03 67 01 00 00 00 00 00 +// ID Bytes: 03 67 // History: Based on https://johannessen.github.io/hx870/ //------------------------------------------------ @@ -21,7 +21,7 @@ BigEndian(); // Magic Bytes ----------------------------------- FSeek(0x0000); -uint16 MagicPrefix ; // always 0x0361 (871) +uint16 MagicPrefix ; // always 0x0367 (871) // 0002 Radio Status ----------------------------- @@ -56,7 +56,7 @@ enum _MultiWatch { MW_DUAL, MW_TRIPLE }; enum _ScanType { ST_MEMORY, ST_PRIORITY }; enum _EmergencyLED { EL_CONTINUOUS, EL_SOS, EL_BLINK1, EL_BLINK2, EL_BLINK3 }; enum _WaterHazardLED { WH_OFF, WH_ON, WH_ON_POWER_ON }; -enum _Lamp { L_OFF, L_3S, L_5S, L_10S, L_20S, L_30S, L_CONTINUOUS }; +enum _Lamp { L_OFF, L_3S, L_5S, L_10S, L_CONTINUOUS, L_20S, L_30S }; enum _AFPitchCONT { A_NORMAL, A_HIGH_LOW_CUT, A_HIGH_LOW_BOOST, A_LOW_BOOST, A_HIGH_BOOST }; enum _BatterySave { BS_OFF, BS_50, BS_70, BS_80, BS_90 }; enum _VOXDelayTime { V_0_5S, V_1S, V_1_5S, V_2S, V_3S }; @@ -94,9 +94,9 @@ struct _RadioConfiguration { // start: 0020 // Channels Setup continued _OffOn VOX; ubyte VOXLevel; // 0..4 - ubyte _unknown0044 ; // always 00 _VOXDelayTime VOXDelayTime; _OffOn NoiseCancelRx; + ubyte NoiseCancelRxLevel; // 0..3 _OffOn NoiseCancelTx; ubyte _unknown0046 ; // always 00 ubyte _unused0047[3] ; // always ff From 43d25a5ede0bef8d49dd20e896b56830846fdbd1 Mon Sep 17 00:00:00 2001 From: Arne Johannessen Date: Wed, 23 Oct 2019 17:28:54 +0200 Subject: [PATCH 4/5] Fix typo in HX870 class docstring (HX890 -> HX870) --- hxtool/device.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hxtool/device.py b/hxtool/device.py index c903ebe..ebbaca3 100644 --- a/hxtool/device.py +++ b/hxtool/device.py @@ -81,7 +81,7 @@ def enumerate_model(hx_device) -> list: class HX870(object): """ - Device object for Standard Horizon HX890 maritime radios + Device object for Standard Horizon HX870 maritime radios """ handle = "HX870" brand = "Standard Horizon" From aa424755fe82117ba41abdfcdedd0626dfd9a9e7 Mon Sep 17 00:00:00 2001 From: Arne Johannessen Date: Thu, 24 Oct 2019 18:06:12 +0200 Subject: [PATCH 5/5] Avoid confusing use of "waypoints" for GPS log data The HX870's GPS log functionality stores a history of past positions. This is completely unrelated to the radio's navigation functionality with routes and waypoints. To avoid confusion, the term "waypoints" should be avoided in the context of the GPS log. This change replaces "waypoints" with "trackpoints", which is used by GPX for this purpose. Alternatives include simply "points" or "positions". --- hxtool/cli/gpslog.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/hxtool/cli/gpslog.py b/hxtool/cli/gpslog.py index fda92c3..7f4e5bc 100644 --- a/hxtool/cli/gpslog.py +++ b/hxtool/cli/gpslog.py @@ -54,7 +54,7 @@ def run(self): stat = hx.comm.read_gps_log_status() logger.info(f"Log size {stat['pages_used'] * 4}kB, " - f"{stat['slots_used']} waypoints, " + f"{stat['slots_used']} trackpoints, " f"{stat['usage_percent']}% full") if stat["full_stop"]: logger.warning("Log is full. Logging is halted until erased") @@ -116,14 +116,14 @@ def decode_gps_log(data: bytes) -> dict or None: log = { "header": hexlify(log_header).decode("ascii"), "unknown": hexlify(unknown).decode("ascii"), - "waypoints": [] + "trackpoints": [] } offset = 0x40 while offset <= len(data) - 20: if data[offset:offset+4] == b"\xff\xff\xff\xff": break - log["waypoints"].append(unpack_log_line(data[offset:offset+20])) + log["trackpoints"].append(unpack_log_line(data[offset:offset+20])) offset += 20 return log @@ -146,7 +146,7 @@ def write_gpx(log_data: bytes, file_name: str) -> int: gpx_track.segments.append(gpx_segment) # Create points: - for point in log["waypoints"]: + for point in log["trackpoints"]: p = gpxpy.gpx.GPXTrackPoint( latitude=point["latitude"], longitude=point["longitude"], @@ -169,7 +169,7 @@ def write_json(log_data: bytes, file_name: str) -> int: if log is None: logger.warning("Log is blank. Not writing empty JSON log") return 0 - for w in log["waypoints"]: + for w in log["trackpoints"]: w["utc_time"] = w["utc_time"].isoformat() with open(file_name, "w") as f: dump(log, f, indent=4) @@ -195,7 +195,7 @@ def dump_log(log_data): if log is None: logger.info("Log is blank. Nothing to print") return 0 - for wp in log["waypoints"]: + for wp in log["trackpoints"]: lat_deg, lat_min = to_hm(wp['latitude']) lat_dir = 'N' if lat_deg >= 0 else 'S' lon_deg, lon_min = to_hm(wp['longitude'])