From 898fe6722537481ceb6d50658355fd3de141b1f2 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Thu, 30 Apr 2015 11:24:06 +0300 Subject: [PATCH] Fixed message definitions; added a compile-time check for maximum serialized message length --- dsdl/uavcan/mavlink/1780.Message.uavcan | 2 +- dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan | 5 +++-- dsdl/uavcan/protocol/debug/1790.LogMessage.uavcan | 2 +- .../libuavcan_dsdl_compiler/data_type_template.tmpl | 6 +++++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dsdl/uavcan/mavlink/1780.Message.uavcan b/dsdl/uavcan/mavlink/1780.Message.uavcan index 110d1ca45e..ee56e0c7ef 100644 --- a/dsdl/uavcan/mavlink/1780.Message.uavcan +++ b/dsdl/uavcan/mavlink/1780.Message.uavcan @@ -7,4 +7,4 @@ uint8 sysid uint8 compid uint8 msgid -uint8[<256] payload +uint8[<=105] payload diff --git a/dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan b/dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan index cd4668e7f7..5566c0b83a 100644 --- a/dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan +++ b/dsdl/uavcan/protocol/debug/1789.KeyValue.uavcan @@ -2,6 +2,7 @@ # Generic named parameter (key/value pair). # -uint8[<=92] key +bool alignment +uint8[<=100] key -uavcan.protocol.param.Value value +float64[<=1] value diff --git a/dsdl/uavcan/protocol/debug/1790.LogMessage.uavcan b/dsdl/uavcan/protocol/debug/1790.LogMessage.uavcan index b1f093d070..e430f2c286 100644 --- a/dsdl/uavcan/protocol/debug/1790.LogMessage.uavcan +++ b/dsdl/uavcan/protocol/debug/1790.LogMessage.uavcan @@ -4,4 +4,4 @@ LogLevel level uint8[<32] source -uint8[<128] text +uint8[<94] 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 0c98cec956..8fd4d2f726 100644 --- a/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl +++ b/libuavcan/dsdl_compiler/libuavcan_dsdl_compiler/data_type_template.tmpl @@ -94,7 +94,11 @@ struct UAVCAN_EXPORT ${t.cpp_type_name} % endfor { enum { MaxByteLen = ::uavcan::BitLenToByteLen::Result }; - ::uavcan::StaticAssert::check(); + % if (t.kind == t.KIND_MESSAGE) and (t.has_default_dtid): + ::uavcan::StaticAssert::check(); + % else: + ::uavcan::StaticAssert::check(); + % endif ::uavcan::StaticAssert<_tmpl == 0>::check(); // Usage check