# IPC communication between different apps

**URL:** <https://forum.legato.io/t/ipc-communication-between-different-apps/6998>\
**Category:** Legato Application Framework\
**Created:** [February 4, 2026, 12:55pm UTC](https://forum.legato.io/t/ipc-communication-between-different-apps/6998 "2026-02-04T12:55:42Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![fsdabharati](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@fsdabharati](https://forum.legato.io/u/fsdabharati)\
**Post date:** [February 4, 2026, 12:55pm UTC](https://forum.legato.io/t/ipc-communication-between-different-apps/6998/1 "2026-02-04T12:55:42Z")

</div>

is it possible to store a file in bundled format in one app and read the same file through another app if the apps are connected over IPC?

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 4, 2026, 1:47pm UTC](https://forum.legato.io/t/ipc-communication-between-different-apps/6998/2 "2026-02-04T13:47:04Z")

</div>

You can see here

> **[Type Support - Syntax - Legato Docs](https://docs.legato.io/latest/apiFilesSyntax.html#apiFilesSyntax_types)**
>
> Pre-defined Types: | legato™ is an open source Linux-based embedded platform designed to simplify connected IoT application development

I can see there is “file" type

---

<div class="post-metadata">

**Author:** ![fsdabharati](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@fsdabharati](https://forum.legato.io/u/fsdabharati)\
**Post date:** [February 4, 2026, 2:24pm UTC](https://forum.legato.io/t/ipc-communication-between-different-apps/6998/3 "2026-02-04T14:24:21Z")

</div>

It is not working for me

my function is mentioned in App1.c

static void ReadFileFromSecStore(const char\* secStoreKey)

{

```
uint8_t buf\[MAX_FILE_SIZE\];

size_t len = sizeof(buf);

le_result_t res = le_secStore_Read(secStoreKey, buf, &len);

if (res == LE_OK)

{

    LE_INFO("Successfully read '%s' from Secure Storage, size=%zu bytes", secStoreKey, len);

    // Example: if the file is text-based (PEM / XML)

    char\* text = malloc(len + 1);

    if (text)

    {

        memcpy(text, buf, len);

        text\[len\] = '\\0'; // null-terminate

        LE_INFO("File contents preview: %.100s...", text); // log first 100 chars only

        free(text);

    }

}

else

{

    LE_ERROR("Failed to read '%s' from Secure Storage (err=%d)", secStoreKey, res);

}

```

}

Could you tell me what will be included in my system.api so that above function can be called in another app which is connected via IPC.

I want to execute below function call from App2

COMPONENT\_INIT

{

```
ReadFileFromSecStore("tls/attest_priv.pem");

```

}

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 4, 2026, 2:44pm UTC](https://forum.legato.io/t/ipc-communication-between-different-apps/6998/4 "2026-02-04T14:44:34Z")

</div>

Does this help to pass an array?

> [@In legato 19.02 api is not supporting more than 2 string](https://forum.legato.io/t/in-legato-19-02-api-is-not-supporting-more-than-2-string/5716/2):
>
> how about making the API file like this? STRUCT ARRAY123 { string Array1[10]; int32 port1; string Array2[10]; int32 port2; string Array3[10]; int32 port3; string Array4[10]; int32 port4; string Array5[10]; int32 port5; }; FUNCTION arraySend ( ARRAY123 asd IN ); It is working on my side with vscode leaf swi-wp76\_4.7.0. You can use my code: [IPC\_step1.rar](https://forum.legato.io/uploads/short-url/dgUwkVXIXDa6sS6CbPxzjqn2x7a.rar) (2.4 KB)

---

<div class="post-metadata">

**Author:** ![fsdabharati](https://avatars.discourse-cdn.com/v4/letter/f/e0b2c6/32.png) [@fsdabharati](https://forum.legato.io/u/fsdabharati)\
**Post date:** [February 4, 2026, 2:53pm UTC](https://forum.legato.io/t/ipc-communication-between-different-apps/6998/5 "2026-02-04T14:53:48Z")

</div>

I included this in system.api

STRUCT ARRAY123

{

string Array1[10];

int32 port1;

string Array2[10];

int32 port2;

string Array3[10];

int32 port3;

string Array4[10];

int32 port4;

string Array5[10];

int32 port5;

};

FUNCTION arraySend

(

ARRAY123 asd IN

);

and also renamed my function in app1.c code like below but not workign for me

static void system\_arraySend(const char\* secStoreKey)

{

```auto
uint8_t buf\[MAX_FILE_SIZE\];

size_t len = sizeof(buf);

le_result_t res = le_secStore_Read(secStoreKey, buf, &len);

if (res == LE_OK)

{

    LE_INFO("Successfully read '%s' from Secure Storage, size=%zu bytes", secStoreKey, len);

    // Example: if the file is text-based (PEM / XML)

    char\* text = malloc(len + 1);

    if (text)

    {

        memcpy(text, buf, len);

        text\[len\] = '\\0'; // null-terminate

        LE_INFO("File contents preview: %.100s...", text); // log first 100 chars only

        free(text);

    }

}

else

{

    LE_ERROR("Failed to read '%s' from Secure Storage (err=%d)", secStoreKey, res);

}

```

}

---

<div class="post-metadata">

**Author:** ![jyijyi](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.legato.io/jyijyi/32/822_2.png) [@jyijyi](https://forum.legato.io/u/jyijyi)\
**Post date:** [February 4, 2026, 2:56pm UTC](https://forum.legato.io/t/ipc-communication-between-different-apps/6998/6 "2026-02-04T14:56:11Z")

</div>

How about this for client to server communication?

> [@Returning STRUCT from .api](https://forum.legato.io/t/returning-struct-from-api/6644/3):
>
> I have written a sample application for you, it is not returning the STRUCT, but it can return the required value in the parameter. [IPC\_step1\_api\_test.7z](https://forum.legato.io/uploads/short-url/nsDrojBBidshpQkuHnTsnq5AigZ.7z) (2.1 KB)

How about this for server to client communication?

> [@Cannot get callback between components (IPC) to work properly](https://forum.legato.io/t/cannot-get-callback-between-components-ipc-to-work-properly/4653/5):
>
> Here is an example to return STRUCT inside handler: You can see if it can be ported to your existing application. On the other hand, you can do another IPC call inside the handler to get the required data. Please see this sample application: [IPC\_step4\_payload\_test.7z](https://forum.legato.io/uploads/short-url/i7Rcvb2YVwwfUrcJSbeN4LzZPO6.7z) (3.0 KB)

Btw, in you code, secStoreKey is a input, so the IPC client should first read the file content and pass it to IPC server by the function arraySend()

Or you can set it to output, so the IPC server can first read the file content and pass it to IPC client when client calls the the function arraySend()
