can, isotp, soft: threding fixes and small buffer device support impr…#4983
can, isotp, soft: threding fixes and small buffer device support impr…#4983BenGardiner wants to merge 1 commit intosecdev:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4983 +/- ##
==========================================
- Coverage 80.27% 77.15% -3.12%
==========================================
Files 382 364 -18
Lines 94349 94071 -278
==========================================
- Hits 75736 72583 -3153
- Misses 18613 21488 +2875
🚀 New features to boost your workflow:
|
| log_automotive.info("Target reset") | ||
| if self.reset_handler: | ||
| self.reset_handler() | ||
| result = self.reset_handler() |
There was a problem hiding this comment.
Can you please elaborate this use case a little more?
Why would the reset handler be used as a socket factory.
The proper place for a socket factory would be the reconnect handler.
By treating the reset_handler as socket factory would implicitly combine two different use cases.
There was a problem hiding this comment.
Yeo. It is use error to pass in a socket factory for a reset handler. It can happen though . I've done it . I added this to guard against that particular foot gun. So that if someone screws up the long running scanner call there is a graceful recovery and some results can still be obtained
There was a problem hiding this comment.
Sorry. This code goes even against the mypy typing. reset_handler should be a Callable[[], None]. If a user ignores that, it's not the job of the reset_target function to fix this.
If you think such a check is necessary, I would recommend a validation function inside init.
This would force someone to pass proper callbacks.
IMHO, the proper way would be to rely on the typechecker, and if someone disrespects that, he has to take care about the consequences.
|
Looks good, beside this one comment. Thanks for the PR. |
…ovements * try harder to drain before close to avoid warnings * unit tests to trigger issues encountered using soft sockt with slcan, candle, cantact on windows * threading robustness improvements * robustness improvements when using can adapters with small buffers * improvements to the heuristics for detecting can adapters with no hardware filtering
4299c6b to
31c2c4b
Compare
Checklist :
tox)I understand that failing to mention the use of AI may result in a ban. (We do not forbid it, but you must play fair. Be warned !)
cc @polybassa this is the isotp soft socket stuff extrated from PR #4961