IPC Limitation

This forum has moved to http://forum.legato.io

IPC Limitation

Postby dunasys2010 » Fri Jul 08, 2016 3:25 pm

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:

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
);



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.
dunasys2010
 
Posts: 9
Joined: Thu May 26, 2016 1:44 am
Has thanked: 0 time
Have thanks: 0 time

Re: IPC Limitation

Postby kmurphy » Wed Jul 20, 2016 9:04 pm

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
User avatar
kmurphy
 
Posts: 30
Joined: Fri Dec 06, 2013 3:33 pm
Has thanked: 0 time
Have thanks: 2 times

Re: IPC Limitation

Postby dunasys2010 » Thu Jul 21, 2016 8:03 am

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,
dunasys2010
 
Posts: 9
Joined: Thu May 26, 2016 1:44 am
Has thanked: 0 time
Have thanks: 0 time


Return to Legato Application Framework -- MOVED TO FORUM.LEGATO.IO

Who is online

Users browsing this forum: No registered users and 1 guest