New BusState members per #736 - #1901
Conversation
bggardner
commented
Dec 2, 2024
I also have a change ready that queries the system for the state of a @propertydefstate(self) ->BusState:
try:
withpyroute2.IPRoute() asipr:
operstate=ipr.get_links(ipr.link_lookup(ifname=self.channel)[0])[0].get_attr('IFLA_OPERSTATE')
except:
returnBusState.UNKNOWN# Could be BusState.STOPPED instead (channel doesn't exist)ifoperstate=='ERROR-ACTIVE':
returnBusState.ERROR_ACTIVEelifoperstate=='ERROR-PASSIVE':
returnBusState.ERROR_PASSIVEelifoperstate=='BUS-OFF':
returnBusState.BUS_OFFelifoperstate=='STOPPED':
returnBusState.STOPPEDelse:
returnBusState.UNKNOWN |
zariiii9003
commented
Dec 4, 2024
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. |
bggardner
commented
Dec 4, 2024
I'm not sure I follow you since |
zariiii9003
commented
Dec 4, 2024
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.