From b6639d922b5deda22fa174af240dba89ad07a226 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Mon, 11 May 2015 20:48:35 +0300 Subject: [PATCH 1/4] Fixed naming in CoarseOrientation 'defined' cannot be used because it's a keyword in C/C++. --- dsdl/uavcan/equipment/CoarseOrientation.uavcan | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsdl/uavcan/equipment/CoarseOrientation.uavcan b/dsdl/uavcan/equipment/CoarseOrientation.uavcan index 0aec54d582..34f6145483 100644 --- a/dsdl/uavcan/equipment/CoarseOrientation.uavcan +++ b/dsdl/uavcan/equipment/CoarseOrientation.uavcan @@ -17,4 +17,4 @@ float32 ANGLE_MULTIPLIER = 4.7746482927568605 int5[3] fixed_axis_roll_pitch_yaw -bool defined # False if the orientation is actually not defined +bool orientation_defined # False if the orientation is actually not defined From 1c52527f97d0607d15815c41881dad9aa662f794 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 12 May 2015 12:29:15 +0300 Subject: [PATCH 2/4] Fixed KeyValue definition TAO is enabled, value is only float32 --- dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan b/dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan index 5566c0b83a..369bb1cec7 100644 --- a/dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan +++ b/dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan @@ -2,7 +2,13 @@ # Generic named parameter (key/value pair). # -bool alignment -uint8[<=100] key +# +# Integers are exactly representable in the range (-2^24, 2^24) which is (-16'777'216, 16'777'216). +# +float32 value -float64[<=1] value +# +# Tail array optimization is enabled, so if key length does not exceed 4 characters, +# the whole message can fit into one CAN frame. +# +uint8[<=34] key From 12b35d0da9ea35f3d5bef67ae1b3adb219cf24ea Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Fri, 15 May 2015 00:02:06 +0300 Subject: [PATCH 3/4] dsdlc: Fixed comment generation --- libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py | 2 +- .../libuavcan_dsdl_compiler/data_type_template.tmpl | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py index 0de8fea8a9..b92627fd07 100644 --- a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py +++ b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/__init__.py @@ -260,7 +260,7 @@ def make_template_expander(filename): template_text = re.sub(r'([^\$]{0,1})\$\{([^\}]+)\}', r'\1$!\2!$', template_text) # Flow control expression transformation: % foo: ==> - template_text = re.sub(r'(?m)^(\ *)\%\ *([^\:]+?):{0,1}$', r'\1', template_text) + template_text = re.sub(r'(?m)^(\ *)\%\ *(.+?):{0,1}$', r'\1', template_text) # Block termination transformation: ==> template_text = re.sub(r'\<\!--\(end[a-z]+\)--\>', r'', template_text) diff --git a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl index 8fd4d2f726..305d715dc5 100644 --- a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl +++ b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl @@ -311,7 +311,7 @@ const ::uavcan::DefaultDataTypeRegistrator< ${t.cpp_full_type_name} > _uavcan_gd // No default registration % endif -% for nsc in t.cpp_namespace_components: +% for nsc in t.cpp_namespace_components[::-1]: } // Namespace ${nsc} % endfor @@ -387,8 +387,8 @@ ${define_streaming_operator(type_name=t.cpp_full_type_name + '::Response')} ${define_streaming_operator(type_name=t.cpp_full_type_name)} % endif -% for nsc in t.cpp_namespace_components: -} +% for nsc in t.cpp_namespace_components[::-1]: +} // Namespace ${nsc} % endfor #endif // ${t.include_guard} From 34200c18bed6d9eaab34cf1c84980a3568fa32d9 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 16 May 2015 16:07:52 +0300 Subject: [PATCH 4/4] New logic of file.Read --- dsdl/uavcan/protocol/file/218.Read.uavcan | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dsdl/uavcan/protocol/file/218.Read.uavcan b/dsdl/uavcan/protocol/file/218.Read.uavcan index c7a54724fa..b120a86301 100644 --- a/dsdl/uavcan/protocol/file/218.Read.uavcan +++ b/dsdl/uavcan/protocol/file/218.Read.uavcan @@ -1,11 +1,15 @@ # -# Read contents of the file from remote node. -# Empty data in response means that the offset is out of file boundaries. -# Non-empty data means the end of file is not reached yet, even if the length is less than maximum. +# Read file from a remote node. +# +# There are two possible outcomes of a successful service call: +# 1. Data array size equals its capacity. This means that the end of the file is not reached yet. +# 2. Data array size is less than its capacity, possibly zero. This means that the end of file is reached. +# # Thus, if the client needs to fetch the entire file, it should repeatedly call this service while increasing the -# offset, until the empty data is returned. +# offset, until incomplete data is returned. +# # If the object pointed by 'path' cannot be read (e.g. it is a directory or it does not exist), appropriate error code -# will be returned. +# will be returned, and data array will be empty. # uint32 offset @@ -14,4 +18,4 @@ Path path --- Error error -uint8[<=250] data +uint8[<=256] data