0

Transport Layer in CAN segments the messages that have a size greater than 8Bytes

my questions are :

-Is it possible to use one buffer for segmented data for all the type of messages in this case we consider the longest message and simply use buffer[MAX_DATA_MESSAGE]? or we should use a buffer for each message ?

-Is it possible to mix transmited frame and received frame in the same buffer?

Bou6
  • 84
  • 2
  • 10

1 Answers1

0

I assume you mean ISO-TP when you write Transport Layer in CAN.

While you may only transfer one message at a time on the same (RX-TX CAN IDs pair). You may have more than one such pair. For each such pair you will need a separate buffer. The size of those buffers should probably be the maximal message size you expect to see from all supported messages, but in any case you should check the sizes and not just accept data and copy it.

Using the same buffer for RX and TX is possible if you only build the TX frame after the RX frame received completely, but I wouldn't recommend it as this is error prone to use the same buffer to two different tasks.

MByD
  • 135,866
  • 28
  • 264
  • 277