Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DSDL string type #51

Open
pavel-kirienko opened this issue Jul 2, 2019 · 1 comment
Open

DSDL string type #51

pavel-kirienko opened this issue Jul 2, 2019 · 1 comment
Milestone

Comments

@pavel-kirienko
Copy link
Member

We will need native support for strings in UAVCAN v1.1 or later to avoid ambiguity like:

uint8[<=100] text
@pavel-kirienko
Copy link
Member Author

pavel-kirienko commented Sep 7, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant