Can Bus (TWAI) peripheral receive handling

orbitcoms
Posts: 15
Joined: Fri Aug 03, 2018 10:08 pm

Can Bus (TWAI) peripheral receive handling

Postby orbitcoms » Tue Oct 27, 2020 2:52 am

Just wanted to clarify.

Does the twai_receive() function fire after an entire packet is received and not on a byte by byte basis?

ie. If I have an xTask waiting for twai_receive() with portMax timeout, the task will wait for a cmplete can bus packet to be received and then trigger so all the bytes will be available immediately on reading the rx queue?

Thanks

PeterR
Posts: 568
Joined: Mon Jun 04, 2018 2:47 pm

Re: Can Bus (TWAI) peripheral receive handling

Postby PeterR » Wed Oct 28, 2020 11:39 pm

Complete.

Code: Select all

esp_err_t twai_receive(twai_message_t *message, TickType_t ticks_to_wait)
Clue is:

Code: Select all

twai_message_t 
rather than

Code: Select all

uint8_t *
& I also believe that IDF CAN should be fixed.

Who is online

Users browsing this forum: Baidu [Spider] and 26 guests