Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions erpcgen/src/CGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ DataType *CGenerator::findChildDataType(set<DataType *> &dataTypes, DataType *da

if (isBinaryStruct(structType) || isListStruct(structType))
{
DataType *memberDataType = structType->getMembers()[0]->getDataType();
if (memberDataType->isList())
{
ListType *memberListDataType = dynamic_cast<ListType *>(memberDataType);
findChildDataType(dataTypes, memberListDataType->getElementType());
}
break;
}

Expand Down
39 changes: 38 additions & 1 deletion erpcgen/test/test_struct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ test_client.cpp:
- static void write_A_struct(erpc::Codec * codec, const A * data)
test_server.cpp:
- static void read_A_struct(erpc::Codec * codec, A * data)

---
name: return list struct
idl: |
Expand All @@ -52,6 +53,7 @@ test_server.cpp:
- read_list_int32_1_t_struct
- write_list_int32_1_t_struct
- free_list_int32_1_t_struct

---
name: binary struct c
idl: |
Expand All @@ -75,6 +77,41 @@ test_client.cpp:
- write_binary_t_struct
- write_Vector_struct
- not: read

---
name: in out binary struct c
idl: |
struct Vector {
list<binary> i
}

interface I {
foo(Vector a) -> void
bar() -> Vector
}
test.h:
- typedef struct binary_t binary_t;
- typedef struct Vector Vector;
- struct binary_t
- struct Vector
test_server.cpp:
- read_Vector_struct
- read_binary_t_struct
- read_list_binary_1_t_struct
- write_Vector_struct
- write_binary_t_struct
- write_list_binary_1_t_struct
- free_Vector_struct
- free_binary_t_struct
- free_list_binary_1_t_struct
test_client.cpp:
- write_Vector_struct
- write_binary_t_struct
- write_list_binary_1_t_struct
- read_Vector_struct
- read_binary_t_struct
- read_list_binary_1_t_struct

---
name: binary struct py
lang: py
Expand All @@ -89,4 +126,4 @@ idl: |
test/common.py:
- class Vector
- def _read
- def _write
- def _write