How do I make sense of constant's lookup numbers
Posted: Wed Apr 06, 2022 12:35 am
Not sure if I have worded this correctly but I am not sure how to look up constant's values. ie.
In the CAN class CAN.state() returns a value relating to the bus state. These state values are constants that relate to a one of 5 states
CAN.STOPPED
CAN.ERROR_ACTIVE
CAN.ERROR_PASSIVE
CAN.ERROR_WARNING
CAN.BUS_OFF
How do I know which state relates to the integer return from CAN.state()?
Code: Select all
>>>
>>> can1.state()
2
>>>
>>>
>>> can1.
any send BUS_OFF ERROR_ACTIVE
ERROR_PASSIVE ERROR_WARNING LIST16 LIST32
LOOPBACK MASK16 MASK32 NORMAL
SILENT SILENT_LOOPBACK STOPPED
clearfilter deinit info init
initfilterbanks recv restart
rxcallback setfilter state
>>>
>>>
>>>
CAN.STOPPED
CAN.ERROR_ACTIVE
CAN.ERROR_PASSIVE
CAN.ERROR_WARNING
CAN.BUS_OFF
How do I know which state relates to the integer return from CAN.state()?