Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(device)!: socket exception and process rebuild (#296)
changes list: 1. process all the socket send/recv in try/except to prevent socket error 2. always close socket after exception matched and force reconnect to refresh 3. increase query timeout from 1 to 2, and only apply it to query cmd/msg 4. recovery socket timeout after query and recv socket msg done in each for loop. 5. rebuild process to remove the duplicate message parse. 6. rename some func and args 7. with current changes, I don't see any timeout exception in my local device testing, if there is any new error exist, we can continue improve it in future PRs. Fixes #290 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Summary by CodeRabbit - **New Features** - Enhanced error handling for device discovery, now reporting `NoSupportedProtocol` for unsupported devices. - Streamlined socket connection process, improving reliability and clarity in communication. - Introduced `MessageResult` enumeration for improved clarity in message parsing. - **Bug Fixes** - Updated tests to reflect changes in exception handling, ensuring accurate responses to device compatibility issues. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Lucas Mindêllo de Andrade <[email protected]>
- Loading branch information