Conversation
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.
Owner
Author
|
pytests still need fixing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.