Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of Change
Example showing how to transmit messages using the TWAI interface and a CAN transceiver.
It also uses the alerts to show how to set them up and react to them.
This is based on the receive example, adopted with the example from the api-reference for transmission: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/twai.html#message-transmission
Tests scenarios
I used an esp32-c3-devkit (ESP32-D0WDQ6) with a SN65HVD230 CAN transceiver.
This was attached between 2 Arduino Nano´s with a MCP2515/MCP2562 CAN interface, whereby they replayed a recording from a quite busy CAN bus.
The ESP32 is used to additionally transmit messages with this example into the bus and the output was observed.
Caution, when only another ESP32 is used to receive by the TWAI receive example the TWAI_MODE_LISTEN_ONLY has to be replaced with TWAI_MODE_NORMAL, otherwise there is no confirmation and the transmit example will fail.
Related links
The TWAI receive example: #7430