Conversation
|
I also have a change ready that queries the system for the state of a @property
def state(self) -> BusState:
try:
with pyroute2.IPRoute() as ipr:
operstate = ipr.get_links(ipr.link_lookup(ifname=self.channel)[0])[0].get_attr('IFLA_OPERSTATE')
except:
return BusState.UNKNOWN # Could be BusState.STOPPED instead (channel doesn't exist)
if operstate == 'ERROR-ACTIVE':
return BusState.ERROR_ACTIVE
elif operstate == 'ERROR-PASSIVE':
return BusState.ERROR_PASSIVE
elif operstate == 'BUS-OFF':
return BusState.BUS_OFF
elif operstate == 'STOPPED':
return BusState.STOPPED
else:
return BusState.UNKNOWN |
|
Generally i agree with this, but the consequence is, that It's a breaking change, but we could do this in a 5.0 release. We have to cleanup all the deprecations at some point anyway. |
|
I'm not sure I follow you since |
|
python-can/can/interfaces/pcan/pcan.py Line 124 in 654a02a It's ugly and should be replaced with listen_only (same name as in socketcan) in my opinion...
|
No description provided.