Skip to content

Merging dev into master#47

Open
cr wants to merge 26 commits intomasterfrom
dev
Open

Merging dev into master#47
cr wants to merge 26 commits intomasterfrom
dev

Conversation

@cr
Copy link
Owner

@cr cr commented Dec 10, 2025

No description provided.

cr and others added 26 commits March 24, 2025 14:27
The fifth byte in a waypoint definition is 0xf0 for waypoints created on the device itself, but 0xff for waypoints created in Yaesu's PC software, YCE15.

The radio seems to ignore the fifth byte altogether, so I'm not sure whether that difference was intentionally introduced by Yeasu, or if it was a mistake. Either way, both formats should be accepted by unpack_waypoint(). This change accomplishes that by simply ignoring the fifth byte, starting unpacking with the sixth byte, which contains the most significant digits of the latitude value.
Since the canonical source of the flash ID is now FLASH_ID in the config classes, that's what check_flash_id() should use. With this change, the "fixme" flash_id values in the device classes can be removed.

Verifying the flash ID check using the simulator requires a way to let tests control the config memory. Automatically populating the simulator with the correct flash ID should only happen if no config data is provided to the constructor.
Many Standard Horizon radios share the same hardware platform, but the memory layout varies from model to model. This change makes it easier to add additional models to hxtool.
Config users should have an easy way to retrieve the ATIS enabled flag as boolean and the region as string. How these values are stored in the device differs by model, so the previous approach of referring to a dict in the memory module may not scale well when support for more devices is added.

To avoid the need for extra methods, this change lets the new (unreleased) read_* methods return both the Python-y boolean/string value as well as the actual data byte read from the device memory as a tuple. This approach is similar to that of other methods like read_mmsi().
This change makes overriding the method in subclasses easier.
Localising knowledge about the simulators for each device model in the respective model classes avoids the proliferation of simulator generation statements in enumerate().
- Allow device selection with --model by itself (without --tty given). This is very useful when you have two different models connected at the same time (like HX870 and GX1400) because the model names are easy to remember, but the tty names are not.

- Allow --tty to specify an incomplete match (for example, `--tty usbserial` is now enough to select `/dev/cu.usbserial-17522`). An exact match is still preferred if there is one.

- Bring back model auto-detection for GX1400, now using the config memory magic rather than the flash ID. If the GX1400 is the only connected device, it should work without --tty or --model. This change makes provisions for reading the config magic from other non-USB device models that might need several different baudrates, although in practice, all the GX and HX models that are implemented in hxtool at this time seem to work correctly at 38400 baud.

- Auto-detecting the device model by USB meta data is now preferred whenever possible, even with --tty given. This should be fast and reliable, and it makes for a more unified approach to device selection.

- Overriding auto-detection is still possible by specifying both --tty and --model.
@cr
Copy link
Owner Author

cr commented Dec 10, 2025

pytests still need fixing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants