◆ available()
| virtual size_t arduino::HardwareCAN::available |
( |
| ) |
|
|
pure virtual |
Determine if any messages have been received and buffered.
- Returns
- the number of unread messages that have been received
◆ begin()
| virtual bool arduino::HardwareCAN::begin |
( |
CanBitRate const | can_bitrate | ) |
|
|
pure virtual |
Initialize the CAN controller.
- Parameters
-
| can_bitrate | the bus bit rate |
- Returns
- true if initialization succeeded and the controller is operational
◆ end()
| virtual void arduino::HardwareCAN::end |
( |
| ) |
|
|
pure virtual |
Disable the CAN controller.
Whether any messages that are buffered will be sent is implementation defined.
◆ read()
| virtual CanMsg arduino::HardwareCAN::read |
( |
| ) |
|
|
pure virtual |
Returns the first message received, or an empty message if none are available.
Messages must be returned in the order received.
- Returns
- the first message in the receive buffer
◆ write()
| virtual int arduino::HardwareCAN::write |
( |
CanMsg const & | msg | ) |
|
|
pure virtual |
Enqueue a message for transmission to the CAN bus.
This call returns when the message has been enqueued for transmission. Due to bus arbitration and error recovery there may be a substantial delay before the message is actually sent.
An implementation must ensure that all messages with the same CAN priority are sent in the order in which they are enqueued.
It is implementation defined whether multiple messages can be enqueued for transmission, and if messages with higher CAN priority can preempt the transmission of previously enqueued messages. The default configuration for and implementation should not allow multiple messages to be enqueued.
- Parameters
-
- Returns
- 1 if the message was enqueued, an implementation defined error code < 0 if there was an error
- Todo
- define specific error codes, especially "message already pending"
The documentation for this class was generated from the following file: