summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-07-11 08:35:32 +0200
committerDamjan Marion <dmarion.lists@gmail.com>2016-07-11 23:03:40 +0000
commit3659a5aa366fce62151f42fecbca66853ec3a82d (patch)
treef5641b5bf7f767f6302dac3cdb2f234752bf4016
parent71893ac8b765dd997452fc58aedb6e0bd7b79a25 (diff)
VPP-190: support variable length array syntax in request messages
The information is aleardy stored in array.length field, but vpe.api syntax should be uniform. Change-Id: Id84cd95c088281609c70548346cf0e408a6f49ff Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
-rw-r--r--vpp-api/java/jvpp/gen/jvpp_c_gen.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/vpp-api/java/jvpp/gen/jvpp_c_gen.py b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
index 0b7fc67d41f..c1169863282 100644
--- a/vpp-api/java/jvpp/gen/jvpp_c_gen.py
+++ b/vpp-api/java/jvpp/gen/jvpp_c_gen.py
@@ -210,10 +210,12 @@ def generate_jni_impl(func_list, inputfile):
for t in zip(f['c_types'], f['args'], f['lengths']):
c_type = t[0]
c_name = t[1]
- # variable length arrays do not need special handling in requests,
- # because the length of Java array is known:
field_length = t[2][0]
+ # check if we are processing variable length array:
+ if t[2][1]:
+ field_length = util.underscore_to_camelcase(t[2][0])
+
java_field_name = util.underscore_to_camelcase(c_name)
struct_setter_template = struct_setter_templates[c_type]