Skip to content

Add wrapper for char arrays to access str conveniently - #388

Merged
onur-ozkan merged 8 commits into
mavlink:masterfrom
azerupi:char-array
Oct 14, 2025
Merged

Add wrapper for char arrays to access str conveniently#388
onur-ozkan merged 8 commits into
mavlink:masterfrom
azerupi:char-array

Conversation

@azerupi

@azerupi azerupi commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

Follow-up on #370

This adds a wrapper around char arrays that allows to access them either as slices or as strings. When accessing the string representation, it will automatically convert the char array to a string slice up to the first null byte.

A part I have some slight doubts about is the serde derives on the CharArray<N> struct. If someone could validate that this is correct that would be great.

@azerupi
azerupi force-pushed the char-array branch 2 times, most recently from c419783 to 946d9f3 Compare August 27, 2025 23:24
@joaoantoniocardoso
joaoantoniocardoso self-requested a review August 28, 2025 16:55
@onur-ozkan
onur-ozkan self-requested a review August 29, 2025 04:42
@onur-ozkan

Copy link
Copy Markdown
Member

I will try to allocate sometime at Sunday to review this.

Comment thread mavlink-core/src/types.rs Outdated
Comment thread mavlink-core/src/types.rs Outdated
@onur-ozkan

Copy link
Copy Markdown
Member

By any chance, would you be able to finalize this PR anytime soon or should we take it over? It would be great to have it included in the next release (which will be in a week or so).

@azerupi

azerupi commented Oct 8, 2025

Copy link
Copy Markdown
Contributor Author

Hey sorry @onur-ozkan I went a bit dark, work got in the way.
I've updated the PR but I'm not sure at all how the changes interact with the newly merged TS generation from #404 and I have no idea how to test this.

@onur-ozkan

Copy link
Copy Markdown
Member

Hey sorry @onur-ozkan I went a bit dark, work got in the way. I've updated the PR but I'm not sure at all how the changes interact with the newly merged TS generation from #404 and I have no idea how to test this.

I am not very familiar with recent TS integration as well. Maybe @patrickelectric could help to check that since he's the author of that integration.

Comment thread mavlink-bindgen/src/parser.rs
@onur-ozkan

Copy link
Copy Markdown
Member

Could you please resolve conflicts when you have some free time?

azerupi and others added 7 commits October 11, 2025 14:39
This adds a wrapper around char arrays that allows
to access them either as slices or as strings. When
accessing the string representation, it will automatically
convert the char array to a string slice up to the first null byte.
@azerupi

azerupi commented Oct 11, 2025

Copy link
Copy Markdown
Contributor Author

I rebased and I believe I kept the intent behind #415, @patrickelectric would you be able to double check?

Comment thread mavlink-bindgen/src/parser.rs Outdated
@onur-ozkan
onur-ozkan merged commit b33ce10 into mavlink:master Oct 14, 2025
45 checks passed
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

Successfully merging this pull request may close these issues.

4 participants