From a50399266a232ab6d0a28d4aa90b20a068bde68d Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Tue, 3 Feb 2015 23:41:34 +0300 Subject: [PATCH] param.GetSet - string parameters support --- dsdl/uavcan/protocol/param/599.GetSet.uavcan | 18 +++++++++++------- dsdl/uavcan/protocol/param/Value.uavcan | 10 ++++++---- dsdl/uavcan/protocol/param/ValueString.uavcan | 5 +++++ 3 files changed, 22 insertions(+), 11 deletions(-) create mode 100644 dsdl/uavcan/protocol/param/ValueString.uavcan diff --git a/dsdl/uavcan/protocol/param/599.GetSet.uavcan b/dsdl/uavcan/protocol/param/599.GetSet.uavcan index 73f5d74dab..a5da59837e 100644 --- a/dsdl/uavcan/protocol/param/599.GetSet.uavcan +++ b/dsdl/uavcan/protocol/param/599.GetSet.uavcan @@ -2,19 +2,23 @@ # Get or set a parameter by name or by index. # -# If set - parameter will be assigned this value, then the new value will be returned -# If not set - current parameter value will be returned +# If set - parameter will be assigned this value, then the new value will be returned. +# If not set - current parameter value will be returned. +# Refer to the definition of Value for details. Value value -# Index of the parameter starting from 0; ignored if name is nonempty +# Index of the parameter starting from 0; ignored if name is nonempty. uint8 index -# Name of the parameter; always preferred over index if nonempty -uint8[<=40] name +# Name of the parameter; always preferred over index if nonempty. +uint8[<64] name --- -# Actual parameter value. For write requests it must contain the newly assigned parameter value. +# Actual parameter value. +# For set requests, it should contain the actual parameter value after the set request was +# executed. The objective is to let the client know if the value could not be updated, e.g. +# due to its range violation, etc. # Empty value indicates that there is no such parameter. Value value @@ -23,4 +27,4 @@ Value max_value # Optional Value min_value # Optional # Empty name in response indicates that there is no such parameter -uint8[<=40] name +uint8[<64] name diff --git a/dsdl/uavcan/protocol/param/Value.uavcan b/dsdl/uavcan/protocol/param/Value.uavcan index 083db54bdf..44bf6f98e2 100644 --- a/dsdl/uavcan/protocol/param/Value.uavcan +++ b/dsdl/uavcan/protocol/param/Value.uavcan @@ -1,8 +1,10 @@ # # Single parameter value. -# The actual type should be detected from the available values, as described below. +# The actual type should be inferred from the available values, as described below. +# If none of the values below are present, the value is considered empty. # -bool[<=1] value_bool # Preferred over int and float if ambiguous -int64[<=1] value_int # Preferred over float if ambiguous -float32[<=1] value_float +bool[<=1] value_bool # Preferred over int, float and string if ambiguous +int64[<=1] value_int # Preferred over float and string if ambiguous +float32[<=1] value_float # Preferred over string if ambiguous +ValueString[<=1] value_string # This one will be used only if all above are empty diff --git a/dsdl/uavcan/protocol/param/ValueString.uavcan b/dsdl/uavcan/protocol/param/ValueString.uavcan new file mode 100644 index 0000000000..2e44a557a3 --- /dev/null +++ b/dsdl/uavcan/protocol/param/ValueString.uavcan @@ -0,0 +1,5 @@ +# +# This type is nested in Value. +# + +uint8[<=80] value