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: 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 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']) 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" 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