IPC Limitation


#1

Hi,

I am currently trying to use legato IPC.
The api file and the exchange of data between client and server using this api is working well as long as I trigger events without exceeding a particular size.

API file:

[i]DEFINE MSG_MAX_LEN = 8192;

ENUM Event
{
MSG_RECEIVED
};

HANDLER SpiReceptionHandler
(
Event spi_event_type,
string msg [MSG_MAX_LEN] IN,
uint16 msgLen IN
);

EVENT SpiReception
(
handler SpiReceptionHandler
);[/i]

As long as the UTF8 string size is lower than 1091 the event is Ok however if the size is bigger than 1090 I have the following message and the app is killed:
framework T=main | mem.c CheckGuardBands() 245 | Memory corruption detected at address 0x2ca28 at end of object allocated from pool ‘framework.msgs-5af14cfada752b66’.

My question is, Is there a limitation in size of the data sent from the server to a client ?

PS: It’s also a problem to not be able to send buffer filled with hex values through legato IPC API. (It’s always searching for a \0, the only solution is to code and decode using the base64 …).

Best regards.


#2

Hello dunasys,

Yes, currently there’s a hard limit of 1100 bytes of in an API message payload. This limitation is bidirectional, so both client and server messages are affected.

As far as your second problem goes, you can try sending your data as a byte array instead of a string. Then the generated API handlers will send the whole block of memory and will not look for NULL chars.

-Kelly


#3

Hi,

Thanks for your reply.

As far as your second problem goes, you can try sending your data as a byte array instead of a string.
I tried this with the following syntax:

HANDLER SpiReceptionHandler
(
Event spi_event_type,
uint8 msg [MSG_MAX_LEN] IN,
uint16 msgLen IN
);

However the api parser doesn’t allow to use an array of uint8 in the handler (there isn’t a parsing error if it’s in a function).

Did I misunderstood something concerning the syntax to define a byte array ?

Best regards,