Conversation
26cda18 to
4da23ff
Compare
Creates ability to specify PDO default config in device config. This leads to a requirement for runtime default initialization (because PDO IDs can be a function of the node ID), which leads to a requirement to implement callbacks for loading persisted object values, so the way that callbacks are handled is also refactored. Callbacks are no longer required to be static, but instead Node has an generic lifetime.
4da23ff to
d508f03
Compare
Closed
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.
Allow PDO default settings to be specified in device config, e.g.:
This simple feature became more complicated -- and sprawled into 39 files! -- because the defaults are a function of the node ID, and that has implications for how/when defaults are initialized and persisted object values are loaded. Up to now, object defaults have just been set in object initializers, that will have to change in the future for all objects (see #35). For now, PDO defaults are initialized by the Node, and this means that persisted values cannot be loaded until after the node is created, so I went ahead and added callbacks for ResetApp and ResetComm, as well as all of the other NMT state changes. Applications that support persistent object stored should read the persisted objects in the ResetApp and ResetComm callbacks.
The callback structure is also adjusted, and callbacks are no longer required to have static lifetimes. Instead of passing the CAN message sender callback to
Node::process, it is included in the callbacks during initialization.Other breaking changes
node_configurationmod is moved from zencan-client to zencan-common.cobis changed tocob_idin node configuration files / PdoConfig.zencan_common::objects::PdoMappingrenamed toPdoMappableto distinguish it fromzencan_copmmon::pdo::PdoMapping.