Added support for bus statistics in the kvaser interface.#477
Added support for bus statistics in the kvaser interface.#477hardbyte merged 5 commits intohardbyte:developfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #477 +/- ##
===========================================
+ Coverage 63.66% 63.66% +<.01%
===========================================
Files 55 56 +1
Lines 4687 4715 +28
===========================================
+ Hits 2984 3002 +18
- Misses 1703 1713 +10 |
hardbyte
left a comment
There was a problem hiding this comment.
Hi @sIuv - appreciate you taking the time to open this PR (GitHub tells me it's your first ever - if so welcome to the world of open source! 👋 )
If at all possible I like to avoid having backend specific functionality - just hanging a getstats on the Bus that only works for Kvaser isn't ideal. However to address this properly we will have to design a cross backend implementation... so for now I think your changes are okay to include.
One thing I'd like to be added before we can merge this change is documentation - Kvaser users will read this page and should get a good idea of what the custom method will do and return.
can/interfaces/kvaser/structures.py
Outdated
| Contains Python equivalents of the structures in CANLIB's canstat.h, | ||
| with some supporting functionality specific to Python. | ||
|
|
||
| Copyright (C) 2010 Dynamic Controls |
There was a problem hiding this comment.
Unless I'm missing something this isn't required
There was a problem hiding this comment.
Thank you for the fast response. Noticed that the reference to canstat.h was not correct either.
|
For documentation, would it be appropriate to remove get_stats form the bus section and add a new section. Bus |
|
Yeah documenting custom methods like that sounds like a good approach. |
|
Moved get stats to a separate documentation section like the suggestion above. |
hardbyte
left a comment
There was a problem hiding this comment.
Thanks for making those changes. Looks all good to me.
|
Hello Can you please suggest is this good way to get bus statistics for the Kvaser interface, i am using "can.interface.Bus.state()"this method to get bus status nfortunately it always returns as Active when the actual state is Passive. I checked the "can.interface.get_stats()" it does return with high bus load when the connection is lost with some error frames. |

No description provided.