46 lines
1.1 KiB
YAML
46 lines
1.1 KiB
YAML
|
|
---
|
||
|
|
name: max length 1
|
||
|
|
desc:
|
||
|
|
idl:
|
||
|
|
interface foo {
|
||
|
|
listBar(list<bool> a @length(len) @max_length(5), out list<bool> b @length(len) @max_length(5), inout list<bool> c @length(len) @max_length(5), uint32 len) -> void
|
||
|
|
}
|
||
|
|
test_server.cpp:
|
||
|
|
- a = (bool *) erpc_malloc(5 * sizeof(bool));
|
||
|
|
- c = (bool *) erpc_malloc(5 * sizeof(bool));
|
||
|
|
- b = (bool *) erpc_malloc(5 * sizeof(bool));
|
||
|
|
|
||
|
|
---
|
||
|
|
name: max length 2
|
||
|
|
desc:
|
||
|
|
idl:
|
||
|
|
interface foo {
|
||
|
|
listString(string a @max_length(5), out string b @max_length(5), inout string c @max_length(5)) -> void
|
||
|
|
}
|
||
|
|
test_server.cpp:
|
||
|
|
- a = (char *) erpc_malloc((5 + 1) * sizeof(char));
|
||
|
|
- c = (char *) erpc_malloc((5 + 1) * sizeof(char));
|
||
|
|
- b = (char *) erpc_malloc((5 + 1) * sizeof(char));
|
||
|
|
|
||
|
|
---
|
||
|
|
name: const
|
||
|
|
desc:
|
||
|
|
params:
|
||
|
|
type:
|
||
|
|
- int8
|
||
|
|
- int16
|
||
|
|
- int32
|
||
|
|
- uint8
|
||
|
|
- uint16
|
||
|
|
- uint32
|
||
|
|
value:
|
||
|
|
- 42
|
||
|
|
idl: |
|
||
|
|
const {type} stringMaxSize = {value}
|
||
|
|
interface foo {
|
||
|
|
listString(string a @max_length(stringMaxSize)) -> void
|
||
|
|
}
|
||
|
|
test_server.cpp:
|
||
|
|
- 'const {type}_t stringMaxSize = {value};'
|
||
|
|
- a = (char *) erpc_malloc((stringMaxSize + 1) * sizeof(char));
|