cmvr_head/packages/erpc-1.14.0/erpcgen/test/test_struct.yml
2025-12-30 15:44:41 +08:00

138 lines
2.5 KiB
YAML

---
name: basic struct
desc:
params:
type:
- int8
- int16
- int32
- uint8
- uint16
- uint32
- bool
- float
- double
idl: |
struct A {
{type} x
}
interface B {
testF(inout A b) ->void
}
test_common.h:
- typedef struct A A;
- struct A
- if: type in ('bool', 'float', 'double')
then:
- '{type} x;'
else:
- '{type}_t x;'
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: |
type ListType = list<int32>
interface foo {
bar(ListType x) -> ListType
}
test_common.h:
- typedef struct list_int32_1_t list_int32_1_t;
- typedef list_int32_1_t ListType;
- struct list_int32_1_t
test_client.cpp:
- write_list_int32_1_t_struct
- if(NULL == data)
- return;
- read_list_int32_1_t_struct
- if(NULL == data)
- return;
- ListType * foo_client::bar(const ListType * x)
test_server.cpp:
- read_list_int32_1_t_struct
- if(NULL == data)
- return;
- write_list_int32_1_t_struct
- if(NULL == data)
- return;
- free_list_int32_1_t_struct
---
name: binary struct c
idl: |
struct Vector {
binary i
}
interface foo {
bar(Vector x, binary y) -> void
}
test_common.h:
- typedef struct binary_t binary_t;
- typedef struct Vector Vector;
- struct binary_t
- struct Vector
test_server.cpp:
- read_binary_t_struct
- read_Vector_struct
- not: write
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_common.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
idl: |
struct Vector {
binary i
}
interface foo {
bar(Vector x, binary y) -> void
}
test/common.py:
- class Vector
- def _read
- def _write