The delayCycles variables needs to be initialized differently
for periodic replies. It is initialized to the maxDelayCycles value now.
enableReplyInReplyMap was not called in my specific use case because no commands were being sent. delayCycles needs to be initiaited to a non-zero value in the case of a periodic reply because otherwise,the wrong branch in enableReply will be taken (see line ~800).
The delayCycles variables needs to be initialized differently
for periodic replies. It is initialized to the `maxDelayCycles` value now.
`enableReplyInReplyMap` was not called in my specific use case because no commands were being sent. delayCycles needs to be initiaited to a non-zero value in the case of a periodic reply because otherwise,the wrong branch in `enableReply` will be taken (see line ~800).
The intended design was that periodic replies could be enabled and disabled. insertInReplyMap() is only the definition of the reply and should not enable it directly.
Enabling is performed by calling updateReplyMapEntry() and thus setting delayCycles.
If you would like to make this a bit clearer, there could be an [en|dis]ablePeriodicReply which has less parameters than updateReplyMapEntry(). Prbably none. It only verifies that the reply is indeed periodic and then sets the delayCycles.
The intended design was that periodic replies could be enabled and disabled.
`insertInReplyMap()` is only the definition of the reply and should not enable it directly.
Enabling is performed by calling `updateReplyMapEntry()` and thus setting `delayCycles`.
If you would like to make this a bit clearer, there could be an `[en|dis]ablePeriodicReply` which has less parameters than `updateReplyMapEntry()`. Prbably none. It only verifies that the reply is indeed periodic and then sets the `delayCycles`.
Sounds good. So far, I have only needed periodic replies for devices like GPS which just start talking. There should be some form of decoumentation specifying what to do for that use case as well.
Sounds good. So far, I have only needed periodic replies for devices like GPS which just start talking. There should be some form of decoumentation specifying what to do for that use case as well.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The delayCycles variables needs to be initialized differently
for periodic replies. It is initialized to the
maxDelayCyclesvalue now.enableReplyInReplyMapwas not called in my specific use case because no commands were being sent. delayCycles needs to be initiaited to a non-zero value in the case of a periodic reply because otherwise,the wrong branch inenableReplywill be taken (see line ~800).The intended design was that periodic replies could be enabled and disabled.
insertInReplyMap()is only the definition of the reply and should not enable it directly.Enabling is performed by calling
updateReplyMapEntry()and thus settingdelayCycles.If you would like to make this a bit clearer, there could be an
[en|dis]ablePeriodicReplywhich has less parameters thanupdateReplyMapEntry(). Prbably none. It only verifies that the reply is indeed periodic and then sets thedelayCycles.Sounds good. So far, I have only needed periodic replies for devices like GPS which just start talking. There should be some form of decoumentation specifying what to do for that use case as well.
I updated the PR
Looks good