Remote and Local Memory Configuration#96
Draft
Poikilos wants to merge 35 commits into
Draft
Conversation
…d make them more widely available and testable.
…nt). Add memoryService property so client code can register handlers.
…dd a type hint. Reduce logging (use info level for memory read).
… name (Set externally optionally).
…by callbacks if necessary).
…e. Add fromNumber. Change cache_cdi_path to classmethod. Add fromNumber to MemorySpace enum. Add force_end option in _memoryReadSuccess (reserved for future use).
…edTree, extractCDIVarMemos and related features. Add setData and enforce valid size(s).
…ng values (text content).
Only our datagram replies
…lar okReply commit for issue bobjacobsen#88).
…thod: deserializeMC2ndByte. Decode errorCode and collect error string (if present) from Datagram in rejectedReply. Add getBeforeNull for deserializing strings.
… _space value instead of causing unclear downstream error.
… retain the remote node list.
…figuration protocol from another node is not implemented).
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.
Supercedes (includes) #95
This PR has two major additions: (1) configuration of remote nodes, and (2) configuration of a local node.
Details on (2)'s progress: Requires handling memory configuration protocol messages on the Python side. As for the example I started, it is not complete. To understand why it is structured the way it is: Other examples are created from the perspective of a configuration tool. However, the new example is meant as a generic guide for implementing a typical node in Python. Therefore, no separate virtual node is created, and the node has its own CDI and memory
bytearray(eventually, a handler could be used to set variables in the program in addition to that, usingstruct.unpackto read back whatever the remote node wrote, though that step wouldn't be necessary if we were not doing emulation and instead were using a chip, in which case the firmware would read the written space directly). The variables selected are port and timeout, just for the purpose of using some kind of concrete things that actually apply to the software and that the far node can edit, so we would be allowing some far node to configure the Configuration Tool itself technically, but that is just for the sake of an example of how someone would implement a configurable node. See "...help" sub-list under Tasks below for progress.Tasks
(These changes are mostly directly related to enabling either remote or local memory configuration or both)
getSizereturn 8 for eventid.setDatato set a variable from raw data such as from the network safely (enforces size)LocalNodesubclass ofNodeto handle its own CDI and set values at its own memory addresses (used in newexample_node_memory_implementation.py)DataProcessorMemosuperclass as a memory configuration response in a case where CDI is not applicableI may need a little help:
examples/example_node_memory_implementation.py. Its handleDatagram method is missing the actual code necessary. I'm not sure if a Datagram handler is the ideal place to parse out memory read requests from a far node or not anyway. Can you advise or help with this?