Repository navigation
[merge] v0.4.1 from win-serial-patch - #6
Merged
Merged
Conversation
- Retry HELLO on NO_REPLY until TINC_DEVICE_WAIT_MS (same start as the device wait), so a PC host has time to load usbser and open the port - A repeat tinc_init() keeps USB up instead of re-enumerating, so the PC's COM port survives a retry - Test: HELLO answered after several lost replies, and never answered - Version 0.4.1
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.
Fixes TINCLIBC not connecting to tinclib-firmware's PC target (calculator plugged straight into the PC, PC app on the COM port). Every retry played the Windows disconnect/connect sound and no frame arrived. The ESP board path was not affected.
tinc_init()gave up on HELLO after 600 ms (TINC_RETRY_MAXxTINC_REPLY_TIMEOUT_MS). That's before Windows has loaded usbser and the PC app has the port open. It now retries onNO_REPLYuntilTINC_DEVICE_WAIT_MS, timed from the same start as the device wait, so the call stays bounded (~2.6 s at worst). Other errors still return at once, and the protocol timing constants are unchanged.tinc_init()keeps USB up instead of cleaning up and re-initialising. Re-enumerating is what made COM9 vanish on every retry. Onlytinc_shutdown()tears USB down now.test_hello_late_reply: HELLO answered after 2 xTINC_RETRY_MAXlost replies givesTINC_OK; never answered givesTINC_ERR_NO_REPLYafter roughly the window.Known limit, not fixed: while the calculator is idle nothing answers USB, so the PC's port open blocks until the next tinclib call. Pressing [enter] in TINCLIBC unblocks it.
Not yet tested on hardware. To check:
pio run -e pcin tinclib-firmware, run.pio/build/pc/program.exe COM9, start TINCLIBC. ExpectCOM9: open, then the HELLO exchange, within about a second of [enter]. Whether 2 s is enough on a first plug-in (usbser load) is unmeasured.After merge: tag v0.4.1 and move tinclib-config's
lib/tinclibsubmodule to it.