IPC API _MAX_MSG_SIZE always 16

Hello,

I’ve been using the framework 18.6.4 on the FX30S and I ended up running into an issue while developing an IPC application.
Whenever I try to use a REFERENCE on any function in my API, I get the following error when I call that function from another application.

Assert Failed: ‘le_pack_PackReference( &_msgBufPtr, &_msgBufSize, CANSampleRef )’

Checking deeper inside the ifgen generated server.c and message.c files I found out that the definition of the message buffer is always being set to 16 bytes (#define _MAX_MSG_SIZE 16). However, my referenced struct is of size 40 bytes.
What can I do to increase the IPC message buffer? Do I need to pass an array to increase the buffer? Am I missing any declaration that should set the message buffer to the right value? Is it possible to set it manually by changing the ifgen templates?

This is my API file:

REFERENCE Sample;

HANDLER NewSampleHandler
(
Sample CANSampleRef
);

EVENT NewSample
(
NewSampleHandler handler
);

How can I call the client handler function passing a struct to it?

I followed all the tutorials, but I could never find any example using REFERENCE and IPC together. I tested that the REFERENCE works fine locally, but when called remotely, it throws the error mentioned above.

Is it possible to use REFERENCE at all with IPC?

Thank you very much!
Caio Porto

Hi @caio-porto,

I have few examples on how to pass a REFERENCE in a state handler in Legato code:

  • le_voicecall.api:143 : StateHandler uses a REFERENCE called Call and uses an event called State
  • le_audio.api:625 : MediaHandler uses a REFERENCE called Stream
  • le_avdata.api:212 : Fieldhandler

In your API file, I don’t see the IN suffix after CANSampleRef. It is mandatory, maybe your issue is linked to that. Handler should look like this:
HANDLER NewSampleHandler
(
Sample CANSampleRef IN
);

Can you, please, retest like this?
Thank’s

1 Like