Refactoring J2534#289
Conversation
- More readable TxStatus, ConnectFlags and RxStatus; - add method check_connection_opened(); - Fixing overcalling PassThruReadMsgs: Increase Timeout(from 1 to 100 ms) in call PassThruReadMsgs.
|
Took a while to check. I activated a CI agent |
| def specific_send(self, payload: bytes, timeout: Optional[float] = None) -> None: | ||
| if self.conn is None or not self.opened: | ||
| raise RuntimeError("Connection is not opened") | ||
| self.check_connection_opened() |
There was a problem hiding this comment.
This change breaks mypy.
You can add an assert to make it happy :
assert self.conn is not None
There was a problem hiding this comment.
fixed in SyncISOTPNetwork.is_open()
|
|
||
| def is_open(self) -> bool: | ||
| return self.opened | ||
| return self.conn and self.opened |
There was a problem hiding this comment.
return self.conn is not None and self.opened
There was a problem hiding this comment.
fixed in SyncISOTPNetwork.is_open()
| def specific_wait_frame(self, timeout: Optional[float] = None) -> Optional[bytes]: | ||
| if not self.opened or self.conn is None: | ||
| raise RuntimeError("Connection is not open") | ||
| self.check_connection_opened() |
There was a problem hiding this comment.
Same issue here.
assert self.conn is not None
There was a problem hiding this comment.
fixed in SyncISOTPNetwork.is_open()
| else: | ||
| self.specific_send(payload) | ||
|
|
||
| def check_connection_opened(self): |
There was a problem hiding this comment.
return type of func is missing: def check_connection_opened(self) -> None
3adf681 to
5a0446b
Compare
5a0446b to
ad6f95a
Compare
i think yes. There no changes in public API for J2534Connection. Only renamed some const inside low-level J2534 class. |
|
Alright! |
Uh oh!
There was an error while loading. Please reload this page.