DSDL string type
pavel-kirienko opened this issue · 1 comments
We will need native support for strings in UAVCAN v1.1 or later to avoid ambiguity like:
uint8[<=100] text
I propose a specialization of uint8
for strings named utf8
. While equivalent to uint8
serialization-wise, the new type hints code generators that the field in question is not an array of numbers but rather is a UTF-8 encoded text string. A similar approach is used in RTCM 3.
Likewise, a new scalar alias byte
should be defined to indicate that the field is neither a text string nor an array of integers, but an unstructured sequence of octets.
When used as a scalar, utf8
and byte
may be transformed into appropriate constructs according to the capabilities of the target programming language, e.g., utf8
as char
in C.
uint8[<=100] numbers
utf8[<=100] text
byte[<=100] binary_image
uint8 number
utf8 character
byte one_byte_long_image