Conversation
… setConfigDataAsync
…d logic for callbacks, so asyncisbusy and so on will also work properly if no callback pointer has been supplied
Many typos and bugs fixed
…e to configureAllConfigSettingsAsync
…ce-special-characters Fix processAck declaration casing
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| switch (inactivityHandlingStep++) { | ||
| case 0: | ||
| DEBUG_PRINT_MILLIS; | ||
| DEBUG_PRINTLN("Inactivity handling cancels pending async operations"); | ||
| asyncCancel(); | ||
| break; | ||
| case 1: | ||
| DEBUG_PRINT_MILLIS; | ||
| DEBUG_PRINTLN("Inactivity handling tries to force disable config mode"); | ||
| // We don't care about the result or a callback, if the command has the desired effect, fine; otherwise we will try to reboot the sensor anyway | ||
| disableConfigModeInternalAsync(true, nullptr); | ||
| break; | ||
| case 3: | ||
| DEBUG_PRINT_MILLIS; | ||
| DEBUG_PRINTLN("Inactivity handling reboots the sensor"); | ||
| // We don't care about the result, if the command has the desired effect, fine; otherwise we will try to reboot the sensor anyway | ||
| rebootAsync(true, nullptr); |
There was a problem hiding this comment.
Inactivity handler skips reboot step
The new handleInactivity() switch increments inactivityHandlingStep sequentially but only implements cases 0, 1, and 3. When the value reaches 2 the default branch executes, resets the state to 0, and calls heartbeat(), so the case 3 reboot logic is never reachable. In the previous implementation the sensor was rebooted after disabling config mode if it stayed unresponsive; now the library will loop over steps 0 and 1 forever and never reboot a hung sensor. Consider adding the missing case 2 (or renumbering) so the reboot is triggered after the intended number of retries.
Useful? React with 👍 / 👎.
No description provided.