-
-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Z21 pending request queue #73
base: master
Are you sure you want to change the base?
Conversation
Quick comparison with #59 approach (not fully accurate): LocoCache approachPROS:
CONS:
Pending Request Queue approachPROS:
CONS:
Edge case for reply ordering and external changes
We should detect the "bump" from 5 to 15 which should not interpreted as "train is already at 15" This can be fixed adding some sort of counter to tracked replies. Future workThe solution of course will be "best of both worlds". I'll try to tune both approaches to work together It already shows big improvement when simulating enormous network delays (100 ms for every message on Z21 side) |
Looking good, I really like it. Nice work! I don't own a z21 or Z21 yet so can't test it against a real one, I only have a Digikeijs DR5000 which supports the Z21 protocol.
Or that 6 .. 14 are dropped, it's UDP after all. But under normal circumstances without a high network load it probably won't happen. Maybe you can add a debug option to log some additional info about the retries, that might be useful if we find people to do some testing with it. p.s. As the Z21 implementation is receiving many improvements, it seems fair to me that you add a Copyright line for your name. (Don't know how this normally works...this is my first Open Source project with contributions :)) |
I'm glad! I forgot build is failing because I've based it on top of #56 so I'll need to modify it a bit |
9f5851f
to
0bf0698
Compare
0bf0698
to
094f4ef
Compare
08a1cb3
to
2f9cc61
Compare
Rebased onto #82 |
a7a7a1b
to
14a13c5
Compare
Handle LanXLocoInfo inside ClientKernel This allows reacting to external decoder state changes
Z21 Firmware 1.42 adds F29 to F31 to LAN_X_LOCO_INFO
Decoder changes caused by Z21 should not be sent back to Z21
React to Emenrgency Stop and direction change regardless of timeout status
14a13c5
to
57f524a
Compare
Now m_isUpdatingFromKernel P.S. I'm tired of rebasing!
It cannot be null
This makes it possible to detect replies from Z21 originated by our own requests and process them differently than externally generated messages. This also enables resending requests which did not receive the expected reply in timeout
57f524a
to
9700f0a
Compare
Pending request queue allows to retry sending messages after a timeout if expected reply is not received.
This also allows to detect a message is a reply to our own changes and react to it differently
See #60 for earlier discussion.
NOTE: needs #82 applied first
Both this and #82
LocoCache
try to resolve the "async loop" issue (See #57).This 2 solutions are orthogonal and can live together.