Merged
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().
Owner
|
Nice, this looks really good. And thanks for taking care of the tests! |
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.
These changes make adding support for other devices easier by parameterizing config memory locations. Sets up #40.
Adding tests for the
configmodule exposed a few issues, which this PR tries to address.The GX1400 doesn’t store the selected region and the ATIS enabled flag in quite the same format as the HX870/HX890. 03a3685 moves the code parsing that data from the
infoCLI command into theconfigmodule.read_region()andread_atis_enabled()are modified to return a tuple instead of a scalar. These methods exist in thedevbranch, but haven’t been merged intomasteryet, so this shouldn’t be a breaking change for users.