Module for CAN interface. ESP32 has a CAN controller included, all you need is a CAN transciever.
For CAN interface constructor. Does not send anything, receives in any case only
For CAN interface constructor. Does not send ACKs on reception. For testing
For CAN interface constructor. Fully functional mode (default)
Flag for transmit(). Should be able to be received by itself
Flag for transmit() and message event. Is a remote transmit request
Too many errors occurred (rxError >= 256), interface no longer participates, intf.recover() must be called
intf.destroy() was called.
Now under 128 rxErrors or 128 txErrors
More than 128 rxError and 128 txError occurred
Recover is in progress (not finished until error count goes down)
For CAN interface constructor. Default values for 25 kbit/s
txError and rxError are both above or equal to intf.errorThreshold (default 96). Can be used to monitor CAN bus quality.
One of txError and rxError is again under intf.errorThreshold (default 96). Can be used to monitor CAN bus quality.
TX queue is now smaller than intf.txQueueThreshold. New data can therefore be sent.
Might be called on generic error not to do with actions of user. If no callback was specified for an intf.transmit or intf.recover, errors of these calls are also reported here.
||Error||If err.code == 'CAN_TX_QUEUE_FULL', then too many transmit() calls are executed at the same time (see constructor option txQueueSize). If err.code == 'CAN_ARB_LOST', then another node has sent with priority. (should only possible if can.NO_RETRANSMISSION is set) If err.code == 'CAN_RECOVER_INITIATED', then a recover process was started. If err.code == 'CAN_DESTROYED', destroy() was already called. Callback is not called on existing transmits() on call of destroy() Otherwise there was a generic error|
Fires on received message
||Buffer||The data, maximum 8 bytes|
||Number||The id of the recipient|
||Number||11 or 29|
||0||Bitfield of can.REMOTE_TRANSMIT_REQUEST is a remote transmit request|
Too many messages in the RX queue, messages had to be thrown away before the event message could be called for them. Remedy: Increase rxQueueSize in the constructor, set filter to ID in the constructor or use less blocking code. Event might be called only once for multiple errors of this type.
Fires on state change according to CAN2.0B Specification.
||Number||can.STATE_ERR_ACTIVE: Now under 128 rxErrors or 128 txErrors can.STATE_ERR_PASSIVE: More than 128 rxError and 128 txError occurred can.STATE_BUS_OFF: Too many errors occurred (rxError >= 256), interface no longer participates in the event. intf.recover() must be called can.STATE_RECOVERING: Recover is in progress (not finished until error count goes down). Data to be sent is buffered in the TX queue. can.STATE_DESTROYED: intf.destroy() was called.|